devopscoderio/podsecrets

By devopscoderio

Updated about 2 years ago

Flask app demonstrating Kubernetes secrets with color-coded backgrounds for status.

Image
Security
0

282

devopscoderio/podsecrets repository overview

Certainly! Here's the updated Docker Hub description with instructions to run the pod devopscoderio/podsecrets:


🛡️ Kubernetes Secrets Demo Application 🛡️

Overview

Welcome to the Kubernetes Secrets Demo Application! This Docker image is designed to demonstrate the use of Kubernetes secrets through a simple Flask web application. The application dynamically changes background colours based on the availability of specific secrets, making it easy to visualise whether the secrets are correctly mounted in the Kubernetes pods.

Features
  • 💚 Green Background: Displayed when both USERNAME and PASSWORD secrets are mounted.
  • 🟧 Amber Background: Displayed when only one of USERNAME or PASSWORD secrets is mounted.
  • ❤️ Red Background: Displayed when neither USERNAME nor PASSWORD secrets are mounted.
Getting Started
Prerequisites
  • Docker
  • Kubernetes
  • kubectl
Usage
  1. Create Kubernetes Secrets:

    kubectl create secret generic my-secret --from-literal=username=my-app --from-literal=password=s3cr3t
    
  2. Deploy to Kubernetes:

    Deploy with secrets:

    kubectl apply -f deployment-with-secret.yaml
    

    Deploy without secrets:

    kubectl apply -f deployment-without-secret.yaml
    

    Create services:

    kubectl apply -f service.yaml
    
  3. Run the Pod:

    kubectl run podsecrets --image=devopscoderio/podsecrets --restart=Never
    
  4. Access the Application:

    Check pod status:

    kubectl get pods
    

    Port-forward to access services locally:

    kubectl port-forward svc/secret-demo-service 8080:80
    kubectl port-forward svc/secret-demo-no-secret-service 8081:80
    

    Access services:

    • With secrets: http://localhost:8080/
    • Without secrets: http://localhost:8081/
Expected Behavior
  • 💚 Green Background: When both USERNAME and PASSWORD are mounted.
  • 🟧 Amber Background: When only one of USERNAME or PASSWORD is mounted.
  • ❤️ Red Background: When neither USERNAME nor PASSWORD is mounted.
Tags
  • Kubernetes Secrets
  • Flask Web Application
  • Docker Image
  • Kubernetes Demo
  • Secret Management
  • Containerized Application
  • Kubernetes Tutorial

Tag summary

Content type

Image

Digest

sha256:5e8be34bd

Size

44.8 MB

Last updated

about 2 years ago

docker pull devopscoderio/podsecrets