Skip to content

Instantly share code, notes, and snippets.

@jovemfelix
Created May 29, 2024 19:35
Show Gist options
  • Save jovemfelix/8f60f939f0d3a9a948ca0db381b26ed3 to your computer and use it in GitHub Desktop.
Save jovemfelix/8f60f939f0d3a9a948ca0db381b26ed3 to your computer and use it in GitHub Desktop.
---
# Senha do banco de dados
apiVersion: v1
kind: Secret
metadata:
name: database-secret
type: Opaque
stringData:
username: 'my-username'
password: 'my-pass'
---
# App que usa a secret
kind: Deployment
apiVersion: apps/v1
metadata:
name: ubi9
spec:
replicas: 1
selector:
matchLabels:
app: ubi9
template:
metadata:
creationTimestamp: null
labels:
app: ubi9
spec:
containers:
- name: ubi
image: 'registry.access.redhat.com/ubi9/ubi-micro:latest'
command:
- /bin/sh
- '-c'
- |
echo "username = ${username} and password=${password}"
sleep infinity
envFrom:
- secretRef:
name: database-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment