Skip to content

Commit

Permalink
CHE-5908 Update ingress annotations for Nginx 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sleshchenko committed Feb 7, 2018
1 parent 0f764c5 commit 20c8808
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
32 changes: 14 additions & 18 deletions dockerfiles/init/modules/kubernetes/Deploy Che.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
# Deploy single user Che to k8s
Tested on minikube with vm provider Virtualbox. Note that Che with workspaces requires quite a lot
Tested on minikube with vm providers Virtualbox and kvm2. Note that Che with workspaces requires quite a lot
of RAM. Initial tests were done with 10GB, but it is definitely more than it is needed to start Che
and couple of workspaces.

IP of VM is supposed to be `192.168.99.100`. `nip.io` is also used for handling hosts resolution.
If you have another IP or DNS replace these values in k8s.yml file.

Services are exposed using ingress controller approach.
We added ingress annotations to customize ingress controller behavior -
Services are exposed using ingress controller approach.
We added ingress annotations to customize ingress controller behavior -
not to break websocket connections.
In particular testing environment was setup with NginX ingress controller 0.9.0-beta.17.
In particular testing environment was setup with NginX ingress controller 0.9.0.
So we added annotations specific to this implementation and version:
- ingress.kubernetes.io/rewrite-target: /
- ingress.kubernetes.io/ssl-redirect": "false"
- ingress.kubernetes.io/proxy-read-timeout: "3600"
- ingress.kubernetes.io/proxy-connect-timeout: "3600"
- nginx.ingress.kubernetes.io/rewrite-target: /
- nginx.ingress.kubernetes.io/ssl-redirect": "false"
- nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
- nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600"

If you use another ingress controller implementation or version you need to customize
Che master ingress and value of environment variable `CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON` stored in ConfigMap.
Value of the map should be expressed as a stringified JSON. For example most recent NginX controller uses other annotations:
- nginx.ingress.kubernetes.io/rewrite-target
- nginx.ingress.kubernetes.io/proxy-read-timeout
- nginx.ingress.kubernetes.io/proxy-connect-timeout
- nginx.ingress.kubernetes.io/ssl-redirect
If you use another ingress controller implementation or version you need to customize
Che master ingress and value of environment variable `CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON` stored in ConfigMap.
Value of the map should be expressed as a stringified JSON.

And environment variable would be: `'{"ingress.kubernetes.io/rewrite-target": "/","ingress.kubernetes.io/ssl-redirect": "false","ingress.kubernetes.io/proxy-connect-timeout": "3600","ingress.kubernetes.io/proxy-read-timeout": "3600"}'`
And environment variable would be: `'{"nginx.ingress.kubernetes.io/rewrite-target": "/","nginx.ingress.kubernetes.io/ssl-redirect": "false","nginx.ingress.kubernetes.io/proxy-connect-timeout": "3600","nginx.ingress.kubernetes.io/proxy-read-timeout": "3600"}'`

###Prerequisites:
- Ingress controller is running. Note: you can start it on minikube with `minikube addons enable ingress`.
- Currently Che workspaces work with NginX ingress controller only. Note: it is default ingress controller on minikube.
- DNS discovery should be enabled. Note: enabled by default in minikube.
### Deployment process:
Note: despite the fact that it is not necessary to use a separate namespace for Che
we use it to simplify development operations such as cleaning of spoiled environment
Note: despite the fact that it is not necessary to use a separate namespace for Che
we use it to simplify development operations such as cleaning of spoiled environment
and clean redeploy of Che.
- Create namespace `che`: `kubectl create namespace che`
- Deploy Che: `kubectl --namespace=che apply -f che-kubernetes.yaml`
Expand Down
8 changes: 4 additions & 4 deletions dockerfiles/init/modules/kubernetes/files/che-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ items:
CHE_PREDEFINED_STACKS_RELOAD__ON__START: "false"
JAVA_OPTS: "-XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true -Xms20m "
CHE_WORKSPACE_AUTO_START: "false"
CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON: '{"ingress.kubernetes.io/rewrite-target": "/","ingress.kubernetes.io/ssl-redirect": "false","ingress.kubernetes.io/proxy-connect-timeout": "3600","ingress.kubernetes.io/proxy-read-timeout": "3600"}'
CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON: '{"nginx.ingress.kubernetes.io/rewrite-target": "/","nginx.ingress.kubernetes.io/ssl-redirect": "false","nginx.ingress.kubernetes.io/proxy-connect-timeout": "3600","nginx.ingress.kubernetes.io/proxy-read-timeout": "3600"}'
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: che-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/proxy-read-timeout: "3600"
ingress.kubernetes.io/proxy-connect-timeout: "3600"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600"
spec:
rules:
- host: 192.168.99.100.nip.io
Expand Down

0 comments on commit 20c8808

Please sign in to comment.