feature(k8s) add

This commit is contained in:
coderaiser 2020-08-03 16:41:01 +03:00
parent 807a1bc26d
commit 72d111347e
2 changed files with 73 additions and 0 deletions

View file

@ -23,6 +23,7 @@ bin/release.js
client
webpack.config.js
k8s.yml
*.ai
*.cdr

72
k8s.yml Normal file
View file

@ -0,0 +1,72 @@
# persistant storage will used to keep data between restarts
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: cloudcmd-storage
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "100Mi"
---
# deployment is a manager for running container
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudcmd-pv
labels:
app: cloudcmd-pv
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: cloudcmd
template:
metadata:
labels:
app: cloudcmd
spec:
containers:
- name: cloudcmd
image: coderaiser/cloudcmd:latest
env:
- name: PORT
value: "8080"
resources:
limits: { memory: "150Mi", cpu: "100m" }
ports:
- containerPort: 8080
volumeMounts:
- name: cloudcmd-pv
mountPath: /storage
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
volumes:
# storage object that we created earlier
- name: cloudcmd-pv
persistentVolumeClaim:
claimName: cloudcmd-storage
---
# service is create internal DNS record for deployment
apiVersion: v1
kind: Service
metadata:
name: cloudcmd
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
ports:
- name: "cloudcmd"
port: 8080
selector:
app: cloudcmd-pv