@ -10,8 +10,7 @@ But it has a base assumption that a `pod` can be killed whenever it wants to. So
## First pod
Let's start to deploy this docker image <https://hub.docker.com/r/mhausenblas/simpleservice/>.
It's a stateless python JSON API that answers on:
Let's start to deploy the docker image [mhausenblas/simpleservice](https://hub.docker.com/r/mhausenblas/simpleservice/). It's a stateless python JSON API that answers on:
We also could have used the `kubectl create -f ...`. But it's better to have a declarative approach in Kubernetes rather than an imperative one, [see](https://medium.com/bitnami-perspectives/imperative-declarative-and-a-few-kubectl-tricks-9d6deabdde).
We also could have used the `kubectl create -f ...`. But it's better to have a declarative approach in Kubernetes rather than an imperative one, [see](https://medium.com/bitnami-perspectives/imperative-declarative-and-a-few-kubectl-tricks-9d6deabdde).
## `kubectl get`
@ -107,7 +106,7 @@ minikube dashboard
## Exercises
1. Deploy a `pod` containing nginx. The image name is `nginx`, see: <https://hub.docker.com/_/nginx/>
1. Deploy a `pod` containing nginx. The image name is `nginx`, see: https://hub.docker.com/_/nginx/.
2. Do you think you can access the pod `simple-service` from outside of Kubernetes, *without changing the manifest*?
## Clean up
@ -118,7 +117,7 @@ kubectl delete pod --all
## Answers
For 2. Nop, the pod is only visible from the inside of the cluster
For 2), no, the pod is only visible from the inside of the cluster.
@ -16,12 +16,12 @@ Valid label values must be 63 characters or less and must be empty or begin and
## Labels in action
Apply the pod `06-label-annotation/01-simple-pod.yml`. It is the same as `05-pods/01-simple-pod.yml` but with 2 labels:
Apply the manifest [01-simple-pod.yml](01-simple-pod.yml). It is the same as [05-pods/01-simple-pod.yml](../05-pods/01-simple-pod.yml) but with 2 labels:
* `env`: `production`
* `tier`: `backend`
Apply the pod `06-label-annotation/02-nginx.yml`. It is a simple nginx with 2 labels:
Apply the manifest [02-nginx.yml](02-nginx.yml). It is a simple nginx with 2 labels:
* `env`: `production`
* `tier`: `frontend`
@ -47,10 +47,6 @@ nginx 1/1 Running 0 1m
Those queries we call them `selector` in the Kubernetes jargon. We will use them later on with deployments.
@ -31,13 +31,13 @@ A PDB is composed of two configurations:
If you want to see the effect of a PDB, you will need a multi-node Kubernetes. As those lines are written `minikube` is a single node cluster. To have locally a multi-node cluster you can install [kind](https://github.com/kubernetes-sigs/kind).
Use the [configuration file](./kind.yml) provided to create your cluster:
Use the [configuration file](kind.yml) provided to create your cluster:
```sh
kind create cluster --config kind.yml
```
Review and apply the manifests in [01-pdb.yml](./01-pdb.yml). Why did we specify a soft anti-affinity?
Review and apply the manifests in [01-pdb.yml](01-pdb.yml). Why did we specify a soft anti-affinity?
In a terminal run the command:
@ -57,10 +57,6 @@ This command will remove, drain, the node `kind-worker2` from the cluster. Watch
@ -33,7 +33,7 @@ Istio, the service mesh tool, installs a sidecar container to do its job: https:
## Exercices
Review and apply the file [01-sidecar.yml](./01-sidecar.yml). Connect to the `nginx` container and look at the file system in `/usr/share/nginx/html`.
Review and apply the file [01-sidecar.yml](01-sidecar.yml). Connect to the `nginx` container and look at the file system in `/usr/share/nginx/html`.
This exercice is taken from the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/#creating-a-pod-that-runs-two-containers).
@ -46,10 +46,6 @@ It contains multiple, ready to use, Kubernetes manifest for projects, for exampl
[Kube State Metrics](https://github.com/kubernetes/kube-state-metrics) is a service you can install on your Kubernetes clusters to get metrics from its state. It's very useful for production cluster as you can measure and put alerts on the state of your applications. Like when do you have pod evictions, are your deployment fully deployed, etc.