Skip to content

Instantly share code, notes, and snippets.

@azhuox
Created November 30, 2020 01:58
Show Gist options
  • Save azhuox/df1a624ab23d508640ee66e3239bb904 to your computer and use it in GitHub Desktop.
Save azhuox/df1a624ab23d508640ee66e3239bb904 to your computer and use it in GitHub Desktop.
# ConfigMap for user-msvc
apiVersion: v1
kind: ConfigMap
metadata:
name: user-msvc
namespace: user-msvc
data:
mysql-host: 127.0.0.1:3306
---
# Secret of user-msvc
apiVersion: v1
kind: Secret
metadata:
name: user-msvc
namespace: user-msvc
type: Opaque
data:
datadog-api-key: XKSSAKCKANmOWQ5NDU1NWU2MWE2ZDI=
github-access-token: Yzk4MDZkNzAxNTQwMjkwOA==
# All other configs are omitted.
---
# Pod for user-msvc
apiVersion: v1
kind: Pod
metadata:
name: user-msvc
namespace: user-msvc
labels:
app: user-msvc
spec:
# Storage
volumes:
- name: datadog-data
emptyDir: {}
- name: user-msvc-secret
secret:
defaultMode: 420
secretName: user-msvc-secret
# "Processes"
containers:
- name: user-msvc
image: gcr.io/path/to/user-msvc:1.0.0
ports:
- name: secure-port
containerPort: 443
protocol: TCP
env:
- name: MYSQL_HOST
valueFrom:
configMapKeyRef:
name: user-msvc
key: mysql-host
volumeMounts:
- name: ndatadog-data
mountPath: /var/log/user-msvc
- name: user-msvc-secret
mountPath: /etc/user-msvc/secret
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 200m
memory: 200Mi
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.12
ports:
- name: connect-port
containerPort: 3306
protocol: TCP
requests:
...
- name: datadog-agent
image: gcr.io/path/to/monitor:1.0.0
volumeMounts:
- name: datadog-data
mountPath: /var/log/monitor
- name: user-msvc-secret
mountPath: /etc/datadog-agent/secret
requests:
...
---
# External Service for user-msvc
kind: Service
apiVersion: v1
metadata:
name: user-msvc
spec:
ports:
- name: secure-port
port: 443
targetPort: 443
protocol: TCP
selector:
app: user-msvc
type: LoadBalancer
loadBalancerIP: 12.34.56.78 # This is a fake IP
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment