Last active
November 22, 2019 00:15
-
-
Save guillenotfound/c547c0b72df686b0ed91ea2291a90c40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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