From 28451a4323e246000e8493604a2626ace1a8675d Mon Sep 17 00:00:00 2001 From: Oleksandr Andriienko Date: Mon, 13 Jan 2020 16:55:21 +0200 Subject: [PATCH 1/3] Add ability to set up Che workspace and postgress pvc names using helm. Signed-off-by: Oleksandr Andriienko --- .../src/main/webapp/WEB-INF/classes/che/che.properties | 6 ++++-- .../che-postgres/templates/postgres-data-claim.yaml | 3 +++ deploy/kubernetes/helm/che/templates/configmap.yaml | 1 + deploy/kubernetes/helm/che/values.yaml | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties b/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties index e624e31100e..f40cb2e1073 100644 --- a/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties +++ b/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties @@ -290,7 +290,9 @@ che.infra.kubernetes.pvc.strategy=common # Note that this property has effect only if the 'common' PVC strategy used. che.infra.kubernetes.pvc.precreate_subpaths=true -# Defines the name of Persistent Volume Claim for che workspaces. +# Defines the settings of PVC name for che workspaces. +# Each PVC strategy suplies this value differently. +# See doc for che.infra.kubernetes.pvc.strategy property che.infra.kubernetes.pvc.name=claim-che-workspace # Defines the storage class of Persistent Volume Claim for the workspaces. @@ -392,7 +394,7 @@ che.infra.kubernetes.client.http.async_requests.max=1000 che.infra.kubernetes.client.http.async_requests.max_per_host=1000 # Max number of idle connections in the connection pool -# of the Kubernetes-client shared http client +# of the Kubernetes-client shared http client che.infra.kubernetes.client.http.connection_pool.max_idle=5 # Keep-alive timeout of the connection pool diff --git a/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml b/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml index 2c48d2c6805..9774a954b64 100644 --- a/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml +++ b/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml @@ -15,6 +15,9 @@ metadata: io.kompose.service: postgres-data name: postgres-data spec: + {{- if .Values.global.chePostgresPVCStorageClassName }} + storageClassName: {{ .Values.global.chePostgresPVCStorageClassName }} + {{- end }} accessModes: - ReadWriteOnce resources: diff --git a/deploy/kubernetes/helm/che/templates/configmap.yaml b/deploy/kubernetes/helm/che/templates/configmap.yaml index ca81c4c0f2f..7aad45fc4e1 100644 --- a/deploy/kubernetes/helm/che/templates/configmap.yaml +++ b/deploy/kubernetes/helm/che/templates/configmap.yaml @@ -59,6 +59,7 @@ data: CHE_INFRA_KUBERNETES_PVC_STRATEGY: "{{ .Values.global.cheWorkspacesPVCStrategy }}" CHE_INFRA_KUBERNETES_PVC_QUANTITY: {{ .Values.global.pvcClaim }} CHE_INFRA_KUBERNETES_PVC_PRECREATE__SUBPATHS: "true" + CHE_INFRA_KUBERNETES_PVC_STORAGE__CLASS__NAME: "{{ .Values.global.cheWorkspacePVCStorageClassName }}" CHE_INFRA_KUBERNETES_POD_SECURITY__CONTEXT_RUN__AS__USER: "{{ .Values.global.securityContext.runAsUser }}" CHE_INFRA_KUBERNETES_POD_SECURITY__CONTEXT_FS__GROUP: "{{ .Values.global.securityContext.fsGroup }}" CHE_LOCAL_CONF_DIR: /etc/conf diff --git a/deploy/kubernetes/helm/che/values.yaml b/deploy/kubernetes/helm/che/values.yaml index 1d3c9941091..ab36e887c1f 100644 --- a/deploy/kubernetes/helm/che/values.yaml +++ b/deploy/kubernetes/helm/che/values.yaml @@ -62,6 +62,8 @@ global: # Possible values: common, per-workspace, unique cheWorkspacesPVCStrategy: "common" pvcClaim: "1Gi" + cheWorkspacePVCStorageClassName: "" + chePostgresPVCStorageClassName: "" cheWorkspacesNamespace: "-che" # Service account name that will be mounted to workspaces pods # Note that: From 0ccbee67a079d710a213c7aa8931a9641c0e0ddb Mon Sep 17 00:00:00 2001 From: Oleksandr Andriienko Date: Tue, 14 Jan 2020 17:40:29 +0200 Subject: [PATCH 2/3] improve helm value chePostgresPVCStorageClassName location Signed-off-by: Oleksandr Andriienko --- deploy/kubernetes/helm/che/values.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/kubernetes/helm/che/values.yaml b/deploy/kubernetes/helm/che/values.yaml index ab36e887c1f..39f85c04ea1 100644 --- a/deploy/kubernetes/helm/che/values.yaml +++ b/deploy/kubernetes/helm/che/values.yaml @@ -62,8 +62,8 @@ global: # Possible values: common, per-workspace, unique cheWorkspacesPVCStrategy: "common" pvcClaim: "1Gi" + # Defines the storage class of Persistent Volume Claim(s) for the workspaces. cheWorkspacePVCStorageClassName: "" - chePostgresPVCStorageClassName: "" cheWorkspacesNamespace: "-che" # Service account name that will be mounted to workspaces pods # Note that: @@ -83,6 +83,8 @@ global: runAsUser: 1724 fsGroup: 1724 postgresDebugLogs: false + # Defines the storage class of Persistent Volume Claim for Postgres database. + chePostgresPVCStorageClassName: "" cheDevfileRegistryUrlFormat: "devfile-registry-%s.%s" chePluginRegistryUrlFormat: "plugin-registry-%s.%s" From ae7024be75ae8f21d66aa91512270ebf81054b5a Mon Sep 17 00:00:00 2001 From: Oleksandr Andriienko Date: Wed, 15 Jan 2020 14:16:12 +0200 Subject: [PATCH 3/3] Fix indent in the yaml. Signed-off-by: Oleksandr Andriienko --- .../che-postgres/templates/postgres-data-claim.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml b/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml index 9774a954b64..376e6c3ee5d 100644 --- a/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml +++ b/deploy/kubernetes/helm/che/custom-charts/che-postgres/templates/postgres-data-claim.yaml @@ -16,7 +16,7 @@ metadata: name: postgres-data spec: {{- if .Values.global.chePostgresPVCStorageClassName }} - storageClassName: {{ .Values.global.chePostgresPVCStorageClassName }} + storageClassName: {{ .Values.global.chePostgresPVCStorageClassName }} {{- end }} accessModes: - ReadWriteOnce