-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
k8s-infra: server routing strategies & basic TLS #8822
Changes from all commits
3c2bbe5
cf4faba
3ceebee
33cd04f
dcc1a0b
49459f5
d451c14
d28892f
c7d4f24
7951103
c2db0f5
cfeb1e6
7d6eb96
b0d0481
e25ddf1
c026d21
b5fe1ed
b5b2832
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,6 +433,10 @@ CHE_SINGLE_PORT=false | |
##### Kubernetes Infrastructure ##### | ||
##### ##### | ||
# | ||
|
||
# Create routes with Transport Layer Security (TLS) enabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to fix the comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
CHE_INFRA_KUBERNETES_TLS_ENABLED=false | ||
|
||
#Configuration of Kubernetes client that Infra will use | ||
#CHE_INFRA_KUBERNETES_MASTER__URL= | ||
#CHE_INFRA_KUBERNETES_USERNAME= | ||
|
@@ -511,9 +515,6 @@ CHE_SINGLE_PORT=false | |
# If not set, every workspace will be created in a new project, where project name = workspace id | ||
#CHE_INFRA_OPENSHIFT_PROJECT= | ||
|
||
# Create routes with Transport Layer Security (TLS) enabled | ||
CHE_INFRA_OPENSHIFT_TLS_ENABLED=false | ||
|
||
|
||
######################################################################################## | ||
##### ##### | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
In production, you should specify a hostname (see [here](https://github.com/eclipse/che/issues/8694) why). In case you don't have a hostname (e.g. during development), and would still want to use a host-based configuration, you can use services such as nip.io or xip.io. | ||
|
||
In case you're specifying a hostname, simply pass it as the value of the `cheDomain` parameter below. | ||
In case you're specifying a hostname, simply pass it as the value of the `ingressDomain` parameter below. | ||
|
||
If you must use an ip address (e.g. your corporate policy prevents you from using nip.io), you would also have to set `isHostBased` to `false`. | ||
|
||
|
@@ -32,55 +32,53 @@ The context of the commands below is the directory in which this readme file res | |
- Or, you can override default values during installation, using the `--set` flag: | ||
|
||
```bash | ||
helm upgrade --install <my-che-installation> --namespace <my-che-namespace> --set global.cheDomain=<my-hostname> --set cheImage=<my-image> ./ | ||
helm upgrade --install <my-che-installation> --namespace <my-che-namespace> --set global.ingressDomain=<my-hostname> --set cheImage=<my-image> ./ | ||
``` | ||
|
||
#### Deployment types | ||
Currenty, only minikube deployment is supported. | ||
#### Deployment Options | ||
|
||
##### Single User | ||
Only Che will be deployed. | ||
|
||
```bash | ||
helm upgrade --install <che-release> --namespace <che-namespace> --set global.cheDomain=<domain> ./ | ||
helm upgrade --install <che-release-name> --namespace <che-namespace> --set global.ingressDomain=<domain> ./ | ||
``` | ||
|
||
##### Multi User | ||
Che, KeyCloak and Postgres will be deployed. | ||
|
||
```bash | ||
helm upgrade --install <che-release> --namespace <che-namespace> --set global.multiuser=true --set global.cheDomain=<domain> ./ | ||
helm upgrade --install <che-release-name> --namespace <che-namespace> -f ./values/multi-user.yaml --set global.ingressDomain=<domain> ./ | ||
``` | ||
|
||
##### No Host: | ||
Ingress will serve requests on minikube-ip. | ||
Path based routing to Che, Secondary servers (KeyCloak) and Workspace servers. | ||
|
||
#### Default Host | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
All Ingress specs are created without a host attribute (defaults to *). | ||
Path based routing to all components. | ||
Multi User configuration is enabled. | ||
|
||
```bash | ||
helm upgrade --install <che-release> --namespace <che-namespace> --set global.isHostbased=false --set global.cheDomain=<minikube-ip> ./ | ||
Master: http://<minikube-ip>/ | ||
Workspaces: http://<minikube-ip>/<path-to-server> | ||
Keycloak (if multiuser) : http://<minikube-ip>/auth/ | ||
helm upgrade --install <che-release-name> --namespace <che-namespace> -f ./values/default-host.yaml --set global.ingressDomain=<domain> ./ | ||
``` | ||
|
||
##### Host (partial): | ||
WS Master Ingress will serve requests on provided domain | ||
Workspaces: Ingress will serve requests on minikube-ip, Path Based routing to workspaces. | ||
KeyCloak : dedicated hostname | ||
|
||
```bash | ||
helm upgrade --install <che-release> --namespace <che-namespace> --set global.cheDomain=<minikube-ip>.xip.io ./ | ||
Master: http://master.<minikube-ip>.xip.io | ||
Workspaces: http://<minikube-ip>/<path-to-server> | ||
Keycloak (if multiuser): http://keycloak.<minikube-ip>.xip.io/ | ||
``` | ||
|
||
* Master: `http://<minikube-ip>/` | ||
* Keycloak: `http://<minikube-ip>/auth/` | ||
* Workspaces servers: `http://<minikube-ip>/<path-to-server>` | ||
|
||
#### TLS-enabled | ||
Cert-Manager is used to issue LetsEncrypt certificates. | ||
To avoid rate-limit issues, we use a single hostname for all ingresses. | ||
Path based routing to all components. | ||
Multi User configuration is enabled. | ||
|
||
```bash | ||
helm install --name <cert-manager-release-name> stable/cert-manager | ||
helm upgrade --install <che-release-name> --namespace <che-namespace> -f ./values/tls.yaml --set global.ingressDomain=<your-domain> ./ | ||
``` | ||
|
||
* Master: `https://che-<che-namespace>.your-domain/` | ||
* Keycloak: `https://che-<che-namespace>.your-domain/auth/` | ||
* Workspaces servers: `https://<che-namespace>.your-domain/<path-to-server>` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workspaces servers should be in the format https://che- too (with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
##### Future options: | ||
- Path Based: single hostname for all components (che, keycloak, WS servers) | ||
- Host Based: unique host for each component | ||
- TLS | ||
|
||
## Deleting a Deployment | ||
You can delete a deployment using the following command: | ||
``` bash | ||
|
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 }} |
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 }} |
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 }} |
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 .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 }} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider adding the corresponding alias in https://github.com/eclipse/che/blob/master/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che_aliases.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done