Skip to content
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

feat: Deploy Eclipse Che on a virtual Kubernetes cluster #2701

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
648435e
Che In Unsupported Kubernetes
Mar 6, 2024
d5b1dd6
Changes
Mar 7, 2024
be0cbda
Typo Changes
Mar 7, 2024
2601e92
Typo Change
Mar 7, 2024
8a8223d
OIDC Typo Changes
Mar 7, 2024
7e61b65
Nav and other typo fixes
Mar 7, 2024
1326918
Typo Changes
Mar 7, 2024
0d1969c
QuoteFix
Mar 7, 2024
215845a
remove settings.json
Mar 8, 2024
84d294c
Keycloak Support
Mar 26, 2024
d243ee3
Keycloak Support in Kubectl
Mar 26, 2024
7bb5eef
Che with keycloak
Mar 26, 2024
467fe01
Changes
Mar 26, 2024
d8ff950
Installing Che
Mar 26, 2024
697446a
Image and Grammar Changes
Mar 26, 2024
71b2d78
Changes
Mar 27, 2024
c6993a9
Changes
Mar 27, 2024
ea9b503
Changes
Mar 27, 2024
a97e3e0
Che In Unsupported Kubernetes
Mar 6, 2024
9972fae
Changes
Mar 7, 2024
cffffc0
Typo Changes
Mar 7, 2024
64dae1f
Typo Change
Mar 7, 2024
55c7ee7
OIDC Typo Changes
Mar 7, 2024
0adc48e
Nav and other typo fixes
Mar 7, 2024
b1eec45
Typo Changes
Mar 7, 2024
6b117b4
QuoteFix
Mar 7, 2024
437cc96
remove settings.json
Mar 8, 2024
cd0e038
Keycloak Support
Mar 26, 2024
7e58f80
Keycloak Support in Kubectl
Mar 26, 2024
7d423da
Che with keycloak
Mar 26, 2024
43ba43f
Changes
Mar 26, 2024
852c80b
Installing Che
Mar 26, 2024
d89ccb4
Image and Grammar Changes
Mar 26, 2024
e9f63d9
Changes
Mar 27, 2024
6f2ac0c
Changes
Mar 27, 2024
4931927
Changes
Mar 27, 2024
d20f47f
Merge branch 'che-in-unsupported-oidc-kubernetes' of https://github.c…
Mar 27, 2024
4aca9da
chore: Verify the doc about installing che on virtual kubernetes cluster
tolusha Apr 9, 2024
40c73b2
Add missing files
tolusha Apr 9, 2024
b4e14c3
Merge pull request #2 from tolusha/che-in-unsupported-oidc-kubernetes
maheshrajrp Apr 10, 2024
258bd97
Tip
Apr 10, 2024
78341bc
Update installing-che-on-the-virtual-kubernetes-cluster.adoc
maheshrajrp Apr 11, 2024
76c3a76
Update installing-che-on-the-virtual-kubernetes-cluster.adoc
maheshrajrp Apr 11, 2024
aba1431
Changes
Apr 11, 2024
6d86972
Changes
Apr 11, 2024
598ced1
Remove redundant lines
Apr 11, 2024
31c5a1d
Grammar Changes
Apr 11, 2024
f30268f
Merge pull request #3 from maheshrajrp/tip-
maheshrajrp Apr 11, 2024
4e4da57
Linter Issue Fixes
Apr 11, 2024
9ceea08
Merge pull request #4 from maheshrajrp/tip-
maheshrajrp Apr 11, 2024
0438bf1
Update modules/administration-guide/pages/installing-che-on-the-virtu…
maheshrajrp Apr 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*** xref:user-workspaces.adoc[]
** xref:calculating-che-resource-requirements.adoc[]
* xref:installing-che.adoc[]
* xref:installing-che-on-the-virtual-kubernetes-cluster.adoc[]
** xref:installing-che-in-the-cloud.adoc[]
*** xref:installing-che-on-openshift-using-cli.adoc[]
*** xref:installing-che-on-openshift-using-the-web-console.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ WARNING: Single-node {kubernetes} clusters are suited only for testing or develo

