Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm chart deploy registries #13890

Merged
merged 10 commits into from
Jul 23, 2019
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2018 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
#

apiVersion: "v1"
name: "che-devfile-registry"
version: "0.0.1"
home: "https://github.com/eclipse/che-devfile-registry/"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Che devfile Registry Helm Chart

This Helm Chart install [Che](https://github.com/eclipse/che) devfile Registry. More information about Che devfile Registry can be found [here](https://github.com/eclipse/che-devfile-registry).
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Copyright (c) 2018 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
#

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: che
component: devfile-registry
name: devfile-registry
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: che
component: devfile-registry
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: che
component: devfile-registry
spec:
containers:
- image: {{ .Values.cheDevfileRegistry.image }}
imagePullPolicy: {{ .Values.cheDevfileRegistry.imagePullPolicy }}
name: che-devfile-registry
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /devfiles/
port: 8080
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /devfiles/
port: 8080
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 3
resources:
limits:
memory: {{ .Values.cheDevfileRegistry.memoryLimit }}
requests:
memory: {{ .Values.cheDevfileRegistry.memoryRequests }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2018 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
#

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: che-devfile-registry
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: {{ printf .Values.global.cheDevfileRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}
http:
paths:
- path: /
backend:
serviceName: che-devfile-registry
servicePort: 8080
{{- if .Values.global.tls.enabled }}
tls:
- hosts:
- {{ printf .Values.global.cheDevfileRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2018 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
#

apiVersion: v1
kind: Service
metadata:
labels:
app: che-devfile-registry
name: che-devfile-registry
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: che-devfile-registry
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2018 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
#

cheDevfileRegistry:
image: quay.io/eclipse/che-devfile-registry:nightly
imagePullPolicy: Always
memoryLimit: 32Mi
memoryRequests: 16Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2018 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
#

apiVersion: "v1"
name: "che-plugin-registry"
version: "0.0.1"
home: "https://github.com/eclipse/che-plugin-registry/"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Che Plugin Registry Helm Chart

This Helm Chart install [Che](https://github.com/eclipse/che) Plugin Registry. More information about Che Plugin Registry can be found [here](https://github.com/eclipse/che-plugin-registry).
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Copyright (c) 2018 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
#

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: che
component: plugin-registry
name: plugin-registry
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: che
component: plugin-registry
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: che
component: plugin-registry
spec:
containers:
- image: {{ .Values.chePluginRegistry.image }}
imagePullPolicy: {{ .Values.chePluginRegistry.imagePullPolicy }}
name: che-plugin-registry
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /plugins/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK /plugins is deprecated so should we wait for another path like v3/plugins ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR for plugin-registry eclipse-che/che-plugin-registry#189

port: 8080
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /plugins/
port: 8080
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 3
resources:
limits:
memory: {{ .Values.chePluginRegistry.memoryLimit }}
requests:
memory: {{ .Values.chePluginRegistry.memoryRequests }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2018 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
#

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: che-plugin-registry
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: {{ printf .Values.global.chePluginRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}
http:
paths:
- path: /
backend:
serviceName: che-plugin-registry
servicePort: 8080
{{- if .Values.global.tls.enabled }}
tls:
- hosts:
- {{ printf .Values.global.chePluginRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2018 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
#

apiVersion: v1
kind: Service
metadata:
labels:
app: che-plugin-registry
name: che-plugin-registry
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: che-plugin-registry
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2018 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
#

chePluginRegistry:
image: quay.io/eclipse/che-plugin-registry:nightly
imagePullPolicy: Always
memoryLimit: 32Mi
memoryRequests: 16Mi
8 changes: 8 additions & 0 deletions deploy/kubernetes/helm/che/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#

dependencies:
- name: che-devfile-registry
repository: file://./custom-charts/che-devfile-registry/
version: 0.0.1
condition: cheDevfileRegistry.deploy
- name: che-plugin-registry
repository: file://./custom-charts/che-plugin-registry/
version: 0.0.1
condition: chePluginRegistry.deploy
- name: che-postgres
repository: file://./custom-charts/che-postgres/
version: 1.0.0
Expand Down
20 changes: 15 additions & 5 deletions deploy/kubernetes/helm/che/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,22 @@ data:
{{- if .Values.workspaceDefaultRamLimit }}
CHE_WORKSPACE_DEFAULT_MEMORY_LIMIT_MB: {{ .Values.workspaceDefaultRamLimit }}
{{- end }}
{{- if and .Values.che .Values.che.workspace }}
{{- if .Values.che.workspace.devfileRegistryUrl }}
CHE_WORKSPACE_DEVFILE__REGISTRY__URL: {{ .Values.che.workspace.devfileRegistryUrl | quote}}
{{- if .Values.che.workspace.devfileRegistryUrl }}
CHE_WORKSPACE_DEVFILE__REGISTRY__URL: {{ .Values.che.workspace.devfileRegistryUrl | quote }}
{{- else if .Values.cheDevfileRegistry.deploy }}
{{- if .Values.global.tls.enabled }}
CHE_WORKSPACE_DEVFILE__REGISTRY__URL: https://{{ printf .Values.global.cheDevfileRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}
{{- else }}
CHE_WORKSPACE_DEVFILE__REGISTRY__URL: http://{{ printf .Values.global.cheDevfileRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how it will work if che would be configured to work over https?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, good question. It probably will not work. I guess we would need to have registries also on https then. I'll look at that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed af3eaeb
I'd like to avoid duplication of print, but I don't know how to do it to keep readability.

{{- end }}
{{- if .Values.che.workspace.pluginRegistryUrl }}
CHE_WORKSPACE_PLUGIN__REGISTRY__URL: {{ .Values.che.workspace.pluginRegistryUrl | quote}}
{{- end }}
{{- if .Values.che.workspace.pluginRegistryUrl }}
CHE_WORKSPACE_PLUGIN__REGISTRY__URL: {{ .Values.che.workspace.pluginRegistryUrl | quote }}
{{- else if .Values.chePluginRegistry.deploy }}
{{- if .Values.global.tls.enabled }}
CHE_WORKSPACE_PLUGIN__REGISTRY__URL: https://{{ printf .Values.global.chePluginRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}/v3
{{- else }}
CHE_WORKSPACE_PLUGIN__REGISTRY__URL: http://{{ printf .Values.global.chePluginRegistryUrlFormat .Release.Namespace .Values.global.ingressDomain }}/v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question about https?

{{- end }}
{{- end }}
{{- if .Values.workspaceSidecarDefaultRamLimit }}
Expand Down
12 changes: 10 additions & 2 deletions deploy/kubernetes/helm/che/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,20 @@ global:
runAsUser: 1724
fsGroup: 1724
postgresDebugLogs: false
cheDevfileRegistryUrlFormat: "che-devfile-registry-%s.%s"
chePluginRegistryUrlFormat: "che-plugin-registry-%s.%s"

che: {}
# workspace:
che:
workspace: {}
# devfileRegistryUrl: "https://che-devfile-registry.openshift.io/"
# pluginRegistryUrl: "https://che-plugin-registry.openshift.io/v3"

cheDevfileRegistry:
deploy: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we change this to external: false, to be consistent with what was decided for the operator (and what is already in place for the Keycloak case )?
cc @l0rd

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the way how we're doing that in operator, I agree. Do you know how to do NOT in requirements.yaml condition: ? https://github.com/sparkoo/che/blob/helm-chart-deploy-registries/deploy/kubernetes/helm/che/requirements.yaml#L14 I can't find anything how to achieve that and all my experiments are failing so far :/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the way how we're doing that in operator, I agree

it is

Do you know how to do NOT in requirements.yaml condition ?

TBH I don't know. Not a Helm expert, but what if you use an else as mentioned here: https://github.com/helm/helm/blob/master/docs/chart_template_guide/control_structures.md#ifelse

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't read the question correctly: if/else has nothing to do with your question it seems. So no, I don't know. Maybe using a calculated value that could be defined as the opposite of external ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I know, requirements.yaml is just clean yaml, no interpolation. And I believe all values there must be taken from values.yaml, which is the again just clean yaml. For keycloak we're doing check for true here https://github.com/eclipse/che/blob/master/deploy/kubernetes/helm/che/requirements.yaml#L18 global.cheDedicatedKeycloak. So we might go with deploy=true way, just for technology conventions sake here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it seems that you will have to do the same as for Keycloak.

I assume that CheCtl should do the same as the operator though, to maintain some sort of consistency.
@l0rd do you confirm ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean that there will be some inconsistency amongst helm and operator in the semantic of the parameter right? Yes it doesn't seam like a big deal and we can let chectl manage it


chePluginRegistry:
deploy: true

prometheus:
alertmanager:
enabled: false
Expand Down