Messing around with k8s.
Check the deploy folder for things to play around with
./deploy/build-image.shcreates an image on dockerhub of this app for k8s to pull down and use. If you're forking this, you'll need to log in to dockerhub and change the username parts.- Or figure out how to get k8s be able to use a local registry. I couldn't
./deploy/web.yamlcontains the desired state for our cluster../deploy/deploy.shwill send the yaml to k8s for it to set it all up- The above will set things up, but it will be in the private docker network. To expose it to localhost, you'll need to run
./deploy/forward-ports.sh
Some of this could be wrong, just going to update as I go.
A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers.
Don't create them directly, create them as part of a deployment.
Describe the shape of your deployment in terms of what kinds of software you want running and how many of them. K8s will maintain the state for you.
If you change the deployment (say, change the number of replicas) and then re-apply your yaml, k8s will sort it out. It won't kill everything and start again either, it'll just add new pods.
Similarly, if you do kubectl get pods and then kubectl delete pod XXXX, the pod will get deleted, but the deployment will kick in and create a new one for you.
Used to expose an application (a set of pods) as a service. Load balances for you.
- Able to run acceptance, unit and integration tests locally and without fuss. Should work out of the box.
./build.sh && git pushshould be safe to go to prod. Emphasis on short cycle times, small-batch work to get feedback loops and reduce risk. - Package up in to a small Docker image for deployment
- As testable as reasonably possible. High confidence the system works without manual checks
- Just describe in terms of the domain. Easier starting point for dev once you've had a discussion with stakeholders.
- Decoupled from implementation detail
- Describe "from the top" want you want in a test without worrying about how
- Be able to run easily locally against
- A docker container version, with real dependencies (e.g docker compose dependencies)
- Against a real deployed environment to check its deployed and other infrastrcture concerns are working correctly (terraform, config, secrets, etc etc)
- Bonus, as a unit test
TODO: Do a vid where I add a new bit of functionality using the approach. Make it completely new, e.g the birthday greeting thing