Skip to content

Commit 9bc90d9

Browse files
feat: Installing che on EKS (#2828)
* feat: Installing che on EKS Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> * Update modules/administration-guide/partials/configuring-environment-variables-for-amazon-elastic-kubernetes-service.adoc Co-authored-by: Jana Vrbkova <[email protected]> * Update modules/administration-guide/partials/proc_installing-keycloak-on-amazon-elastic-kubernetes-service.adoc Co-authored-by: Jana Vrbkova <[email protected]> * Fixup Signed-off-by: Anatolii Bazko <[email protected]> --------- Signed-off-by: Anatolii Bazko <[email protected]> Co-authored-by: Jana Vrbkova <[email protected]>
1 parent 4fe3754 commit 9bc90d9

14 files changed

+736
-1
lines changed

Diff for: antora.yml

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ asciidoc:
110110
theia-endpoint-image: eclipse/che-theia-endpoint-runtime:next
111111
editor-definition-samples-link: link:https://github.com/eclipse-che/che-operator/tree/main/editors-definitions[Editors definitions samples]
112112
devfile-api-version: 2.3.0
113+
eks: Amazon Elastic Kubernetes Service
114+
eks-short: Amazon EKS
113115
ext:
114116
collector:
115117
- run:

Diff for: modules/administration-guide/examples/snip_che-installing-che.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ You can deploy only one instance of {prod-short} per cluster.
1414
* xref:installing-che-on-openshift-using-the-web-console.adoc[]
1515
* xref:installing-che-in-a-restricted-environment.adoc[]
1616
* xref:installing-che-on-microsoft-azure.adoc[]
17+
* xref:installing-che-on-amazon-elastic-kubernetes-service.adoc[]
1718
1819
.Installing {prod-short} on a local single-node cluster
1920

Diff for: modules/administration-guide/nav.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*** xref:installing-che-on-openshift-using-the-web-console.adoc[]
2222
*** xref:installing-che-in-a-restricted-environment.adoc[]
2323
*** xref:installing-che-on-microsoft-azure.adoc[]
24+
*** xref:installing-che-on-amazon-elastic-kubernetes-service.adoc[]
2425
** xref:installing-che-locally.adoc[]
2526
*** xref:installing-che-on-red-hat-openshift-local.adoc[]
2627
*** xref:installing-che-on-minikube.adoc[]

Diff for: modules/administration-guide/pages/installing-che-in-the-cloud.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ Follow the instructions below to start the {prod-short} Server in the cloud by u
2222
* xref:installing-che-on-openshift-using-the-web-console.adoc[]
2323
* xref:installing-che-in-a-restricted-environment.adoc[]
2424
* xref:installing-che-on-microsoft-azure.adoc[]
25+
* xref:installing-che-on-amazon-elastic-kubernetes-service.adoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
:_content-type: ASSEMBLY
2+
:description: Installing {prod-short} on {eks}
3+
:keywords: overview, installing-{prod-id-short}-on-amazon-elastic-kubernetes-service.adoc
4+
:navtitle: Installing {prod-short} on {eks}
5+
6+
[id="installing-{prod-id-short}-on-amazon-elastic-kubernetes-service.adoc"]
7+
= Installing {prod-short} on {eks}
8+
9+
{eks} (Amazon EKS) is a managed {kubernetes} service to run {kubernetes} in the AWS cloud and on-premises data centers.
10+
11+
Follow the instructions below to install and enable {prod-short} on {eks-short}.
12+
13+
.Prerequisites
14+
15+
* `helm`: The package manager for {kubernetes}. See: link:https://helm.sh/docs/intro/install/[Installing Helm].
16+
17+
* `{prod-cli}`. See: xref:installing-the-chectl-management-tool.adoc[].
18+
19+
* `aws`: The AWS Command Line Interface. See: link:https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html[AWS CLI install and update instructions]
20+
21+
* `eksctl`: The Command Line Interface for creating and managing {kubernetes} clusters on {eks-short}. See: link:https://eksctl.io/installation/[Installing eksctl]
22+
23+
include::partial$configuring-environment-variables-for-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
24+
25+
include::partial$proc_installing-ingress-nginx-controller-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
26+
27+
include::partial$proc_configuring-dns-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
28+
29+
include::partial$proc_installing-cert-manager-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
30+
31+
include::partial$proc_creating-lets-encrypt-certificate-for-che-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
32+
33+
include::partial$proc_installing-keycloak-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
34+
35+
include::partial$proc_associate-keycloak-as-oidc-identity-provider-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
36+
37+
include::partial$proc_installing-che-on-amazon-elastic-kubernetes-service.adoc[leveloffset=+1]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Module included in the following assemblies:
2+
//
3+
// installing-{prod-id-short}-on-amazon-elastic-kubernetes-service
4+
5+
[id="configuring-environment-variables-for-amazon-elastic-kubernetes-service"]
6+
= Configuring environment variables for {eks-short}
7+
8+
Follow these instructions to define environment variables and update your `kubeconfig` to connect to {eks-short}.
9+
10+
.Prerequisites
11+
12+
* Amazon EKS cluster with storage addon. See: link:https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html[Create an Amazon EKS cluster]
13+
14+
.Procedure
15+
16+
. Find the AWS account ID:
17+
+
18+
[source,subs="attributes+"]
19+
----
20+
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
21+
----
22+
23+
. Define the cluster name:
24+
+
25+
[source,subs="attributes+"]
26+
----
27+
CHE_EKS_CLUSTER_NAME=che
28+
----
29+
30+
. Define the region:
31+
+
32+
[source,subs="attributes+"]
33+
----
34+
CHE_EKS_CLUSTER_REGION=eu-central-1
35+
----
36+
37+
. Update `kubeconfig`:
38+
+
39+
[source,subs="attributes+"]
40+
----
41+
aws eks update-kubeconfig --region $CHE_EKS_CLUSTER_REGION --name $CHE_EKS_CLUSTER_NAME
42+
----
43+
44+
. Make sure that you have the default storage class set:
45+
+
46+
[source,subs="attributes+"]
47+
----
48+
{orch-cli} get storageclass
49+
----
50+
+
51+
The output should display a storage class with `default` next to its name:
52+
+
53+
[source,subs="attributes+"]
54+
----
55+
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
56+
gp2 (default) kubernetes.io/aws-ebs Delete WaitForFirstConsumer false 126m
57+
----
58+
59+
.Additional resources
60+
61+
* link:https://aws.amazon.com/eks/[{eks}]
62+
* link:https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html[Store Kubernetes volumes with Amazon EBS]
63+
* link:https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html[Create a managed node group for {eks-short}]
64+
* link:https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/[Change the default storage class on {kubernetes} cluster]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Module included in the following assemblies:
2+
//
3+
// installing-{prod-id-short}-on-amazon-elastic-kubernetes-service
4+
5+
[id="associate-keycloak-as-oidc-identity-provider-on-amazon-elastic-kubernetes-service"]
6+
= Associate keycloak as OIDC identity provider on {eks-short}
7+
8+
Follow these instructions to associate Keycloak an OIDC identity provider on {eks-short}.
9+
10+
.Procedure
11+
12+
. Associate Keycloak an identity provider using `eksctl`:
13+
+
14+
[source,shell,subs="attributes+"]
15+
----
16+
eksctl associate identityprovider \
17+
--wait \
18+
--config-file - << EOF
19+
---
20+
apiVersion: eksctl.io/v1alpha5
21+
kind: ClusterConfig
22+
metadata:
23+
name: $CHE_EKS_CLUSTER_NAME
24+
region: $CHE_EKS_CLUSTER_REGION
25+
identityProviders:
26+
- name: keycloak-oidc
27+
type: oidc
28+
issuerUrl: https://$KEYCLOAK_DOMAIN_NAME/realms/che
29+
clientId: k8s-client
30+
usernameClaim: email
31+
EOF
32+
----
33+
34+
.Additional resources
35+
36+
* link:https://docs.aws.amazon.com/eks/latest/userguide/authenticate-oidc-identity-provider.html[Grant users access to {kubernetes} with an external OIDC provider]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// Module included in the following assemblies:
2+
//
3+
// installing-{prod-id-short}-on-amazon-elastic-kubernetes-service
4+
5+
[id="configuring-DNS-on-amazon-elastic-kubernetes-service"]
6+
= Configuring DNS on {eks-short}
7+
8+
Follow these instructions to configure DNS on {eks-short}.
9+
10+
.Prerequisites
11+
12+
* A registered domain. See: link:https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html[Registering a new domain on {eks-short}].
13+
14+
.Procedure
15+
16+
. Define the registered domain name:
17+
+
18+
[source,subs="attributes+"]
19+
----
20+
CHE_DOMAIN_NAME=eclipse-che-eks-clould.click
21+
----
22+
23+
. Define domain name for Keycloak OIDC provider:
24+
+
25+
[source,subs="attributes+"]
26+
----
27+
KEYCLOAK_DOMAIN_NAME=keycloak.$CHE_DOMAIN_NAME
28+
----
29+
30+
. Find out the hosted zone ID for the domain:
31+
+
32+
[source,subs="attributes+"]
33+
----
34+
HOSTED_ZONE_ID=$(aws route53 list-hosted-zones-by-name --dns-name $CHE_DOMAIN_NAME --query "HostedZones[0].Id" --output text)
35+
----
36+
37+
. Find out the Canonical Hosted Zone ID for the load balancer:
38+
+
39+
[source,subs="attributes+"]
40+
----
41+
CANONICAL_HOSTED_ZONE_ID=$(aws elbv2 describe-load-balancers --query "LoadBalancers[0].CanonicalHostedZoneId" --output text)
42+
----
43+
44+
. Find out the DNS name for the load balancer:
45+
+
46+
[source,subs="attributes+"]
47+
----
48+
DNS_NAME=$({orch-cli} get service -n ingress-nginx ingress-nginx-controller -o=jsonpath='{.status.loadBalancer.ingress[0].hostname}')
49+
----
50+
51+
. Create a DNS record set:
52+
+
53+
[source,subs="attributes+"]
54+
----
55+
aws route53 change-resource-record-sets \
56+
--hosted-zone-id $HOSTED_ZONE_ID \
57+
--change-batch '
58+
{
59+
"Comment": "Ceating a record set",
60+
"Changes": [{
61+
"Action" : "CREATE",
62+
"ResourceRecordSet" : {
63+
"Name" : "'"$CHE_DOMAIN_NAME"'",
64+
"Type" : "A",
65+
"AliasTarget" : {
66+
"HostedZoneId" : "'"$CANONICAL_HOSTED_ZONE_ID"'",
67+
"DNSName" : "'"$DNS_NAME"'",
68+
"EvaluateTargetHealth" : false
69+
}
70+
}
71+
}]
72+
}
73+
'
74+
----
75+
76+
. Verify that you can access {prod-short} domain externally:
77+
+
78+
[source,subs="attributes+"]
79+
----
80+
until curl $CHE_DOMAIN_NAME; do sleep 5s; done
81+
----
82+
83+
. Create a DNS record set:
84+
+
85+
[source,subs="attributes+"]
86+
----
87+
aws route53 change-resource-record-sets \
88+
--hosted-zone-id $HOSTED_ZONE_ID \
89+
--change-batch '
90+
{
91+
"Comment": "Ceating a record set",
92+
"Changes": [{
93+
"Action" : "CREATE",
94+
"ResourceRecordSet" : {
95+
"Name" : "'"$KEYCLOAK_DOMAIN_NAME"'",
96+
"Type" : "A",
97+
"AliasTarget" : {
98+
"HostedZoneId" : "'"$CANONICAL_HOSTED_ZONE_ID"'",
99+
"DNSName" : "'"$DNS_NAME"'",
100+
"EvaluateTargetHealth" : false
101+
}
102+
}
103+
}]
104+
}
105+
'
106+
----
107+
108+
. Verify that you can access the Keycloak domain externally:
109+
+
110+
[source,subs="attributes+"]
111+
----
112+
until curl $KEYCLOAK_DOMAIN_NAME; do sleep 5s; done
113+
----

0 commit comments

Comments
 (0)