🌐 Machine-translated from Russian. Show original
In this part:
What we are unfolding
The small web service podinfo is an open demo application created specifically for Kubernetes training: web pages, health checks /healthz and /readyz, configuration through variable environments. Instead, substitute your image from the Docker series — the manifest structure will be the same.
Keep all manifests in Git in the k8s/ directory — in part 6 it will become the source for automatic deployment.
Step 1. Namespace
The namespace separates applications from each other: their own objects, rights, quotas.
# k8s/00-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: demo
Step 2. ConfigMap and Secret
# k8s/10-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: podinfo-config
namespace: demo
data:
PODINFO_UI_MESSAGE: "Привет от Kommit!"
PODINFO_UI_COLOR: "#326ce5"
Do not keep the secret in Git plaintext — create it as a command (in a real application, there will be a database password or API key):
kubectl create secret generic podinfo-secret -n demo \
--from-literal=DB_PASSWORD="$(openssl rand -base64 24)"
