This example demonstrates how to add kubernetes recommended labels to kpt Deployment packages
by running the [set-starndard-labels] function.
Get the example package by running the following commands:
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/set-stanrdard-labels-deploymentWe use the following Kptfile to configure the function.
apiVersion: kpt.dev/v1
kind: Kptfile
metadata:
name: frontend
annotations:
config.kubernetes.io/local-config: "true"Invoke the function by running the following commands:
$ kpt fn render set-stanrdard-labels-deploymentCheck the deployment has label app.kubernetes.io/instance: frontend-dev added, and the
existing upstream label app.kubernetes.io/name: frontend is preserved.