Prerequisites
-
A Kubernetes cluster with at least 4GB RAM and RBAC:
-
for MiniKube 0.26.0 and above
minikube start --cpus 2 --memory 4096 --extra-config=apiserver.authorization-mode=RBAC -
for MiniKube 0.25.2 and lower
minikube start --cpus 2 --memory 4096 --extra-config=apiserver.Authorization.Mode=RBAC -
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default -
Install the Helm CLI
-
Set your default Kubernetes context (this is required to use helm):
-
In MiniKube this is set for you automatically
-
Otherwise, you may have to modify the KUBECONFIG environment variable and then type
kubectl config use-context <my-context>
-
-
Install tiller on your cluster:
-
Create a tiller serviceAccount:
kubectl create serviceaccount tiller --namespace kube-system -
Bind it to the almighty cluster-admin role:
kubectl apply -f ./tiller-rbac.yaml -
Install tiller itself:
helm init --service-account tiller
-
-
Ensure that you have an NGINX-based ingress controller. Note: This is the default ingress controller on MiniKube. You can start it with
minikube addons enable ingress -
DNS discovery should be enabled. Note: It is enabled by default in minikube.
Cluster IP
-
If your cluster is running on MiniKube, simply type
minikube ipat your terminal -
If your cluster is in the cloud, obtain the hostname or ip address from your cloud provider
In production, you should specify a hostname (see here 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 ingressDomain parameter below.
If you must use IP address (e.g. your corporate policy prevents you from using nip.io), you would also have to set isHostBased to false.
Deploy Syntax
The context of the commands below is che/deploy/kubernetes/helm/che
To deploy with dedicated keycloak as authentication server:
-
Override default values by changing the values.yaml file and then typing:
helm upgrade --install <my-che-installation> --namespace <my-che-namespace> -f ./values/multi-user.yaml ./
-
Or, you can override default values during installation, using the
--setflag:helm upgrade --install <my-che-installation> --namespace <my-che-namespace> -f ./values/multi-user.yaml --set global.ingressDomain=<my-hostname> --set cheImage=<my-image> ./
-
Keycloak:
https://keycloak-<che-namespace>.domain -
Workspaces servers:
https://server-host.domain
To deploy without keycloak in multi-user mode
In this case you have to supply custom OpenIdConnect provider (see here for more details), using the following flags:
helm upgrade --install <my-che-installation> --namespace <my-che-namespace> -f ./values/multi-user.yaml --set global.ingressDomain=<my-hostname>,cheImage=<my-image>,global.cheDedicatedKeycloak=false,customOidcProvider=<oidc-url>,cheKeycloakClientId=<oidc_clientId>,customOidcUsernameClaim=<user_name_claim> ./
-
cheKeycloakClientId - is your authentication server client ID
-
customOidcUsernameClaim - is optional, and should be used if your authentication server does not support 'preferred_username' claim in the JWT token (This can be checked by accessing oidc-url/.well-known/openid-configuration response). This parameter defines, which claim should be used to determine user name instead.
Default Host
All Ingress specs are created without a host attribute (defaults to *). Path based routing to all components. Multi User configuration is enabled.
helm upgrade --install <che-release-name> --namespace <che-namespace> -f ./values/default-host.yaml --set global.ingressDomain=<domain> ./
-
Master:
http://<domain>/ -
Keycloak:
http://<domain>/auth/ -
Workspaces servers:
http://<domain>/<path-to-server>
TLS
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.
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=<domain> ./
-
Master:
https://<domain>/ -
Keycloak:
https://<domain>/auth/ -
Workspaces servers:
https://<domain>/<path-to-server>
Delete Che Deployment
You can delete a deployment using the following command:
helm delete <che-release-name>