Skip to content

Instantly share code, notes, and snippets.

@onefoursix
Created May 15, 2020 18:32
Show Gist options
  • Select an option

  • Save onefoursix/bdb44194bc272229d804ab217252e256 to your computer and use it in GitHub Desktop.

Select an option

Save onefoursix/bdb44194bc272229d804ab217252e256 to your computer and use it in GitHub Desktop.
SDC Deployment YAML with MySQL connection properties loaded from a Kubernetes Secret
apiVersion: apps/v1
kind: Deployment
metadata:
name: sdc-jdbc
namespace: ns1
spec:
replicas: 1
selector:
matchLabels:
app: sdc-jdbc
template:
metadata:
labels:
app: sdc-jdbc
spec:
containers:
- name: datacollector
image: <your-repo>/<your-sdc-image>:<version>
imagePullPolicy: Always
ports:
- containerPort: 18630
env:
- name: HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: PORT0
value: "18630"
volumeMounts:
- name: mysql-secret
mountPath: /resources/mysql
volumes:
- name: mysql-secret
secret:
secretName: mysql-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment