Difference between revisions of "Kubernetes Ingress with MetalLB"

From PKC
Jump to navigation Jump to search
(Created page with "==Background== This page is to document the attempt of installing Kubernetes Ingress with MetalLB at AWS Cluster. Beforehand the kubernetes cluster is installed an all worker...")
 
m (Text replacement - "{{#ev:youtube |" to "{{#widget:YouTube |id=")
 
(31 intermediate revisions by one other user not shown)
Line 10: Line 10:
w2        Ready    <none>                23d    v1.21.3
w2        Ready    <none>                23d    v1.21.3
</syntaxhighlight>
</syntaxhighlight>
Below are the structured of installation process that we are going to perform
# Install Helm
# Install Kubernetes Ingress
# Apply configuration
# Check Result
==Install Helm==
This document using helm version v3.4.2. Start with downloading and unpack the binary release of this version.
wget https://get.helm.sh/helm-v3.4.2-linux-amd64.tar.gz
tar -xzvf helm-v3.4.2-linux-amd64.tar.gz
Then, move to desire location
mv linux-amd64/helm /usr/local/bin/helm
You might need sudo to execute it, once it executed, you can add the chart repository of bitnami into the helm installation
helm repo add bitnami https://charts.bitnami.com/bitnami
Then you can check the repository content of helm
helm search repo bitnami
<syntaxhighlight>
NAME                                        CHART VERSION APP VERSION  DESCRIPTION
bitnami/bitnami-common                      0.0.9        0.0.9        DEPRECATED Chart with custom templates used in ...
bitnami/airflow                            10.2.8      2.1.2        Apache Airflow is a platform to programmaticall...
bitnami/apache                              8.6.0        2.4.48      Chart for Apache HTTP Server
bitnami/argo-cd                            1.0.1        2.0.5        Declarative, GitOps continuous delivery tool fo...
bitnami/aspnet-core                        1.3.14      3.1.18      ASP.NET Core is an open-source framework create...
bitnami/cassandra                          8.0.2        4.0.0        Apache Cassandra is a free and open-source dist...
bitnami/cert-manager                        0.1.12      1.5.0        Cert Manager is a Kubernetes add-on to automate...
bitnami/common                              1.8.0        1.8.0        A Library Helm Chart for grouping common logic ...
bitnami/concourse                          0.1.3        7.4.0        Concourse is a pipeline-based continuous thing-...
...
</syntaxhighlight>
==Getting Started with NGINX Ingress==
First thing to be done, is to register the repository of NGINX Ingress into helm, update the repository, and install it through helm chart
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx
helm repo update
Response
<syntaxhighlight>
"ingress-nginx" has been added to your repositories
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
</syntaxhighlight>
And, check on available repository, will display available ingress-nginx helm chart
helm search repo ingress
<syntaxhighlight>
NAME                            CHART VERSION APP VERSION DESCRIPTION
bitnami/nginx-ingress-controller 7.6.19      0.48.1    Chart for the nginx Ingress controller <<<--- helm chart
ingress-nginx/ingress-nginx    3.35.0      0.48.1    Ingress controller for Kubernetes using NGINX a...
bitnami/contour                5.1.0        1.18.0    Contour Ingress controller for Kubernetes
bitnami/kong                    3.8.2        2.5.0      Kong is a scalable, open source API layer (aka ...
</syntaxhighlight>
In order to install the MetalLB ingress, we are not going to execute all helm chart directly, but  we need to made several modification of available helm chart repo. Below is the instruction on how to change the helm chart.
Save the helm chart into you choice of temporary or working folder, by executing
helm show values ingress-nginx/ingress-nginx --version=3.19.0 > ingress-nginx.yaml
Note, that we are going this specific version to align the result with the reference tutorial document. Once the command executed, edit the file with your preferable text editing document. Below are the changes that need to be made
{| class="wikitable sortable"
|+ Changes on YAML File
|-
! No !! Parameter !! Before !! After
|-
| 1 || hostNetwork || false || true
|-
| 2 || hostPort.enabled || false || true
|-
| 3 || Kind || Deployment || DaemonSet
|}
Once the changes are made ans saved into the temporary files, then we are all set to install the ingress-nginx.
==Executing Installation yaml file==
Since we are going to install ingress-nginx into different namespace, then we need to create new namespace beforehand, and check the result
kubeclt create ns ingress-nginx
kubectl get namespace
To install the helm chart into specific namespace, which in this case is the ingress-nginx namespace, use below command
helm install [your-installation-name] [repo]/[helm chart] -n [namespace] --value [yaml file]
helm install myingress ingress-nginx/ingress-nginx -n ingress-nginx --values ./ingress-nginx.yaml
The result of the command should be something like below captured message
<syntaxhighlight>
NAME: myingress
LAST DEPLOYED: Sat Aug 14 07:00:50 2021
NAMESPACE: ingress-nginx
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace ingress-nginx get services -o wide -w myingress-ingress-nginx-controller'
</syntaxhighlight>
To verify the installation result, use below command
helm list -n ingress-nginx
NAME    NAMESPACE    REVISION UPDATED                                STATUS  CHART              APP VERSION
myingress ingress-nginx 1      2021-08-14 07:00:50.488872326 +0000 UTC deployed ingress-nginx-3.35.0 0.48.1
Below list shows us what is the helm chart that has installed on this k8s cluster, and particular namespace.
==Conclusions==
MetalLB is solution for bare-metal implementation of kubernetes cluster, this particular implementation is not supported by AWS, in which become our short term target to implement ke PKC Solution. Will change direction into AWS documentation on Getting started with Elastic Kubernetes Services provide by AWS.
Please refer to this link
[Getting started with Amazon EKS[https://thewiki.us/index.php?title=Getting_Started_on_Amazon_EKS&action=edit&redlink=1]]
==External Links==
1. Tutorial references
{{#widget:YouTube
|id=UvwtALIb2U8
}}
2. Github Kubernetes Ingress repository : </br>
https://github.com/kubernetes/ingress-nginx
3. Getting started document : </br>
https://kubernetes.github.io/ingress-nginx/deploy/

Latest revision as of 11:16, 26 August 2022

Background

This page is to document the attempt of installing Kubernetes Ingress with MetalLB at AWS Cluster. Beforehand the kubernetes cluster is installed an all worker nodes has joined the master node. Refer to K8S Installation Process for installation process.

One can check the cluster nodes by using below command

kubectl get nodes
NAME      STATUS   ROLES                  AGE     VERSION
kmaster   Ready    control-plane,master   23d     v1.21.3
w1        Ready    <none>                 4d10h   v1.22.0
w2        Ready    <none>                 23d     v1.21.3

Below are the structured of installation process that we are going to perform

  1. Install Helm
  2. Install Kubernetes Ingress
  3. Apply configuration
  4. Check Result

Install Helm

This document using helm version v3.4.2. Start with downloading and unpack the binary release of this version.

wget https://get.helm.sh/helm-v3.4.2-linux-amd64.tar.gz
tar -xzvf helm-v3.4.2-linux-amd64.tar.gz

Then, move to desire location

mv linux-amd64/helm /usr/local/bin/helm

You might need sudo to execute it, once it executed, you can add the chart repository of bitnami into the helm installation

helm repo add bitnami https://charts.bitnami.com/bitnami

Then you can check the repository content of helm

helm search repo bitnami
NAME                                        	CHART VERSION	APP VERSION  	DESCRIPTION
bitnami/bitnami-common                      	0.0.9        	0.0.9        	DEPRECATED Chart with custom templates used in ...
bitnami/airflow                             	10.2.8       	2.1.2        	Apache Airflow is a platform to programmaticall...
bitnami/apache                              	8.6.0        	2.4.48       	Chart for Apache HTTP Server
bitnami/argo-cd                             	1.0.1        	2.0.5        	Declarative, GitOps continuous delivery tool fo...
bitnami/aspnet-core                         	1.3.14       	3.1.18       	ASP.NET Core is an open-source framework create...
bitnami/cassandra                           	8.0.2        	4.0.0        	Apache Cassandra is a free and open-source dist...
bitnami/cert-manager                        	0.1.12       	1.5.0        	Cert Manager is a Kubernetes add-on to automate...
bitnami/common                              	1.8.0        	1.8.0        	A Library Helm Chart for grouping common logic ...
bitnami/concourse                           	0.1.3        	7.4.0        	Concourse is a pipeline-based continuous thing-...
...

Getting Started with NGINX Ingress

First thing to be done, is to register the repository of NGINX Ingress into helm, update the repository, and install it through helm chart

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx
helm repo update

Response

"ingress-nginx" has been added to your repositories

Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈

And, check on available repository, will display available ingress-nginx helm chart

helm search repo ingress
NAME                            	CHART VERSION	APP VERSION	DESCRIPTION
bitnami/nginx-ingress-controller	7.6.19       	0.48.1     	Chart for the nginx Ingress controller <<<--- helm chart
ingress-nginx/ingress-nginx     	3.35.0       	0.48.1     	Ingress controller for Kubernetes using NGINX a...
bitnami/contour                 	5.1.0        	1.18.0     	Contour Ingress controller for Kubernetes
bitnami/kong                    	3.8.2        	2.5.0      	Kong is a scalable, open source API layer (aka ...

In order to install the MetalLB ingress, we are not going to execute all helm chart directly, but we need to made several modification of available helm chart repo. Below is the instruction on how to change the helm chart.

Save the helm chart into you choice of temporary or working folder, by executing

helm show values ingress-nginx/ingress-nginx --version=3.19.0 > ingress-nginx.yaml

Note, that we are going this specific version to align the result with the reference tutorial document. Once the command executed, edit the file with your preferable text editing document. Below are the changes that need to be made

Changes on YAML File
No Parameter Before After
1 hostNetwork false true
2 hostPort.enabled false true
3 Kind Deployment DaemonSet

Once the changes are made ans saved into the temporary files, then we are all set to install the ingress-nginx.

Executing Installation yaml file

Since we are going to install ingress-nginx into different namespace, then we need to create new namespace beforehand, and check the result

kubeclt create ns ingress-nginx
kubectl get namespace

To install the helm chart into specific namespace, which in this case is the ingress-nginx namespace, use below command

helm install [your-installation-name] [repo]/[helm chart] -n [namespace] --value [yaml file]
helm install myingress ingress-nginx/ingress-nginx -n ingress-nginx --values ./ingress-nginx.yaml

The result of the command should be something like below captured message

NAME: myingress
LAST DEPLOYED: Sat Aug 14 07:00:50 2021
NAMESPACE: ingress-nginx
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace ingress-nginx get services -o wide -w myingress-ingress-nginx-controller'

To verify the installation result, use below command

helm list -n ingress-nginx
NAME     	NAMESPACE    	REVISION	UPDATED                                	STATUS  	CHART               	APP VERSION
myingress	ingress-nginx	1       	2021-08-14 07:00:50.488872326 +0000 UTC	deployed	ingress-nginx-3.35.0	0.48.1

Below list shows us what is the helm chart that has installed on this k8s cluster, and particular namespace.

Conclusions

MetalLB is solution for bare-metal implementation of kubernetes cluster, this particular implementation is not supported by AWS, in which become our short term target to implement ke PKC Solution. Will change direction into AWS documentation on Getting started with Elastic Kubernetes Services provide by AWS.

Please refer to this link

[Getting started with Amazon EKS[1]]

External Links

1. Tutorial references

2. Github Kubernetes Ingress repository :
https://github.com/kubernetes/ingress-nginx

3. Getting started document :
https://kubernetes.github.io/ingress-nginx/deploy/