kubectl

K8s Selectors and Labels

January 15, 2022  -   3 mins read time -   514 words -  garrardkitchen

kubernetes, k8s, deployment, pod, replicaset, selectors, equality-based, set-based, kubectl

Right, what’s the deal with all the labels and metadata in a Deployment manifest?!!!! Take this example: apiVersion: apps/v1 kind: Deployment metadata: namespace: default name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx foo: baa template: metadata: labels: app: nginx foo: baa spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 Here, we see metadata twice, and also there’s mention of matchLabels in selector??? What does it all mean? ...

How to Use Kubernetes Configmap

November 2, 2020  -   4 mins read time -   721 words -  garrardkitchen

kuberetes, configmap, cm, kubectl, secrets, best practice

There’s a ton of material out there on how to use a ConfigMap. In this post I will provide a recap on the basics then I drill into how to protect your secrets! There are a few ways to create a configMap. Here, I cover just two of these ways;--from-env-file and –from-literal. I won’t cover options like from volume. How to create a ConfigMap from a literal To create a configMap from literals and from the command line, you would type this: ...