0Pricing
MLOps Academy · Lektion

Mit ConfigMaps und Secrets konfigurieren

Lagern Sie Modellkonfiguration und Zugangsdaten aus.

Mit ConfigMaps und Secrets konfigurieren ist eine kostenlose MLOps Academy-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des MLOps Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Keep Config Out of the Image

Baking model paths or thresholds into the container forces a rebuild for every tweak. Kubernetes lets you inject config at runtime instead. 🔧

ConfigMaps Hold Plain Settings

A ConfigMap stores non-secret key-value pairs: a model name, a batch size, a log level. One config object, many Pods reading from it.

apiVersion: v1
kind: ConfigMap
metadata:
  name: model-config
data:
  MODEL_NAME: "ranker-v3"
  BATCH_SIZE: "32"

Inject as Environment Variables

The simplest use is to map ConfigMap keys into env vars. Your Python code then reads os.environ exactly as it would locally.

Or Mount It as Files

You can also mount a ConfigMap as a volume, turning each key into a file. Handy for full config files your model loader expects on disk.

Secrets Are for Sensitive Data

API tokens, database passwords, and registry creds belong in a Secret, never a ConfigMap. Same idea, but treated as confidential by the cluster.

Base64 Is Not Encryption

Secret values are stored base64-encoded, which is just encoding, not security. Anyone with read access can decode them, so guard access carefully.

Encrypt Secrets at Rest

For real protection, enable encryption at rest in etcd or use an external manager like Vault. Base64 alone never keeps your model credentials safe.

Consume a Secret Safely

Mount a Secret as env vars or files just like a ConfigMap. Prefer files for tokens, since env vars can leak into logs and crash dumps.

envFrom:
  - secretRef:
      name: model-creds
  - configMapRef:
      name: model-config

One Source, Many Pods

Update a ConfigMap once and every Pod that mounts it can pick up the change. Env-var injections, though, need a Pod restart to refresh.

Restart to Pick Up Env Changes

Changing a value used as an env var does not hot-reload. Trigger a rolling restart of the Deployment so Pods read the new configuration.

Separate Config per Environment

Keep one ConfigMap per environment, dev and prod. Same image, different config, means promoting a model never means rebuilding the container.

Quick Check

Where should a model service get its database password?

Recap

Use a ConfigMap for plain settings and a Secret for sensitive ones, inject both at runtime, and restart Pods to refresh env-based values. ✅

Häufig gestellte Fragen

Ist die Lektion „Mit ConfigMaps und Secrets konfigurieren“ kostenlos?

Ja — der vollständige Text von „Mit ConfigMaps und Secrets konfigurieren“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des MLOps Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Mit ConfigMaps und Secrets konfigurieren“?

Lagern Sie Modellkonfiguration und Zugangsdaten aus. Du übst MLOps Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um MLOps Academy zu starten?

Keine Vorkenntnisse erforderlich. MLOps Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.

Wie lange dauert die Lektion „Mit ConfigMaps und Secrets konfigurieren“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser MLOps Academy-Lektion Code schreiben und ausführen?

Ja. Jede MLOps Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Pods, Deployments und Services für Modelle
  2. CPU, Arbeitsspeicher und GPU anfordern
  3. Mit ConfigMaps und Secrets konfigurieren
  4. Training als Kubernetes-Job ausführen
← Zurück zu MLOps Academy