Skip to content

Instantly share code, notes, and snippets.

@guillenotfound
Last active November 22, 2019 00:15
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 guillenotfound/c547c0b72df686b0ed91ea2291a90c40 to your computer and use it in GitHub Desktop.
Save guillenotfound/c547c0b72df686b0ed91ea2291a90c40 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat <<\EOF > app.yaml
kind: Service
apiVersion: v1
metadata:
namespace: challenge
name: frontend-service
spec:
selector:
role: frontend
ports:
- protocol: TCP
port: 80
targetPort: 3000
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: challenge
name: frontend-deployment
spec:
replicas: 1
selector:
matchLabels:
role: frontend
template:
metadata:
labels:
role: frontend
spec:
containers:
- image: gcr.io/gke-arcade/challenge
name: app
ports:
- name: http
containerPort: 3000
env:
- name: USERNAME
valueFrom:
configMapKeyRef:
name: prod-configmap
key: username
- name: PASSWORD
valueFrom:
secretKeyRef:
name: prod-secret
key: password
EOF
cat <<\EOF > finished.txt
_______________
/ Username: foo \
\ Password: bar /
---------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
EOF
kubectl create ns challenge
kubectl --namespace challenge create configmap prod-configmap --from-literal username=foo
kubectl --namespace challenge create secret generic prod-secret --from-literal password=bar
kubectl apply -f app.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment