Kurrent auto-updates your Kubernetes manifests with the latest image tags from your container registry. Developed in .NET, it supports polling and webhooks for ACR and DockerHub.
- Test Endpoints: Add in test endpoints to test your configuration without having to push to your registry.
- Initial Config Validation: Ensure Kurrent is configured correctly and can connect to your repositories successfully
- Pull Requests: Have Kurrent push to a new branch in your repo and open a PR to the selected branch in config.
- Web UI: Configure Kurrent through a web interface.
Kurrent is a Kubernetes service that monitors your container registry for new image tags. When a new tag is detected, Kurrent will update your Kubernetes manifests to use the latest tag. This ensures that your Kubernetes deployments are always pointing to the latest image tags. It currently supports polling and webhooks for ACR and DockerHub. All of this can be setup in a few simple steps.
To get Kurrent working you will need to pass it a configuration file. You can find an example ConfigMap here.
Here is the appsettings.k8s.json configuration explained:
-
Pollers: Configurations for periodic checks.
EventName: Unique poller name.Type: Registry type (acrfor Azure Container Registry,dockerfor DockerHub).IntervalInSeconds: Polling frequency.Url: Container registry URL.Images: Images to monitor.Username&Password: Registry credentials.
-
Webhooks: Set up to listen for registry push events.
EventName: Unique webhook name.Path: Endpoint path.Type: Registry sending the webhook.
-
Repositories: Storage details for Kubernetes manifests.
Name: Repository name.Url: Git URL.Username&Password: Repo access credentials.FileExtensions: Target file types, e.g.,.yaml.EventSubscriptions: Events that this repository should listen to (any event name that you have set above)Branch: The branch to write changes to
-
Notifiers: Storage details for Kubernetes manifests.
Name: Notifier name.Type: Notifier type (slackfor Slack). Slack is that is supported right now.Token: Token to make calls to your serviceChannel: Channel to send notifications to e.g. 'k8s-deployments'EventSubscriptions: Events that this notifier should listen to (any event name that you have set above)
To auto-update images in your Kubernetes manifests:
- Add the Kurrent comment to images you want to auto-update in your Kubernetes manifest.
- When a new image is received by Kurrent, it will access the subscribed repos and update manifests with the newest tag.
image: <IMAGE>:<TAG> # kurrent update; regex: <REGEX>;The below example will auto-update the image foo-api:1.0.1-development when a new tag matching the regex is detected.
image: foo.azurecr.io/foo-api:1.0.1-development # kurrent update; regex: .*dev*.;-
Configuration:
- Create a
ConfigMapwith aappsettings.k8s.jsonkey and your config as JSON. Example ConfigMap.
- Create a
-
Ingress Setup:
- Deploy an ingress if you're using webhooks. Example Ingress.
-
Kustomization:
- Create a
kustomization.yamlfor Kurrent. Be sure to reference the base and your ConfigMap Example Kustomization.
resources: - https://github.com/TommyBeaton/Kurrent/kustomize/base - config.yaml
- Create a
-
Apply Kustomization:
kubectl apply -k <path/to/kustomization/file>
-
Check Kurrent:
- Access via
http://kurrent.yourdomain.com/healthor use port-forward:kubectl port-forward svc/kurrent-service 8080:80
Kurrent doesnt need to be deployed to Kubernetes. It can be ran from anywhere that is convenient for your use case. Just pull the image from Docker Hub or build your own!
- Create
appsettings.Local.jsoninsrc. - Use
appsettings.example.jsonas a reference. Link. - Execute
dotnet run --environment Localinsrc.
docker build -t <image-name> -f src/Dockerfile .You can also pull different versions from Docker Hub.
Join me on LinkedIn.