Skip to content

Instantly share code, notes, and snippets.

@HarshadRanganathan
Last active December 1, 2021 23:01
Show Gist options
  • Save HarshadRanganathan/3e015b0ecd53546d97048f793ea6be58 to your computer and use it in GitHub Desktop.
Save HarshadRanganathan/3e015b0ecd53546d97048f793ea6be58 to your computer and use it in GitHub Desktop.
Kubernetes jump pod for MySQL

[1] Add this Dockerfile

FROM python:alpine

ARG CLI_VERSION=1.18.188

RUN apk -uv add --no-cache groff jq less mysql-client && \
    pip install --no-cache-dir awscli==$CLI_VERSION

CMD sh

Above installs following tools:

  • Python
  • jq
  • MYSQL client
  • AWS CLI

[2] Build the image

docker build -t platform/mysql .

[3] Push the image to an artifactory of your choice

[4] Run the pod with the image

kubectl run mysql --rm -i  --namespace=platform --image <artifactory_url>/mysql:latest --serviceaccount mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment