Skip to content

Instantly share code, notes, and snippets.

@lukaszbudnik
Last active May 20, 2021 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszbudnik/93932736f9eaf7b11290d80fdc2db39c to your computer and use it in GitHub Desktop.
Save lukaszbudnik/93932736f9eaf7b11290d80fdc2db39c to your computer and use it in GitHub Desktop.
dev.to - config
kubectl create configmap haproxy-auth-gateway-cfg --from-file=config/haproxy.cfg
kubectl create secret generic -n hotel db-credentials \
--from-literal=username=someuser \
--from-literal=password='PasswordWithSpecialCharsLikeThis:S!\*$='
apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway
labels:
app.kubernetes.io/name: gateway
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: gateway
template:
metadata:
labels:
app.kubernetes.io/name: gateway
spec:
containers:
- name: gateway
image: lukasz/yosoy
ports:
- containerPort: 80
volumeMounts:
- name: haproxy-cfg
mountPath: /usr/local/etc/haproxy
volumes:
- name: haproxy-cfg
configMap:
name: haproxy-auth-gateway-cfg
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookmaker
labels:
app.kubernetes.io/name: bookmaker
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: bookmaker
template:
metadata:
labels:
app.kubernetes.io/name: bookmaker
spec:
containers:
- name: bookmaker
image: lukasz/yosoy
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: db-credentials
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-credentials
key: password
ports:
- containerPort: 80
dataSource: "user=${DB_USER} password=${DB_PASSWORD} dbname=${DB_NAME} host=${DB_HOST} port=${DB_PORT}"
webHookHeaders:
- "X-Security-Token: ${SECURITY_TOKEN}"
@lukaszbudnik
Copy link
Author

These are code samples and listings for my dev.to article: https://dev.to/lukaszbudnik/building-cloud-native-apps-config-and-toggles-2384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment