Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/the-nix-way/real-world-devops-with-nix
An example project for building containers with Nix and deploying them to Kubernetes
https://github.com/the-nix-way/real-world-devops-with-nix
devops docker go golang kubernetes nix reproducibility terraform
Last synced: about 23 hours ago
JSON representation
An example project for building containers with Nix and deploying them to Kubernetes
- Host: GitHub
- URL: https://github.com/the-nix-way/real-world-devops-with-nix
- Owner: the-nix-way
- Created: 2022-08-23T10:39:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T08:20:37.000Z (21 days ago)
- Last Synced: 2024-10-29T09:41:32.370Z (21 days ago)
- Topics: devops, docker, go, golang, kubernetes, nix, reproducibility, terraform
- Language: Nix
- Homepage:
- Size: 31.3 KB
- Stars: 69
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Real world DevOps with Nix
This example project is meant to demonstrate the power of [Nix] in a DevOps
context. You can see this repo in action in my talk [Real world DevOps with
Nix][video], which was part of the [Summer of Nix][son] video series in 2022.## Moving parts
* A very simple "TODOs" web service written in [Go] in
[`cmd/todos/main.go`](./cmd/todos/main.go). This service is built to be
deployed on a [Kubernetes] cluster running on [Digital Ocean][do].
* That cluster is stood up using a [Terraform] configuration in
[`main.tf`](./main.tf) and [`terraform.tfvars`](./terraform.tfvars).
* The Kubernetes configuration in [`k8s/deployment.yaml`](./k8s/deployment.yaml)
defines the Kubernetes [Deployment] for the service.
* The [GitHub Actions][actions] pipeline
* Builds a [Docker] image for the TODOs service using [Nix]
* Pushes the image to [Docker Hub][hub]
* Updates the existing [Deployment] to use the new image
* Restarts the [Deployment] to complete the upgradeSome other things to note:
* The Kubernetes configuration for the Digital Ocean cluster, named
`real-world-devops-with-nix`, is provided under the `KUBE_CONFIG` environment
variable in the CI pipeline. To get that configuration as a base64 string:```shell
doctl kubernetes cluster kubeconfig show real-world-devops-with-nix | base64
```[actions]: https://github.com/features/actions
[deployment]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment
[docker]: https://docker.com
[do]: https://digitalocean.com
[go]: https://golang.org
[hub]: https://hub.docker.com
[kubernetes]: https://kubernetes.io
[nix]: https://nixos.org
[son]: https://www.youtube.com/playlist?list=PLt4-_lkyRrOMWyp5G-m_d1wtTcbBaOxZk
[terraform]: https://terraform.io
[video]: https://www.youtube.com/watch?v=LjyQ7baj-KM&t=2809s