diff --git a/deploy/kubernetes/helm/che/templates/dashboard-deployment.yaml b/deploy/kubernetes/helm/che/templates/dashboard-deployment.yaml new file mode 100644 index 000000000000..f33349edb702 --- /dev/null +++ b/deploy/kubernetes/helm/che/templates/dashboard-deployment.yaml @@ -0,0 +1,57 @@ +# +# Copyright (c) 2012-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: che-dashboard + name: che-dashboard +spec: + replicas: 1 + revisionHistoryLimit: 2 + selector: + matchLabels: + app: che + component: che-dashboard + strategy: + type: Recreate + template: + metadata: + labels: + app: che + component: che-dashboard + spec: + containers: + - image: {{ .Values.cheDashboardImage }} + imagePullPolicy: {{ .Values.cheImagePullPolicy }} + livenessProbe: + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 120 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 15 + timeoutSeconds: 60 + name: che-dashboard + ports: + - containerPort: 8080 + name: http + resources: + limits: + memory: 256Mi + requests: + memory: 128Mi diff --git a/deploy/kubernetes/helm/che/templates/dashboard-service.yaml b/deploy/kubernetes/helm/che/templates/dashboard-service.yaml new file mode 100644 index 000000000000..46ff8c277cb3 --- /dev/null +++ b/deploy/kubernetes/helm/che/templates/dashboard-service.yaml @@ -0,0 +1,25 @@ +# +# Copyright (c) 2012-2019 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 + component: che-dashboard + name: che-dashboard +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: che + component: che-dashboard diff --git a/deploy/kubernetes/helm/che/templates/dashboard-traefik-gateway-configmap.yaml b/deploy/kubernetes/helm/che/templates/dashboard-traefik-gateway-configmap.yaml new file mode 100644 index 000000000000..e0578b35372f --- /dev/null +++ b/deploy/kubernetes/helm/che/templates/dashboard-traefik-gateway-configmap.yaml @@ -0,0 +1,34 @@ +# +# Copyright (c) 2012-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 +# + +# TODO it's not working yet + +{{- if and (eq .Values.global.serverStrategy "single-host") (eq .Values.global.singleHostExposure "gateway") }} + +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app: che + component: che-gateway-config + name: che-gateway-route-dashboard +data: + dashboard.yml: | + http: + routers: + che-dashboard: + rule: "PathPrefix(`/dashboard/`)" + service: che-dashboard + priority: 1 + services: + che-dashboard: + loadBalancer: + servers: + - url: 'http://che-dashboard:8080' +{{- end }} diff --git a/deploy/kubernetes/helm/che/templates/ingress-dashboard.yaml b/deploy/kubernetes/helm/che/templates/ingress-dashboard.yaml new file mode 100644 index 000000000000..30953bf96dda --- /dev/null +++ b/deploy/kubernetes/helm/che/templates/ingress-dashboard.yaml @@ -0,0 +1,48 @@ +# +# Copyright (c) 2012-2019 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 +# + +# If single-host powered by gateway is configured - the corresponding gateway configmap is expexted to be created +# but not this ingress +{{- if not (and (eq .Values.global.serverStrategy "single-host") (eq .Values.global.singleHostExposure "gateway")) }} + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: che-dashboard-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + {{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/proxy-read-timeout: "3600" + {{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/proxy-connect-timeout: "3600" +{{- if and .Values.global.tls .Values.global.tls.enabled }} + {{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/ssl-redirect: "true" +{{- else }} + {{ .Values.global.ingressAnnotationsPrefix }}ingress.kubernetes.io/ssl-redirect: "false" +{{- end }} +spec: +{{- if .Values.global.tls.enabled }} + tls: + - hosts: + - {{ template "cheHost" . }} + secretName: {{ .Values.global.tls.secretName }} +{{- end }} + rules: +{{- if ne .Values.global.serverStrategy "default-host" }} + - host: {{ template "cheHost" . }} + http: +{{- else }} + - http: +{{- end }} + paths: + # The path rule for Che Dashboard + - path: /dashboard + backend: + serviceName: che-dashboard + servicePort: 8080 + +{{- end }} diff --git a/deploy/kubernetes/helm/che/templates/ingress.yaml b/deploy/kubernetes/helm/che/templates/ingress.yaml index 5352a47b4476..082a0718c865 100644 --- a/deploy/kubernetes/helm/che/templates/ingress.yaml +++ b/deploy/kubernetes/helm/che/templates/ingress.yaml @@ -35,11 +35,20 @@ spec: - http: {{- end }} paths: - - path: / - backend: +# The path rule for Che Server {{- if and (eq .Values.global.serverStrategy "single-host") (eq .Values.global.singleHostExposure "gateway") }} - serviceName: che-gateway + - path: / + backend: + serviceName: che-gateway + servicePort: 8080 {{- else }} - serviceName: che-host + - path: / + backend: + serviceName: che-host + servicePort: 8080 + # The path rule for Che Dashboard next hosted by Che Server. It should be removed after https://github.com/eclipse/che/issues/17647 is fixed + - path: /dashboard/next + backend: + serviceName: che-host + servicePort: 8080 {{- end }} - servicePort: 8080 diff --git a/deploy/kubernetes/helm/che/templates/traefik-gateway-configmap.yaml b/deploy/kubernetes/helm/che/templates/traefik-gateway-configmap.yaml index 45611bce11bb..e488920f4c8b 100644 --- a/deploy/kubernetes/helm/che/templates/traefik-gateway-configmap.yaml +++ b/deploy/kubernetes/helm/che/templates/traefik-gateway-configmap.yaml @@ -24,6 +24,11 @@ data: rule: "PathPrefix(`/`)" service: che priority: 1 + # The path rule for Che Dashboard next hosted by Che Server. It should be removed after https://github.com/eclipse/che/issues/17647 is fixed + dashboard-next: + rule: "PathPrefix(`/dashboard/next`)" + service: che + priority: 1 services: che: loadBalancer: diff --git a/deploy/kubernetes/helm/che/values.yaml b/deploy/kubernetes/helm/che/values.yaml index 8ce9cf80248d..0a9d167d70fa 100644 --- a/deploy/kubernetes/helm/che/values.yaml +++ b/deploy/kubernetes/helm/che/values.yaml @@ -17,6 +17,7 @@ cheWorkspaceHttpProxy: "" cheWorkspaceHttpsProxy: "" cheWorkspaceNoProxy: "" cheImage: quay.io/eclipse/che-server:nightly +cheDashboardImage: quay.io/eclipse/che-dashboard:next cheImagePullPolicy: Always cheKeycloakRealm: "che" cheKeycloakClientId: "che-public" diff --git a/deploy/kubernetes/helm/che/values/multi-user.yaml b/deploy/kubernetes/helm/che/values/multi-user.yaml index 06d1c9646dbd..8439506f9382 100644 --- a/deploy/kubernetes/helm/che/values/multi-user.yaml +++ b/deploy/kubernetes/helm/che/values/multi-user.yaml @@ -9,4 +9,3 @@ global: multiuser: true - diff --git a/deploy/kubernetes/helm/dashboard-test.md b/deploy/kubernetes/helm/dashboard-test.md new file mode 100644 index 000000000000..f8333b6fe312 --- /dev/null +++ b/deploy/kubernetes/helm/dashboard-test.md @@ -0,0 +1,34 @@ +Multi-host Single User +```sh +export CHART_DIR=/home/sleshche/projects/che/deploy/kubernetes/helm/che +helm upgrade --install che \ + --force \ + --namespace che \ + --set global.cheDomain=192.168.99.100.nip.io \ + --set global.ingressDomain=192.168.99.100.nip.io \ + --set cheImage=sleshchenko/che-server:cut-dashboard \ + --set che.disableProbes=false \ + --set global.serverStrategy=single-host \ + --set global.tls.useSelfSignedCerts=true \ + -f ${CHART_DIR}/values/tls.yaml \ + -f ${CHART_DIR}/values/multi-user.yaml \ + ${CHART_DIR} +``` + +```sh +export CHART_DIR=/home/sleshche/projects/che/deploy/kubernetes/helm/che +helm upgrade --install che \ + --force \ + --namespace che \ + --set global.cheDomain=192.168.99.100.nip.io \ + --set global.ingressDomain=192.168.99.100.nip.io \ + --set cheImage=sleshchenko/che-server:cut-dashboard \ + --set che.disableProbes=false \ + --set global.tls.useSelfSignedCerts=true \ + --set global.serverStrategy=single-host \ + --set cheSinglehostGateway.deploy=true \ + --set global.singleHostExposure=gateway \ + --set global.multiuser=true \ + -f ${CHART_DIR}/values/tls.yaml \ + ${CHART_DIR} +``` \ No newline at end of file diff --git a/dockerfiles/che/Dockerfile b/dockerfiles/che/Dockerfile index d5c275f13b2c..8e475961becb 100644 --- a/dockerfiles/che/Dockerfile +++ b/dockerfiles/che/Dockerfile @@ -8,14 +8,16 @@ # Variables in `COPY --from=` is not supported see https://github.com/moby/moby/issues/34482 # this is workaround to handle that. -ARG CHE_DASHBOARD_ORGANIZATION=quay.io/eclipse +# TODO it's here just for testing. Uncomment before merging +#ARG CHE_DASHBOARD_ORGANIZATION=quay.io/eclipse ARG CHE_DASHBOARD_NEXT_ORGANIZATION=quay.io/che-incubator -ARG CHE_DASHBOARD_VERSION=next +# TODO it's here just for testing. Uncomment before merging +#ARG CHE_DASHBOARD_VERSION=next ARG CHE_DASHBOARD_NEXT_VERSION=next ARG CHE_WORKSPACE_LOADER_ORGANIZATION=quay.io/eclipse ARG CHE_WORKSPACE_LOADER_VERSION=next -FROM ${CHE_DASHBOARD_ORGANIZATION}/che-dashboard:${CHE_DASHBOARD_VERSION} as che_dashboard_base +# FROM ${CHE_DASHBOARD_ORGANIZATION}/che-dashboard:${CHE_DASHBOARD_VERSION} as che_dashboard_base FROM ${CHE_DASHBOARD_NEXT_ORGANIZATION}/che-dashboard-next:${CHE_DASHBOARD_NEXT_VERSION} as che_dashboard_next FROM ${CHE_WORKSPACE_LOADER_ORGANIZATION}/che-workspace-loader:${CHE_WORKSPACE_LOADER_VERSION} as che_workspace_loader_base @@ -27,7 +29,8 @@ COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] RUN mkdir /logs /data && \ chmod 0777 /logs /data -COPY --from=che_dashboard_base /usr/local/apache2/htdocs/dashboard /home/user/eclipse-che/tomcat/webapps/dashboard +# TODO it's here just for testing. Uncomment before merging +#COPY --from=che_dashboard_base /usr/local/apache2/htdocs/dashboard /home/user/eclipse-che/tomcat/webapps/dashboard COPY --from=che_dashboard_next /usr/local/apache2/htdocs/dashboard /home/user/eclipse-che/tomcat/webapps/dashboard/next COPY --from=che_workspace_loader_base /usr/local/apache2/htdocs/workspace-loader/ /home/user/eclipse-che/tomcat/webapps/workspace-loader ADD eclipse-che /home/user/eclipse-che