From b9784744f0996b0cc13200036653e774984975b8 Mon Sep 17 00:00:00 2001 From: "nsingh@pivotal.io" Date: Thu, 20 Jun 2019 02:16:10 -0700 Subject: [PATCH 1/2] Changed file permissions for theia K8s --- theia-extensions/k8s-app/deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/theia-extensions/k8s-app/deploy.yml b/theia-extensions/k8s-app/deploy.yml index 679a885b7..14ca28609 100644 --- a/theia-extensions/k8s-app/deploy.yml +++ b/theia-extensions/k8s-app/deploy.yml @@ -28,6 +28,8 @@ spec: labels: app: theia-spring-boot spec: + securityContext: + fsGroup: 1000 containers: - name: theia-spring-boot image: theia-spring-boot @@ -36,7 +38,7 @@ spec: - containerPort: 3000 volumeMounts: - name: source - mountPath: home + mountPath: /home/project - name: git-sync image: k8s.gcr.io/git-sync:v3.0.1 volumeMounts: @@ -48,7 +50,9 @@ spec: - name: GIT_SYNC_BRANCH value: master - name: GIT_SYNC_DEST - value: project + value: spring-petclinic + - name: GIT_SYNC_PERMISSIONS + value: "0777" volumes: - name: source emptyDir: {} From c0e87564db02502883c268ad8ecdc55f84d49c65 Mon Sep 17 00:00:00 2001 From: "nsingh@pivotal.io" Date: Tue, 25 Jun 2019 06:39:32 -0700 Subject: [PATCH 2/2] Added resource requests to theia container Also added scripts to deploy and destroy theia in K8s --- theia-extensions/k8s-app/delete_theia_k8s.sh | 2 ++ theia-extensions/k8s-app/deploy.yml | 6 +++++- theia-extensions/k8s-app/deploy_theia_k8s.sh | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 theia-extensions/k8s-app/delete_theia_k8s.sh create mode 100755 theia-extensions/k8s-app/deploy_theia_k8s.sh diff --git a/theia-extensions/k8s-app/delete_theia_k8s.sh b/theia-extensions/k8s-app/delete_theia_k8s.sh new file mode 100755 index 000000000..b23b85004 --- /dev/null +++ b/theia-extensions/k8s-app/delete_theia_k8s.sh @@ -0,0 +1,2 @@ +kubectl delete deployment theia-spring-boot +kubectl delete service theia-spring-boot \ No newline at end of file diff --git a/theia-extensions/k8s-app/deploy.yml b/theia-extensions/k8s-app/deploy.yml index 14ca28609..b47a60861 100644 --- a/theia-extensions/k8s-app/deploy.yml +++ b/theia-extensions/k8s-app/deploy.yml @@ -29,7 +29,7 @@ spec: app: theia-spring-boot spec: securityContext: - fsGroup: 1000 + fsGroup: 3000 containers: - name: theia-spring-boot image: theia-spring-boot @@ -39,6 +39,10 @@ spec: volumeMounts: - name: source mountPath: /home/project + resources: + requests: + cpu: "2000m" + memory: 1000M - name: git-sync image: k8s.gcr.io/git-sync:v3.0.1 volumeMounts: diff --git a/theia-extensions/k8s-app/deploy_theia_k8s.sh b/theia-extensions/k8s-app/deploy_theia_k8s.sh new file mode 100755 index 000000000..d602cb307 --- /dev/null +++ b/theia-extensions/k8s-app/deploy_theia_k8s.sh @@ -0,0 +1,4 @@ +kubectl apply -f deploy.yml +kubectl get deployments +kubectl get pods +kubectl get services \ No newline at end of file