From 6028a8b1a89abe8557b53b4f7e0e007a1e943f14 Mon Sep 17 00:00:00 2001 From: Steve Sloka Date: Mon, 18 Mar 2019 11:44:08 -0400 Subject: [PATCH] Add support for Kubernetes by deploying code-server. Also includes AWS (#146) example which persists data to a Persistent Volume / Claim. Signed-off-by: Steve Sloka --- deployment/aws/deployment.yaml | 74 ++++++++++++++++++++++++++++++++++ deployment/deployment.yaml | 43 ++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 deployment/aws/deployment.yaml create mode 100644 deployment/deployment.yaml diff --git a/deployment/aws/deployment.yaml b/deployment/aws/deployment.yaml new file mode 100644 index 00000000..964a9221 --- /dev/null +++ b/deployment/aws/deployment.yaml @@ -0,0 +1,74 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: code-server +--- +apiVersion: v1 +kind: Service +metadata: + name: code-server + namespace: code-server +spec: + ports: + - port: 8443 + name: https + protocol: TCP + selector: + app: code-server + type: ClusterIP +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: gp2 + annotations: + storageclass.kubernetes.io/is-default-class: "true" +provisioner: kubernetes.io/aws-ebs +parameters: + type: gp2 + fsType: ext4 +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: code-store + namespace: code-server +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 60Gi +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + app: code-server + name: code-server + namespace: code-server +spec: + selector: + matchLabels: + app: code-server + replicas: 1 + template: + metadata: + labels: + app: code-server + spec: + containers: + - image: codercom/code-server + imagePullPolicy: Always + name: code-servery + ports: + - containerPort: 8443 + name: https + volumeMounts: + - name: code-server-storage + mountPath: /go/src + volumes: + - name: code-server-storage + persistentVolumeClaim: + claimName: code-store + diff --git a/deployment/deployment.yaml b/deployment/deployment.yaml new file mode 100644 index 00000000..a032d523 --- /dev/null +++ b/deployment/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: code-server +--- +apiVersion: v1 +kind: Service +metadata: + name: code-server + namespace: code-server +spec: + ports: + - port: 8443 + name: https + protocol: TCP + selector: + app: code-server + type: ClusterIP +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + app: code-server + name: code-server + namespace: code-server +spec: + selector: + matchLabels: + app: code-server + replicas: 1 + template: + metadata: + labels: + app: code-server + spec: + containers: + - image: codercom/code-server + imagePullPolicy: Always + name: code-server + ports: + - containerPort: 8443 + name: https