-
Notifications
You must be signed in to change notification settings - Fork 9
Kubernetes Setup
I've started a Kubernetes (k8s) setup in the 'k8sify' fork, with the config files in the k8s_conf directory. I'm using KinD (Kubernetes in Docker) so the cluster setup may differ but once running, kubectl should behave the same across any provider.
Welcome to Kubernetes!
Some light reading: https://kubernetes.io/docs/concepts/
FYI, The Kubernetes and Docker extensions for VSCode make all of this easier.
Run the kind_w_reg.sh
script to create a Kind cluster with a local Docker image registry/storage. [1]
N.B: You will want to stop the registry container when running locally to prevent a conflict on port 5000
Add the following tags to the appropriate existing Docker images:
localhost:5000/postgres:11.3-alpine
localhost:5000/src-client:latest
localhost:5000/src-server:latest
e.g., docker tag src_client localhost:5000/src-client:latest
(the VSCode Docker extension is your friend)
docker push <tag>
e.g., docker push localhost:5000/src-server:latest
(Or use Docker extension)
From the src directory, kubectl -f k8s_conf
will execute ('apply') all the yaml files in the k8s_conf directory. You can specify an individual file, too.
Wait a minute or so and then run kubectl get pods
to see the status of your running pods. You should see three with status RUNNING. Though they are happily running, they can only be accessed from inside the cluster.
kubectl port-forward service/client 3000:3000
will make the PDP client available at localhost:3000
I've surely missed a step or two along the way so be sure to let me know if you run into trouble.
[1] Registry setup: https://docs.docker.com/registry/deploying/
(This was originally at https://github.com/c-simpson/paws-data-pipeline/wiki/Kubernetes-setup)