* Minikube stable release. See link:https://kubernetes.io/docs/tasks/tools/install-minikube/[Installing Minikube].

* `helm`: The package manager for {kubernetes}. See: link:https://helm.sh/docs/intro/install/[Installing Helm].

* `{orch-cli}` stable release. See link:https://kubernetes.io/docs/tasks/tools/#kubectl[Installing `{orch-cli}`].

* `{prod-cli}`. See xref:installing-the-chectl-management-tool.adoc[].
Expand All @@ -23,26 +25,30 @@ WARNING: Single-node {kubernetes} clusters are suited only for testing or develo

. Start Minikube. Allocate at least 8GB of RAM and 4 CPU cores:
+
[source,shell,subs="+attributes"]
----
$ minikube start --addons=ingress --vm=true --memory=8192 --cpus=4
minikube start --addons=ingress --vm=true --memory=8192 --cpus=4
----

. Deploy `cert-manager`. See link:https://cert-manager.io/docs/installation[Installing cert-manager].

. Wait until all `cert-manager` pods are ready:
. Install link:https://cert-manager.io[cert-manager]
+
[subs="+attributes"]
[source,shell,subs="attributes+"]
----
$ {orch-cli} wait --for=condition=ready pod -l app.kubernetes.io/component=controller -n cert-manager --timeout=60s && \
{orch-cli} wait --for=condition=ready pod -l app.kubernetes.io/component=cainjector -n cert-manager --timeout=60s && \
{orch-cli} wait --for=condition=ready pod -l app.kubernetes.io/component=webhook -n cert-manager --timeout=60s
helm repo add jetstack https://charts.jetstack.io
helm repo update

helm install cert-manager jetstack/cert-manager \
--wait \
--create-namespace \
--namespace cert-manager \
--set installCRDs=true
----

. Deploy https://www.keycloak.org/[Keycloak]:
. Install https://www.keycloak.org/[Keycloak]:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ {orch-cli} apply -f - <<EOF
{orch-cli} apply -f - <<EOF
---
apiVersion: v1
kind: Namespace
Expand Down Expand Up @@ -178,11 +184,11 @@ metadata:
name: keycloak
namespace: keycloak
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-connect-timeout: '3600'
nginx.ingress.kubernetes.io/proxy-read-timeout: '3600'
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
spec:
ingressClassName: nginx
tls:
- hosts:
- keycloak.$(minikube ip).nip.io
Expand All @@ -203,22 +209,24 @@ EOF

. Save Keycloak CA certificate:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ {orch-cli} get secret ca.crt -o "jsonpath={.data['ca\.crt']}" -n keycloak | base64 -d > keycloak-ca.crt
{orch-cli} get secret ca.crt -o "jsonpath={.data['ca\.crt']}" -n keycloak | base64 -d > keycloak-ca.crt
----

. Copy Keycloak CA certificate into Minikube:
+
[source,shell,subs="+attributes"]
----
$ minikube ssh sudo "mkdir -p /etc/ca-certificates" && \
minikube cp keycloak-ca.crt /etc/ca-certificates/keycloak-ca.crt
minikube ssh sudo "mkdir -p /etc/ca-certificates" && \
minikube cp keycloak-ca.crt /etc/ca-certificates/keycloak-ca.crt
----

. Configure Minikube to use Keycloak as the OIDC provider:
+
[source,shell,subs="+attributes"]
----
$ minikube start \
minikube start \
--extra-config=apiserver.oidc-issuer-url=https://keycloak.$(minikube ip).nip.io/realms/che \
--extra-config=apiserver.oidc-username-claim=email \
--extra-config=apiserver.oidc-client-id=k8s-client \
Expand All @@ -227,18 +235,18 @@ $ minikube start \

