diff --git a/.npmignore b/.npmignore index f0c9ab36..9a15f5c4 100644 --- a/.npmignore +++ b/.npmignore @@ -23,6 +23,7 @@ bin/release.js client webpack.config.js +k8s.yml *.ai *.cdr diff --git a/k8s.yml b/k8s.yml new file mode 100644 index 00000000..3e800ba6 --- /dev/null +++ b/k8s.yml @@ -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 +