From 8a320542e3b97331854d8a8533bb1550e8933ce7 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Thu, 9 May 2024 12:45:44 +0000 Subject: [PATCH] initial: add day one instructions Also, add instructions to execute this repo. --- .mise.toml | 3 +++ README.md | 37 +++++++++++++++++++++++++++++++++++ day-001/README.md | 23 ++++++++++++++++++++++ day-001/kind/kind-cluster.yml | 7 +++++++ day-001/pod.yml | 18 +++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 .mise.toml create mode 100644 README.md create mode 100644 day-001/README.md create mode 100644 day-001/kind/kind-cluster.yml create mode 100644 day-001/pod.yml diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..39fa1d7 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,3 @@ +[tools] +kind = "0.22.0" +kubectl = "1.29.4" diff --git a/README.md b/README.md new file mode 100644 index 0000000..403028f --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Descomplicando `Kubernetes` + +## Preparando o ambiente + +Para facilitar a instalação dos _softwares_ necessários utilizo o [`mise`][mise] como gestor de ferramentas e _runtimes_. + +A instalação do [`mise`][mise] pode ser feita seguindo o [guia de uso][mise-guide]. + +Com o [`mise`][mise] instalado, executamos o seguinte comando para instalar as ferramentas: + +```bash +mise install +``` + +E, para garantir que tudo esta correto, podemos verificar a instalação rodando: + +```bash +mise current +``` + +O resultado esperado é: + +``` +kind 0.22.0 +kubectl 1.29.4 +``` + +## Curso por dias + +* [dia-01][dia-01]: subindo primeiro _cluster_ com [`kind`][kind] e fazendo _deploy_ do primeiro `pod` + +Pode ser seguido em no + +[mise]: https://mise.jdx.dev/ +[mise-guide]: https://mise.jdx.dev/getting-started.html#quickstart +[kind]: https://kind.sigs.k8s.io/ +[dia-01]: ./day-001/README.md diff --git a/day-001/README.md b/day-001/README.md new file mode 100644 index 0000000..30ab216 --- /dev/null +++ b/day-001/README.md @@ -0,0 +1,23 @@ +# Descomplicando `Kubernetes` - Dia 01 + +## Criando o _cluster_ com [`kind`][kind] + +Para subir o _cluster_ com as [configurações especificadas][kind-config], executaremos: + +```bash +kind create cluster --config ./kind-cluster.yml --name dk8s-day-001 +``` + +## _Deploy_ do `pod` aplicando o manifesto + +Com o _cluster_ rodando, podemos subir um novo `pod` usando o comando: + +```bash +kubectl apply -f pod.yml +``` + +[Voltar para o `README`][readme] + +[kind]: https://kind.sigs.k8s.io/ +[kind-config]: ./kind/kind-cluster.yml +[readme]: ../README.md diff --git a/day-001/kind/kind-cluster.yml b/day-001/kind/kind-cluster.yml new file mode 100644 index 0000000..913e384 --- /dev/null +++ b/day-001/kind/kind-cluster.yml @@ -0,0 +1,7 @@ +--- +apiVersion: kind.x-k8s.io/v1alpha4 +kind: Cluster +nodes: + - role: control-plane + - role: worker + - role: worker diff --git a/day-001/pod.yml b/day-001/pod.yml new file mode 100644 index 0000000..98f9cf6 --- /dev/null +++ b/day-001/pod.yml @@ -0,0 +1,18 @@ +--- +apiVersion: v1 +kind: Pod +metadata: + creationTimestamp: null + labels: + run: server + name: server +spec: + containers: + - image: nginx + name: server + ports: + - containerPort: 80 + resources: {} + dnsPolicy: ClusterFirst + restartPolicy: Always +status: {}