Skip to content

Commit

Permalink
Make che update Images from registries at startup (eclipse-che#18562)
Browse files Browse the repository at this point in the history
* Added support for Keycloak admin secret
Added support to change endpoint-watcher image

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

* Added user feedback and validation for Keycloak password

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

* Apply suggestions from code review

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

Co-authored-by: Anatolii Bazko <abazko@redhat.com>

* Apply suggestions from code review

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

Co-authored-by: Anatolii Bazko <abazko@redhat.com>

* Added feature to registries to update images at startup.

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

* Trying to improve value names and we use them

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

* Added missing newline

Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

* Missing newline
Signed-off-by: Eric Ladouceur <eric.ladouceur@cyber.gc.ca>

* Added checksums to configmap to enable pod restart on configmap change.

Signed-off-by: cccs-eric <eric.ladouceur@cyber.gc.ca>

* Applied code review changes.

Signed-off-by: cccs-eric <eric.ladouceur@cyber.gc.ca>

* Update from code review

Signed-off-by: cccs-eric <eric.ladouceur@cyber.gc.ca>

Co-authored-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
cccs-eric and tolusha authored Dec 21, 2020
1 parent 5656fea commit c4e03c1
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2018-2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

kind: ConfigMap
apiVersion: v1
metadata:
name: che-devfile-registry
data:
{{- with .Values.cheDevfileImagesOverride -}}
{{- with .url }}
CHE_DEVFILE_IMAGES_REGISTRY_URL: {{ . | quote }}
{{- end }}
{{- with .organization }}
CHE_DEVFILE_IMAGES_REGISTRY_ORGANIZATION: {{ . | quote }}
{{- end }}
{{- with .tag }}
CHE_DEVFILE_IMAGES_REGISTRY_TAG: {{ . | quote }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ spec:
labels:
app: che
component: devfile-registry
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
containers:
- image: {{ .Values.cheDevfileRegistry.image }}
Expand Down Expand Up @@ -59,3 +61,7 @@ spec:
memory: {{ .Values.cheDevfileRegistry.memoryLimit }}
requests:
memory: {{ .Values.cheDevfileRegistry.memoryRequests }}
envFrom:
- configMapRef:
name: che-devfile-registry
optional: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2018-2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

kind: ConfigMap
apiVersion: v1
metadata:
name: che-plugin-registry
data:
{{- with .Values.chePluginSidecarOverride -}}
{{- with .url }}
CHE_SIDECAR_CONTAINERS_REGISTRY_URL: {{ . | quote }}
{{- end }}
{{- with .organization }}
CHE_SIDECAR_CONTAINERS_REGISTRY_ORGANIZATION: {{ . | quote }}
{{- end }}
{{- with .tag }}
CHE_SIDECAR_CONTAINERS_REGISTRY_TAG: {{ . | quote }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ spec:
labels:
app: che
component: plugin-registry
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
containers:
- image: {{ .Values.chePluginRegistry.image }}
Expand Down Expand Up @@ -59,3 +61,7 @@ spec:
memory: {{ .Values.chePluginRegistry.memoryLimit }}
requests:
memory: {{ .Values.chePluginRegistry.memoryRequests }}
envFrom:
- configMapRef:
name: che-plugin-registry
optional: true
8 changes: 8 additions & 0 deletions deploy/kubernetes/helm/che/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ data:
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 }}"
{{- if .Values.cheInfraKubernetesPvcJobsImage }}
CHE_INFRA_KUBERNETES_PVC_JOBS_IMAGE: {{ .Values.cheInfraKubernetesPvcJobsImage | quote }}
{{- end }}
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
Expand Down Expand Up @@ -122,6 +125,8 @@ data:
{{- if .Values.che.workspace.pluginBroker.waitTimeoutMin }}
CHE_WORKSPACE_PLUGIN__BROKER_WAIT__TIMEOUT__MIN: {{ .Values.che.workspace.pluginBroker.waitTimeoutMin | quote }}
{{- end }}
CHE_WORKSPACE_PLUGIN__BROKER_METADATA_IMAGE: {{ .Values.che.workspace.pluginBroker.metadataImage | quote }}
CHE_WORKSPACE_PLUGIN__BROKER_ARTIFACTS_IMAGE: {{ .Values.che.workspace.pluginBroker.artifactsImage | quote }}
{{- end }}
{{- if .Values.workspaceSidecarDefaultRamLimit }}
CHE_WORKSPACE_SIDECAR_DEFAULT__MEMORY__LIMIT__MB: {{ .Values.workspaceSidecarDefaultRamLimit | quote }}
Expand All @@ -146,3 +151,6 @@ data:
CHE_WORKSPACE_JAVA__OPTIONS: "-Xmx2000m"
CHE_WORKSPACE_MAVEN__OPTIONS: "-Xmx20000m"
CHE_INFRA_KUBERNETES_WORKSPACE__START__TIMEOUT__MIN: "15"
{{- if .Values.cheServerSecureExposerJwtProxyImage }}
CHE_SERVER_SECURE__EXPOSER_JWTPROXY_IMAGE: {{ .Values.cheServerSecureExposerJwtProxyImage | quote }}
{{- end }}

0 comments on commit c4e03c1

Please sign in to comment.