doc/researchAnsible: comparisson of kubernetes tools and added K3s setup
There are different kubernetes tools. This commit holds a table with a comparisson of the different tools. Additionally a K3s instance was set up and documented. Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
3471acdf6d
commit
cd76fd0385
|
|
@ -1483,6 +1483,146 @@ In our case <jenkins-url>:<port> = http://10.115.101.101:8080/
|
|||
Without this information you might be lost. Especially in the case if one can update plugins on the Jenkins UI.
|
||||
|
||||
|
||||
Production-Ready Kubernetes Cluster
|
||||
###################################
|
||||
There are different lightweight Kuberneters distributions avilable, such as Minikube, k3s and MicroK8s. Project pages:
|
||||
|
||||
* `minikube <https://minikube.sigs.k8s.io/>`_
|
||||
* `kind <https://kind.sigs.k8s.io/>`_
|
||||
* `k3s <https://k3s.io/>`_
|
||||
|
||||
The following table shows the key facts of each tool:
|
||||
|
||||
================================ =============================== ======================= ======================= ===============================
|
||||
comparisson item minikube kind MicroK8s k3s
|
||||
================================ =============================== ======================= ======================= ===============================
|
||||
multi-cluster support yes yes yes no (possible with containers)
|
||||
single-node support yes yes yes yes
|
||||
multi-node support no yes yes yes
|
||||
Vanilla Kubernetes yes yes yes no
|
||||
container runtime Docker, containerd, CRI-O containerd, CRI-O containerd, kata CRI-O
|
||||
high availability no yes yes yes
|
||||
runtime native, VM, Docker Docker native native
|
||||
production ready no no yes yes
|
||||
node management Docker, vm, ssh, podman, ... Docker Docker Docker
|
||||
ease of installation very easy easy challenging easy
|
||||
supports IoT/edge no no yes yes
|
||||
================================ =============================== ======================= ======================= ===============================
|
||||
|
||||
The following links give you more details about those tools:
|
||||
|
||||
* `K3s vs Kind vs MicroK8s <https://thechief.io/c/editorial/k3d-vs-k3s-vs-kind-vs-microk8s-vs-minikube/>`_
|
||||
* `K3s vs minikube vs MicroK8s <https://www.itprotoday.com/cloud-computing-and-edge-computing/lightweight-kubernetes-showdown-minikube-vs-k3s-vs-microk8s>`_
|
||||
* `minikube vs kind vs K3s <https://www.jambit.com/blog/tech/minikube-vs-kind-vs-k3s-welches-lokale-kubernetes-cluster-eignet-sich-am-besten/>`_
|
||||
|
||||
There is also a useful link about setting up and working with k3s: `getting started <https://www.baeldung.com/ops/k3s-getting-started>`_
|
||||
|
||||
My decision fell on k3s, thus I set up an AWX instance on netmodule-02 as you can see on the next section.
|
||||
|
||||
|
||||
AWX on K3s
|
||||
##########
|
||||
Setup K3s as lightweight Kubernetes Cluster
|
||||
*******************************************
|
||||
Setup K3s on your server is straight forward:
|
||||
|
||||
* Log into you server, in our case ``ssh root@10.115.101.101``
|
||||
* Install K3s as follows ``curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644``
|
||||
* Check the installation with
|
||||
|
||||
.. code-block::
|
||||
|
||||
kubectl get nodes
|
||||
NAME STATUS ROLES AGE VERSION
|
||||
netmodule-02 Ready control-plane,master 52s v1.27.3+k3s1
|
||||
|
||||
kubectl get pods --all-namespaces
|
||||
NAMESPACE NAME READY STATUS RESTARTS AGE
|
||||
kube-system coredns-77ccd57875-gkc8b 1/1 Running 0 6m9s
|
||||
kube-system local-path-provisioner-957fdf8bc-b5dcs 1/1 Running 0 6m9s
|
||||
kube-system helm-install-traefik-crd-t72t9 0/1 Completed 0 6m9s
|
||||
kube-system svclb-traefik-2b359698-4v9kj 2/2 Running 0 5m58s
|
||||
kube-system helm-install-traefik-q2q9w 0/1 Completed 1 6m9s
|
||||
kube-system traefik-64f55bb67d-mp69z 1/1 Running 0 5m58s
|
||||
kube-system metrics-server-648b5df564-ktpkl 1/1 Running 0 6m9s
|
||||
|
||||
|
||||
Setup AWX on K3s
|
||||
****************
|
||||
We are again using *kustomize* and the yaml files to setup AWX:
|
||||
|
||||
* Enter opt directory with ``cd /opt``
|
||||
* Install kustomize:
|
||||
``curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash``
|
||||
* Create a file called *awx-belden.yaml* with the content:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-belden
|
||||
spec:
|
||||
service_type: nodeport
|
||||
|
||||
* Create the file *kustomization.yaml* with the content:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- github.com/ansible/awx-operator/config/default?ref=2.4.0
|
||||
- awx-belden.yaml
|
||||
|
||||
images:
|
||||
- name: quay.io/ansible/awx-operator
|
||||
newTag: 2.4.0
|
||||
|
||||
namespace: awx
|
||||
|
||||
* Build and start AWX on K3s:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./kustomize build . | kubectl apply -f -
|
||||
|
||||
# check the created pods and services:
|
||||
kubectl get pods -A
|
||||
NAMESPACE NAME READY STATUS RESTARTS AGE
|
||||
kube-system coredns-77ccd57875-gkc8b 1/1 Running 0 5h36m
|
||||
kube-system local-path-provisioner-957fdf8bc-b5dcs 1/1 Running 0 5h36m
|
||||
kube-system helm-install-traefik-crd-t72t9 0/1 Completed 0 5h36m
|
||||
kube-system svclb-traefik-2b359698-4v9kj 2/2 Running 0 5h35m
|
||||
kube-system helm-install-traefik-q2q9w 0/1 Completed 1 5h36m
|
||||
kube-system traefik-64f55bb67d-mp69z 1/1 Running 0 5h35m
|
||||
kube-system metrics-server-648b5df564-ktpkl 1/1 Running 0 5h36m
|
||||
awx awx-operator-controller-manager-6c58d59d97-zrz2m 2/2 Running 0 14s
|
||||
kubectl get svc -A
|
||||
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
default kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 5h38m
|
||||
kube-system kube-dns ClusterIP 10.43.0.10 <none> 53/UDP,53/TCP,9153/TCP 5h38m
|
||||
kube-system metrics-server ClusterIP 10.43.34.185 <none> 443/TCP 5h38m
|
||||
kube-system traefik LoadBalancer 10.43.129.170 10.115.101.101 80:32506/TCP,443:32016/TCP 5h37m
|
||||
awx awx-operator-controller-manager-metrics-service ClusterIP 10.43.118.109 <none> 8443/TCP 2m14s
|
||||
awx awx-belden-postgres-13 ClusterIP None <none> 5432/TCP 106s
|
||||
awx awx-belden-service NodePort 10.43.253.191 <none> 80:32188/TCP 75s
|
||||
|
||||
* Get only the Belden AWX service with ``kubectl get services -n awx awx-belden-service`` (returns the last line from
|
||||
the above). In the column PORT(S) you can get the port number of the running AWX instance
|
||||
* Get the AWX admin password with
|
||||
``kubectl get secret -n awx awx-belden-admin-password -o jsonpath="{.data.password}" | base64 --decode; echo``
|
||||
* Let's access the AWX instance by entering the <host IP>:<port> in your browser, in our case ``10.115.101.101:32188``
|
||||
|
||||
|
||||
.. note::
|
||||
To stop and delete a deployed instance with kustomize run:
|
||||
|
||||
``kustomize build '<folder>' | kubectl delete -f -``,
|
||||
where <folder> contains the kustomization.yaml and awx-belden.yaml file
|
||||
|
||||
|
||||
.. |awxCredentials| image:: ./media/awx-credentials.png
|
||||
:width: 700px
|
||||
.. |awxGitCredentials| image:: ./media/awx-git-credentials.png
|
||||
|
|
|
|||
Loading…
Reference in New Issue