Skip to content

Latest commit

 

History

History
71 lines (59 loc) · 1.05 KB

06a-configmap-mariadb.md

File metadata and controls

71 lines (59 loc) · 1.05 KB

ConfigMap Example (Mariadb)

Schritt 1: configmap

cd 
mkdir -p manifests
cd manifests
mkdir cftest 
cd cftest 
nano 01-configmap.yml 
## 01-configmap.yml
kind: ConfigMap 
apiVersion: v1 
metadata:
  name: mariadb-configmap 
data:
  # als Wertepaare
  MARIADB_ROOT_PASSWORD: 11abc432
kubectl apply -f .
kubectl get cm
kubectl get cm mariadb-configmap -o yaml

Schritt 2: Deployment

nano 02-deploy.yml
#deploy.yml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mariadb-deployment
spec:
  selector:
    matchLabels:
      app: mariadb
  replicas: 1 
  template:
    metadata:
      labels:
        app: mariadb
    spec:
      containers:
      - name: mariadb-cont
        image: mariadb:latest
        envFrom:
        - configMapRef:
            name: mariadb-configmap

kubectl apply -f .

Important Sidenode