-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
k8s-infra: routing, TLS (rebased) (#9329)
Introduce an External Server Exposer Strategy, responsible for exposing service ports associated with external servers, making them accessible from outside the cluster. Move server exposure to shared k8s infra level: - multi-host: unique hostname for each component, like Che Openshift infrastructure. - single-host: single hostname for all components. Can be used in conjunction with TLS. - default-host: default ingress hostname. Can be used for local development without dynamic DNS (based on ingress IP). Add basic TLS support. Signed-off-by: Guy Daich <[email protected]>
- Loading branch information
Showing
52 changed files
with
1,740 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
deploy/kubernetes/helm/che/charts/che-keycloak/templates/endpoints-monitor-role.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2012-2017 Red Hat, Inc | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License v1.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
|
||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: che-endpoints-monitor | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["services", "endpoints", "pods"] | ||
verbs: ["get", "list"] |
19 changes: 19 additions & 0 deletions
19
deploy/kubernetes/helm/che/charts/che-keycloak/templates/endpoints-monitor-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (c) 2012-2017 Red Hat, Inc | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License v1.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
|
||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
metadata: | ||
name: {{ .Release.Namespace -}} -keycloak-role-binding | ||
roleRef: | ||
kind: Role | ||
name: che-endpoints-monitor | ||
apiGroup: rbac.authorization.k8s.io | ||
subjects: | ||
- kind: ServiceAccount | ||
name: che-keycloak | ||
namespace: {{ .Release.Namespace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
deploy/kubernetes/helm/che/charts/che-keycloak/templates/keycloak-serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) 2012-2017 Red Hat, Inc | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License v1.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: che-keycloak | ||
name: che-keycloak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{{- define "cheHost" }} | ||
{{- if .Values.global.isHostBased }} | ||
{{- printf "master.%s" .Values.global.cheDomain }} | ||
{{- if eq .Values.global.serverStrategy "default-host" }} | ||
{{- printf "%s" .Values.global.ingressDomain }} | ||
{{- else if eq .Values.global.serverStrategy "single-host" }} | ||
{{- printf "che-%s.%s" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- else }} | ||
{{- printf "%s" .Values.global.cheDomain }} | ||
{{- printf "che-%s.%s" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- end }} | ||
{{- end }} |
32 changes: 19 additions & 13 deletions
32
deploy/kubernetes/helm/che/templates/_keycloakAuthUrlHelper.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
{{- define "keycloakAuthUrl" }} | ||
{{- if .Values.global.isHostBased }} | ||
{{- if .Values.global.tlsEnabled }} | ||
{{- printf "https://keycloak.%s/auth" .Values.global.cheDomain }} | ||
{{- else }} | ||
{{- printf "http://keycloak.%s/auth" .Values.global.cheDomain }} | ||
{{- end }} | ||
{{- else }} | ||
{{- if .Values.global.tlsEnabled }} | ||
{{- printf "https://%s/auth" .Values.global.cheDomain }} | ||
{{- else }} | ||
{{- printf "http://%s/auth" .Values.global.cheDomain }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if eq .Values.global.serverStrategy "default-host" }} | ||
{{- if .Values.global.tls.enabled }} | ||
{{- printf "https://%s/auth" .Values.global.ingressDomain }} | ||
{{- else }} | ||
{{- printf "http://%s/auth" .Values.global.ingressDomain }} | ||
{{- end }} | ||
{{- else if eq .Values.global.serverStrategy "single-host" }} | ||
{{- if .Values.global.tls.enabled }} | ||
{{- printf "https://che-%s.%s/auth" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- else }} | ||
{{- printf "http://che-%s.%s/auth" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- end }} | ||
{{- else }} | ||
{{- if .Values.global.tls.enabled }} | ||
{{- printf "https://keycloak-%s.%s/auth" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- else }} | ||
{{- printf "http://keycloak-%s.%s/auth" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
10 changes: 6 additions & 4 deletions
10
deploy/kubernetes/helm/che/templates/_keycloakHostHelper.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{{- define "keycloakHost" }} | ||
{{- if .Values.global.isHostBased }} | ||
{{- printf "keycloak.%s" .Values.global.cheDomain }} | ||
{{- if eq .Values.global.serverStrategy "default-host" }} | ||
{{- printf "%s" .Values.global.ingressDomain }} | ||
{{- else if eq .Values.global.serverStrategy "single-host" }} | ||
{{- printf "che-%s.%s" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- else }} | ||
{{- printf "%s" .Values.global.cheDomain }} | ||
{{- end }} | ||
{{- printf "keycloak-%s.%s" .Release.Namespace .Values.global.ingressDomain }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,20 @@ | |
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
|
||
{{- if .Values.global.tlsEnabled }} | ||
{{- if and .Values.global.tls }} | ||
{{- if and .Values.global.tls.enabled .Values.global.tls.useCertManager }} | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Issuer | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt | ||
spec: | ||
acme: | ||
# The ACME server URL | ||
{{- if .Values.global.tls.useStaging }} | ||
server: https://acme-staging.api.letsencrypt.org/directory | ||
{{- else }} | ||
server: https://acme-v01.api.letsencrypt.org/directory | ||
{{- end }} | ||
# Email address used for ACME registration | ||
email: [email protected] | ||
# Name of a secret used to store the ACME account private key | ||
|
@@ -22,3 +27,4 @@ spec: | |
# Enable the HTTP-01 challenge provider | ||
http01: {} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.