Kubernetes Continous Delivery (kcd), formally known as Container Version Manager (kcd), is a continous integration (CI) and continous delivery (CD) tool designed for Kubernetes cluster/services. Fundamentally, kcd is a custom Kubernetes controller to achieve a declarative configuration approach to continuous deployment.
Deployments that requires CI/CD, can declare KCD resource. kcd, KCD (Kubernetes Continous Delivery) controller starts monitoring for any new changes that should be rolled-out. If so, using the rollout strategy specified in this deployment, the rollout of new version is carried out.
kcd assumes ECR as the container registry. Supporting other registeries is T2D (see).
The tool has 3 main parts:
- KCD Controller
- KCD Syncer: Docker Registry Syncer (supports ECR and Dockerhub)
- KCD Tagger: Docker Registry Tagger (supports ECR, with limited Dockerhub support)
Docker images are on docker.io
Container version controller that manages KCD resources.
kcd run --k8s-config ~/.kube/config --configmap-key=kube-system/kcd
Registry sync service is a polling service that frequently check on registry (AWS ECR and dockerhub only) to see if new version should be rolled out for a given deployment/container.
Sync service default to using AWS ECR as regisrty provider but dockerhub is also supported. Use --provider dockerhub
to use syncer service against dockerhub repo.
Dockerhub note: Dockerhub has very limited support w.r.t. tags via API and also multi-tag support is very limited. see 1, 2, 3 and 4 for more info. When using dockerhub, regisrty syncer monitors a tag (example latest) and when the latest image is change i.e. the digest of the image is changed Syncer picks it up as a candidate deployment and deploys new version.
kcd registry sync \
--namespace=usdev-api \
--provider=ecr \
--kcd=photos-kcd \
--k8s-config ~/.kube/config
A tagging tool that integrates with CI side of things to manage tags on the ECR repositories.
kcd registry tags get \
--repo nearmap/kcd \
--version <SHA>
kcd registry tags remove \
--repo nearmap/kcd \
--tags env-audev-api,env-usdev-api \
--version <SHA>
kcd registry tags remove \
--repo nearmap/kcd \
--tags env-audev-api,env-usdev-api
We plan to support other docker registries as well in future via kcd.
docker build -t nearmap/kcd .
docker run -ti nearmap/kcd <command>
docker-compose down
docker-compose rm -f
docker-compose up --force-recreate --build --abort-on-container-exit
kcdanage is only supported on Kubernetes >= 1.9
kcd can be deployed using:
- Kubectl: yaml specs for Kubenetes configuration is here
- Helm: Helm chart spec is here and helm package is avaialble here
Please see for more info.
- REST API
http://<host>:8081/v1/kcd/workloads
is exposed that return naive html page with tabluar data of all CV managed deployments and current version eg.
[
{
"Namespace":"usdev-api",
"Name":"photosapp",
"Type":"Deployment",
"Container":"photosapp-container",
"Version":"d5dd6d366c1446cc9c0451096deeae3a8f3be48f",
"AvailablePods":2,
"CV":"photos-kcd",
"Tag":"env-usdev-api"
}
]
-
Html format can also be queried using
format
query, supported values are json/html. eg.http://localhost:8081/v1/kcd/workloads?format=html
-
Same can also be generated by (use
--k8s-config
only if running outside cluster:
kcd rd get --k8s-config ~/.kube/config
Use --history
CLI option on kcd to capture release history in configmap.