. Wait until the Keycloak pod is ready:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ {orch-cli} wait --for=condition=ready pod -l app=keycloak -n keycloak --timeout=120s
{orch-cli} wait --for=condition=ready pod -l app=keycloak -n keycloak --timeout=120s
----

. Configure Keycloak to create the realm, client, and user:
+
IMPORTANT: You must do this each time you start the Minikube cluster.
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ {orch-cli} exec deploy/keycloak -n keycloak -- bash -c \
{orch-cli} exec deploy/keycloak -n keycloak -- bash -c \
"/opt/keycloak/bin/kcadm.sh config credentials \
--server http://localhost:8080 \
--realm master \
Expand Down Expand Up @@ -271,9 +279,9 @@ $ {orch-cli} exec deploy/keycloak -n keycloak -- bash -c \

. Copy Keycloak CA certificate into the `{prod-namespace}` namespace:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ {orch-cli} create namespace {prod-namespace} && \
{orch-cli} create namespace {prod-namespace} && \
{orch-cli} create configmap keycloak-certs \
--from-file=keycloak-ca.crt=keycloak-ca.crt \
-n {prod-namespace} && \
Expand All @@ -285,9 +293,9 @@ $ {orch-cli} create namespace {prod-namespace} && \

. Prepare the `CheCluster` patch:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ cat > che-patch.yaml << EOF
cat > che-patch.yaml << EOF
kind: CheCluster
apiVersion: org.eclipse.che/v2
spec:
Expand All @@ -296,6 +304,9 @@ spec:
oAuthClientName: k8s-client
oAuthSecret: eclipse-che
identityProviderURL: "https://keycloak.$(minikube ip).nip.io/realms/che"
gateway:
oAuthProxy:
cookieExpireSeconds: 300
components:
cheServer:
extraProperties:
Expand All @@ -305,39 +316,39 @@ EOF

. Create the {prod-short} instance with `{prod-cli}`:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ {prod-cli} server:deploy --platform k8s --domain $(minikube ip).nip.io --che-operator-cr-patch-yaml che-patch.yaml --skip-cert-manager
{prod-cli} server:deploy --platform k8s --domain $(minikube ip).nip.io --che-operator-cr-patch-yaml che-patch.yaml --skip-cert-manager
----
+
Alternatively, use the link:https://artifacthub.io/packages/helm/eclipse-che/eclipse-che[{prod}] Helm Charts:
+
[subs="+attributes"]
[source,shell,subs="+attributes"]
----
$ helm install che \
helm install che \
--namespace eclipse-che \
--set networking.domain=$(minikube ip).nip.io \
--set networking.auth.oAuthSecret=eclipse-che \
--set networking.auth.oAuthClientName=k8s-client \
--set networking.auth.identityProviderURL=https://keycloak.$(minikube ip).nip.io/realms/che . && \
sleep 5s && \
{orch-cli} patch checluster/eclipse-che --patch '{"spec": {"components": {"cheServer": {"extraProperties": {"CHE_OIDC_USERNAME__CLAIM": "email"}}}}}' --type=merge -n eclipse-che
sleep 5s && \
{orch-cli} patch checluster/eclipse-che --patch '{"spec": {"components": {"cheServer": {"extraProperties": {"CHE_OIDC_USERNAME__CLAIM": "email"}}}}}' --type=merge -n eclipse-che
----

.Verification steps

. Verify the {prod-short} instance status:
+
[subs="+attributes,+quotes"]
[source,shell,subs="+attributes"]
----
$ {prod-cli} server:status
{prod-cli} server:status
----

. Navigate to the {prod-short} cluster instance:
+
[subs="+attributes,+quotes"]
[source,shell,subs="+attributes"]
----
$ {prod-cli} dashboard:open
{prod-cli} dashboard:open
----

. Log in to the {prod-short} instance with *Username:* `test` and *Password:* `test`.
Expand Down
Loading
Loading