Skip to content

Instantly share code, notes, and snippets.

@ZeroDeth
Created June 11, 2022 22:22
Show Gist options
  • Save ZeroDeth/6d622aad78f3b91127ababb8cfc40c46 to your computer and use it in GitHub Desktop.
Save ZeroDeth/6d622aad78f3b91127ababb8cfc40c46 to your computer and use it in GitHub Desktop.
spin up a pod and connect from the pod itself
apiVersion: v1
kind: Pod
metadata:
name: mysql-rds-connection-test
namespace: default
spec:
containers:
- name: mysqlconn
image: mysql:latest
command: ['mysql']
args: ['-c', 'show databases;']
env:
- name: MYSQL_HOST
valueFrom:
secretKeyRef:
name: production-rds-conn-string
key: endpoint
- name: MYSQL_PWD
valueFrom:
secretKeyRef:
name: production-rds-conn-string
key: password
- name: USER
valueFrom:
secretKeyRef:
name: production-rds-conn-string
key: username
- name: MYSQL_TCP_PORT
valueFrom:
secretKeyRef:
name: production-rds-conn-string
key: port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment