Skip to content

Commit

Permalink
Disable che-data pvc creation for musltiuser che deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
akorneta committed Mar 26, 2018
1 parent 9406a21 commit d5526bd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
12 changes: 8 additions & 4 deletions deploy/kubernetes/helm/che/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ spec:
fieldRef:
fieldPath: metadata.namespace
{{- end }}
{{- if not .Values.global.multiuser }}
- name: fmp-volume-permission
image: busybox
command: ["chmod", "777", "/data"]
volumeMounts: [{
"mountPath": "/data",
"name": "che-data-volume"
}]
{{- end }}
containers:
- env:
- name: CHE_DOMAIN
Expand Down Expand Up @@ -233,17 +235,19 @@ spec:
memory: 600Mi
requests:
memory: 256Mi
{{- if not .Values.global.multiuser }}
volumeMounts:
- mountPath: /data
name: che-data-volume
volumes:
- name: che-data-volume
persistentVolumeClaim:
claimName: che-data-volume
{{- end }}
{{- if .Values.registry }}
{{- if and .Values.registry.password .Values.registry.username }}
imagePullSecrets:
- name: registry-pull-secret
{{- end }}
{{- end }}
serviceAccountName: che
volumes:
- name: che-data-volume
persistentVolumeClaim:
claimName: che-data-volume
2 changes: 2 additions & 0 deletions deploy/kubernetes/helm/che/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# http://www.eclipse.org/legal/epl-v10.html
#

{{- if not .Values.global.multiuser }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
resources:
requests:
storage: 1Gi
{{- end }}
20 changes: 3 additions & 17 deletions deploy/openshift/che-openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,7 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: che
name: che-data-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
#CHE_MASTER_PVC
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand Down Expand Up @@ -77,12 +66,9 @@ items:
requests:
memory: 256Mi
volumeMounts:
- mountPath: /data
name: che-data-volume
#CHE_MASTER_VOLUME_MOUNTS
serviceAccountName: che
volumes:
- name: che-data-volume
persistentVolumeClaim:
claimName: che-data-volume
#CHE_MASTER_VOLUMES
triggers:
- type: ConfigChange
4 changes: 4 additions & 0 deletions deploy/openshift/deploy_che.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ CHE_CONFIG_FILE_PATH=${CHE_CONFIG_FILE_PATH:-${DEFAULT_CHE_CONFIG_FILE_PATH}}
cat "${CHE_DEPLOYMENT_FILE_PATH}" | \
sed "s/ image:.*/ image: \"${CHE_IMAGE_SANITIZED}\"/" | \
sed "s/ imagePullPolicy:.*/ imagePullPolicy: \"${IMAGE_PULL_POLICY}\"/" | \
if [[ "${CHE_MULTIUSER}" != "true" ]]; then
sed "s|#CHE_MASTER_PVC|- apiVersion: v1\n kind: PersistentVolumeClaim\n metadata:\n labels:\n app: che\n name: che-data-volume\n spec:\n accessModes:\n - ReadWriteOnce\n resources:\n requests:\n storage: 1Gi|" | \
sed "s| #CHE_MASTER_VOLUME_MOUNTS.*| - mountPath: /data \n name: che-data-volume|" | \
sed "s| #CHE_MASTER_VOLUMES.*| - name: che-data-volume\n persistentVolumeClaim:\n claimName: che-data-volume|";else cat -; fi | \
inject_che_config "#CHE_MASTER_CONFIG" "${CHE_CONFIG_FILE_PATH}"
}

Expand Down

0 comments on commit d5526bd

Please sign in to comment.