From 7a79c36e2e2efdcfd188633f5e47675f93a5fc83 Mon Sep 17 00:00:00 2001 From: RichardLinde Date: Wed, 26 Oct 2022 13:06:20 +0200 Subject: [PATCH 1/3] Added kubernetes documentation --- modules/ROOT/pages/cross_cutting/k8s.adoc | 67 +++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 modules/ROOT/pages/cross_cutting/k8s.adoc diff --git a/modules/ROOT/pages/cross_cutting/k8s.adoc b/modules/ROOT/pages/cross_cutting/k8s.adoc new file mode 100644 index 0000000..fce1639 --- /dev/null +++ b/modules/ROOT/pages/cross_cutting/k8s.adoc @@ -0,0 +1,67 @@ += Kubernetes + +Kubernetes(k8s) is an open source system for link:https://www.redhat.com/en/topics/containers/what-is-container-orchestration[container orchestration]. Kubernetes allows the automatic management of containers. Learn more about Kubernetes link:https://kubernetes.io/de/[here]. + + +== Setup +[NOTE] +==== +link:https://www.docker.com/pricing/faq/[Docker Desktop] is no longer free for large companies. Please use Rancer Desktop instead. +==== +* Install Rancher Desktop with the link:https://github.com/devonfw/ide[DevonIDE] +* Choose a container Runtime containerd or dockerd(moby) +** containerd is using the link:https://github.com/containerd/nerdctl[nerdctl] +** dockerd is using the link:https://github.com/docker/cli[docker cli] + +== Commands + +Nerdctl is a "docker-compatible" cli tool for the containerd runtime. It mimics the docker interface in most cases. For the local development, the only difference is shown below. + +=== Building an image for locale k8s +[tabs] +==== +Docker:: ++ +-- + Create a locale image from Dockerfile for local kubernetese cluster + ----- + docker build -t image_name . + ----- + + Create objects in the cluter from a configuration file + ----- + kubectl apply -f configFile.yaml + ----- +-- +Nerdctl:: ++ +-- + Create a locale image from Dockerfile for local kubernetese cluster + ----- + nerdctl build -t image_name --namespace k8s.io . + ----- + + Create objects in the cluter from a configuration file + ----- + kubectl apply -f configFile.yaml + ----- +-- +==== + + +Yaml files define the structure of a kuberentes application. Each link:https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/[object] inside the cluster can be described with a yaml file. +Kuberentes has lots of different objects. To get startet check out the following: + +- link:https://kubernetes.io/docs/concepts/workloads/controllers/deployment/[Deployment] +- link:https://kubernetes.io/docs/concepts/services-networking/service/[Service] +- link:https://kubernetes.io/docs/concepts/configuration/configmap/[ConfigMap] +- link:https://kubernetes.io/docs/concepts/configuration/secret/[Secrets] + + +== Using Helm + +link:https://helm.sh/[Helm] is a commandline tool to help define, install, and upgrade kubernetes applications by automating the deployment of objects. + +To get started with helm view this link:https://helm.sh/docs/chart_template_guide/getting_started/[guide] + +View the example for more details \ No newline at end of file From aa13d001b9bdeb422e12c6642efb4df0681a0da1 Mon Sep 17 00:00:00 2001 From: RichardLinde Date: Wed, 26 Oct 2022 13:19:26 +0200 Subject: [PATCH 2/3] Fixed Tab codeblocks --- modules/ROOT/pages/cross_cutting/k8s.adoc | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/ROOT/pages/cross_cutting/k8s.adoc b/modules/ROOT/pages/cross_cutting/k8s.adoc index fce1639..a2c11db 100644 --- a/modules/ROOT/pages/cross_cutting/k8s.adoc +++ b/modules/ROOT/pages/cross_cutting/k8s.adoc @@ -19,34 +19,34 @@ Nerdctl is a "docker-compatible" cli tool for the containerd runtime. It mimics === Building an image for locale k8s [tabs] -==== +===== Docker:: + -- - Create a locale image from Dockerfile for local kubernetese cluster - ----- - docker build -t image_name . - ----- - - Create objects in the cluter from a configuration file - ----- - kubectl apply -f configFile.yaml - ----- +Create a locale image from Dockerfile for local kubernetese cluster +---- +docker build -t image_name . +---- + +Create objects in the cluter from a configuration file +---- +kubectl apply -f configFile.yaml +---- -- Nerdctl:: + -- - Create a locale image from Dockerfile for local kubernetese cluster - ----- - nerdctl build -t image_name --namespace k8s.io . - ----- - - Create objects in the cluter from a configuration file - ----- - kubectl apply -f configFile.yaml - ----- +Create a locale image from Dockerfile for local kubernetese cluster +---- +nerdctl build -t image_name --namespace k8s.io . +---- + +Create objects in the cluter from a configuration file +---- +kubectl apply -f configFile.yaml +---- -- -==== +===== Yaml files define the structure of a kuberentes application. Each link:https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/[object] inside the cluster can be described with a yaml file. From 8ae6b3785d36c414d4672db7f035d8908102c00a Mon Sep 17 00:00:00 2001 From: RichardLinde Date: Wed, 26 Oct 2022 13:29:36 +0200 Subject: [PATCH 3/3] Added k8s to navigation --- modules/ROOT/nav.adoc | 1 + modules/ROOT/pages/cross_cutting/k8s.adoc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 5b89ddc..8b85f55 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -20,6 +20,7 @@ ** xref:cross_cutting/dependency-injection.adoc[] ** xref:cross_cutting/exceptions.adoc[] ** xref:cross_cutting/i18n.adoc[] +** xref:cross_cutting/k8s.adoc[] ** xref:cross_cutting/logging.adoc[] ** Security *** xref:cross_cutting/security/authentication.adoc[] diff --git a/modules/ROOT/pages/cross_cutting/k8s.adoc b/modules/ROOT/pages/cross_cutting/k8s.adoc index a2c11db..d4e15d2 100644 --- a/modules/ROOT/pages/cross_cutting/k8s.adoc +++ b/modules/ROOT/pages/cross_cutting/k8s.adoc @@ -1,4 +1,4 @@ -= Kubernetes += Kubernetes (k8s) Kubernetes(k8s) is an open source system for link:https://www.redhat.com/en/topics/containers/what-is-container-orchestration[container orchestration]. Kubernetes allows the automatic management of containers. Learn more about Kubernetes link:https://kubernetes.io/de/[here]. @@ -48,6 +48,7 @@ kubectl apply -f configFile.yaml -- ===== +== Using Yaml Config files Yaml files define the structure of a kuberentes application. Each link:https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/[object] inside the cluster can be described with a yaml file. Kuberentes has lots of different objects. To get startet check out the following: @@ -57,6 +58,11 @@ Kuberentes has lots of different objects. To get startet check out the following - link:https://kubernetes.io/docs/concepts/configuration/configmap/[ConfigMap] - link:https://kubernetes.io/docs/concepts/configuration/secret/[Secrets] +To create an object inside the cluster run +---- +kubectl apply -f configFile.yaml +---- + == Using Helm