diff --git a/19-METRICS.md b/19-METRICS.md deleted file mode 100644 index a00cb45..0000000 --- a/19-METRICS.md +++ /dev/null @@ -1,15 +0,0 @@ -How to create kubectl alias (optional): -- `alias k=kubectl` - -Go to github and install metrics-server: -- `https://github.com/kubernetes-sigs/metrics-server` - -Get Nodes metrics: -- `k top nodes` - -Get Pods metrics: -- `k top pods -n default` - -Order results: -- `k top pods -n default --sort-by=cpu` -- `k top pods -n default --sort-by=memory` diff --git a/19-POD-LABELS.md b/19-POD-LABELS.md new file mode 100644 index 0000000..614d818 --- /dev/null +++ b/19-POD-LABELS.md @@ -0,0 +1,25 @@ +How to create kubectl alias (optional): +- `alias k=kubectl` + +Doc: +- `https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/` + +Add two labels on a POD: + ``` + apiVersion: v1 + kind: Pod + metadata: + name: nginx-labels-pod + labels: + environment: production + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80` + ``` + +Get Pods by labels: +- `k get pods -l environment=production,tier=frontend`