Kubernetes部署ethercalc在线表格工具
主页
github
文档
Dockerfile
nginx配置
ConfigMap redis-ethercalc
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-ethercalc
namespace: sre
data:
redis.conf: |
bind 0.0.0.0
port 6379
#requirepass 123456
appendonly yes
cluster-node-timeout 5000
protected-mode no
Deployment redis-ethercalc
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-ethercalc
namespace: sre
spec:
replicas: 1
selector:
matchLabels:
name: redis-ethercalc
template:
metadata:
labels:
name: redis-ethercalc
spec:
containers:
- name: redis
image: redis
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- "exec redis-server /etc/redis/redis.conf"
ports:
- containerPort: 6379
name: redis
protocol: TCP
volumeMounts:
- name: redis-config
mountPath: /etc/redis
volumes:
- name: redis-config
configMap:
name: redis-ethercalc
svc redis-ethercalc
kind: Service
apiVersion: v1
metadata:
name: redis-ethercalc
namespace: sre
spec:
ports:
- name: redis
port: 6379
targetPort: 6379
protocol: TCP
selector:
name: redis-ethercalc
Deployment ethercalc
apiVersion: apps/v1
kind: Deployment
metadata:
name: ethercalc
namespace: sre
spec:
replicas: 1
selector:
matchLabels:
name: ethercalc
template:
metadata:
labels:
name: ethercalc
spec:
containers:
- name: ethercalc
image: audreyt/ethercalc
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
name: http
protocol: TCP
env:
- name: REDIS_PORT_6379_TCP_ADDR
value: 'redis-ethercalc'
- name: REDIS_PORT_6379_TCP_PORT
value: '6379'
svc ethercalc
kind: Service
apiVersion: v1
metadata:
name: ethercalc
namespace: sre
spec:
type: NodePort
ports:
- name: http
port: 8000
nodePort: 30009
targetPort: 8000
protocol: TCP
selector:
name: ethercalc