DevOps Classroom notes 15/Jul/2025

Config maps and Secrets

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-cm
data:
  MYSQL_ROOT_PASSWORD: qwerty456
  MYSQL_DATABASE: sales
  MYSQL_USER: ltdevops
  MYSQL_PASSWORD: qwerty456
---
apiVersion: v1
kind: Pod
metadata:
  name: mysql-fromcm
  labels:
    app: mysql
spec:
  containers:
    - name: mysql-fromcm
      image: mysql:lts
      ports:
        - containerPort: 3306
      envFrom:
        - configMapRef:
            name: mysql-cm
            optional: False

Preview
* Secret Example

---
apiVersion: v1
kind: Secret
metadata:
  name: mysql-creds
data:
  MYSQL_ROOT_PASSWORD: cXdlcnR5NDU2Cg==
  MYSQL_DATABASE: c2FsZXMK
  MYSQL_USER: bHRkZXZvcHMK
  MYSQL_PASSWORD: cXdlcnR5NDU2Cg==
---
apiVersion: v1
kind: Pod
metadata:
  name: mysql-fromsecret
  labels:
    app: mysql
    db: mysql
spec:
  containers:
    - name: mysql-fromcm
      image: mysql:lts
      ports:
        - containerPort: 3306
      envFrom:
        - secretRef:
            name: mysql-creds
            optional: False

Daemon sets

  • Now ensure you have k8s cluster with multiple nodes
  • Refer Here for daemonset
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: my-ds
spec:
  minReadySeconds: 5
  selector:
    matchLabels:
      app: agent
  template:
    metadata:
      labels:
        app: agent
    spec:
      containers:
        - name: agent
          image: alpine
          args:
            - sleep
            - 1d

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube