Giter Site home page Giter Site logo

k8s-webinar-configmaps-secrets's Introduction

K8s-Webinar-ConfigMaps-Secrets

Demo1-ConfigMaps:

Demonstrates use of ConfigMaps for injecting configs via CLI VAR, env VAR and File System

Go to directory:

cd  Deploy-Kubernetes/Demo1-ConfigMaps

Deploy ConfigMaps:

kubectl create -f configmap.yml

Deploy POD pod-cmd (injection via CLI VAR):

kubectl create -f pod-cmd.yml

Check:

kubectl logs test-pod-cmd

Deploy POD pod-env (injection via ENV VAR):

kubectl create -f pod-env.yml

Check:

kubectl exec -ti test-pod-env sh
env

Deploy POD pod-vol (injection via File System):

kubectl create -f pod-vol.yml

Check:

kubectl exec -ti test-pod-vol sh
cd /etc/config
more log.level
more log.location 

Demo2-ConfigMaps:

This examples shows how to inject Redis config using Configmap. Injection is done thru file system.

Go to directory:

cd  Deploy-Kubernetes/Demo2-ConfigMaps

Create ConfigMap using Interactive mode:

kubectl create configmap example-redis-config --from-file=redis-config
kubectl get cm

Create Redis POD:

kubectl create -f redis.yml

Check:

kubectl exec -ti redis sh
 redis-cli
  CONFIG GET maxmemory
  CONFIG GET maxmemory-policy

Demo3-Secrets:

This examples shows how to inject Secrets like username and password to Redis using File System.

Go to directory:

cd  Deploy-Kubernetes/Demo3-Secrets

Create Secrets:

kubectl create secret generic dbsecret --from-file=./username.txt --from-file=./password.txt

Create POD using the Secrets inside:

kubectl create -f pod-secret.yml

Result

kubectl exec -ti secret-pod sh
 cd /etc/foo
 more password.txt
 more username.txt

Demo4-Secrets

This examples shows how to inject Secrets like username and password to Redis using ENV VAR.

Go to directory:

cd  Deploy-Kubernetes/Demo4-Secrets

Create Secrets:

kubectl create -f my-secret.yml

Create POD using the Secrets inside:

kubectl create -f pod-secret-env.yml 

Result:

kubectl exec -ti secret-env-pod sh
 env

You should be able to see: SECRET_USERNAME=admin SECRET_PASSWORD=mypassword

k8s-webinar-configmaps-secrets's People

Contributors

guillierf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.