Forge automatically adds metadata to every Kubernetes resource it
creates. It adds the following Kubernetes
annotations to each resource:
forge.repocontains the git repo from which the resource was deployed. This is computed from the url for the git remote named origin. If the resource was deployed from a checkout that has no remote named origin, or if it was deployed from a non-git directory, then this will be blank.
forge.descriptorcontains the path within the repo
forge.versioncontains the forge computed version of the resource. For resources deployed from a clean git checkout, this will be
It adds the following Kubernetes
labels to each resource:
forge.servicecontains the name of the service as specified in the forge service descriptor (
forge.profilecontains the name of the profile to which the resource belongs.
By using these labels you can easily query and/or cleanup services you've deployed with Forge:
# list all the k8s resources belonging to myservice kubectl get all -o name -l forge.service=myservice # delete the dev profile kubectl delete all -l forge.service=myservice -l forge.profile=dev
You can also use the
forge list command to show a human readable
summary of the Forge resources deployed into a cluster, e.g.:
$ forge list myservice[default]: https://github.com/myorg/myservice.git | service.yaml | 729b401e7c515144bbaf0962b6a207f591f291ca.git deployment default.myservice-default: Deployment has minimum availability. service default.myservice-default: READY(192.168.187.194:80, 192.168.187.195:80, 192.168.187.196:80) myservice[foo]: https://github.com/myorg/myservice.git | service.yaml | 62334241058f806e1fc26a246f10e78ec1d7abbb.git deployment default.myservice-foo: Deployment has minimum availability. service default.myservice-foo: READY(192.168.187.197:80, 192.168.187.198:80, 192.168.187.199:80)