diff --git a/app/_data/docs_nav_kgo_1.4.x.yml b/app/_data/docs_nav_kgo_1.4.x.yml index 9267551be199..82e9efacbfc9 100644 --- a/app/_data/docs_nav_kgo_1.4.x.yml +++ b/app/_data/docs_nav_kgo_1.4.x.yml @@ -115,6 +115,8 @@ items: url: /guides/konnect-entities/key-and-keyset/ - text: Upstream and Targets url: /guides/konnect-entities/upstream-and-target/ + - text: Tagging and Labeling + url: /guides/konnect-entities/tagging-and-labeling/ - title: Reference icon: /assets/images/icons/icn-magnifying-glass.svg items: diff --git a/app/_src/gateway-operator/guides/konnect-entities/consumer-and-consumergroup.md b/app/_src/gateway-operator/guides/konnect-entities/consumer-and-consumergroup.md index c7522eb94cb4..66765b8f8a5e 100644 --- a/app/_src/gateway-operator/guides/konnect-entities/consumer-and-consumergroup.md +++ b/app/_src/gateway-operator/guides/konnect-entities/consumer-and-consumergroup.md @@ -60,7 +60,7 @@ At this point, you should see the Consumer in the Gateway Manager UI. ## Associate the Consumer with Credentials Consumers can have credentials associated with them. You can create one of the supported credential types. Please refer -to the below CRs documentation links to learn all the available fields for each credential type. +to the below Custom Resource's documentation links to learn all the available fields for each credential type. - [KongCredentialBasicAuth](/gateway-operator/{{ page.release }}/reference/custom-resources/#kongcredentialbasicauth) - [KongCredentialKeyAuth](/gateway-operator/{{ page.release }}/reference/custom-resources/#kongcredentialkeyauth) diff --git a/app/_src/gateway-operator/guides/konnect-entities/tagging-and-labeling.md b/app/_src/gateway-operator/guides/konnect-entities/tagging-and-labeling.md new file mode 100644 index 000000000000..ef8b38838ab9 --- /dev/null +++ b/app/_src/gateway-operator/guides/konnect-entities/tagging-and-labeling.md @@ -0,0 +1,95 @@ +--- +title: Tagging and Labeling +--- + +Tags and labels are a way to organize and categorize your resources. In this guide, you'll learn how to annotate your +Konnect entities managed by {{site.kgo_product_name}} with tags and labels (depending on particular entity's support for +those). + +{% include md/kgo/konnect-entities-prerequisites.md disable_accordian=false version=page.version release=page.release %} + +## Labeling + +Labels are key-value pairs that you can attach to objects. As of now, the only Konnect entity that supports labeling is +the [KonnectGatewayControlPlane](/gateway-operator/guides/konnect-entities/gatewaycontrolplane). You can add labels to +the `KonnectGatewayControlPlane` object by specifying the `labels` field in the `spec` section. + +```yaml +echo ' +kind: KonnectGatewayControlPlane +apiVersion: konnect.konghq.com/v1alpha1 +metadata: + name: gateway-control-plane + namespace: default +spec: + labels: # Arbitrary key-value pairs + environment: production + team: devops + name: gateway-control-plane + konnect: + authRef: + name: konnect-api-auth # Reference to the KonnectAPIAuthConfiguration object + ' | kubectl apply -f - +``` + +You can verify the Control Plane was reconciled successfully by checking its status. + +```shell +kubectl get konnectgatewaycontrolplanes.konnect.konghq.com gateway-control-plane +``` + +The output should look similar to this: + +```console +NAME PROGRAMMED ID ORGID +gateway-control-plane True +``` + +At this point, labels should be visible in the Gateway Manager UI. + +## Tagging + +Tags are values that you can attach to objects. All the Konnect entities that can be attached to a +`KonnectGatewayControlPlane` object support tagging. You can add tags to those entities by specifying the `tags` field +in their `spec` section. + +For example, to add tags to a `KongService` object, you can apply the following YAML manifest: + +```yaml +echo ' +kind: KongService +apiVersion: configuration.konghq.com/v1alpha1 +metadata: + name: service + namespace: default +spec: + tags: # Arbitrary list of strings + - production + - devops + name: service + host: example.com + controlPlaneRef: + type: konnectNamespacedRef + konnectNamespacedRef: + name: gateway-control-plane + ' | kubectl apply -f - +``` + +You can verify the `KongService` was reconciled successfully by checking its `Programmed` condition. + +```shell +kubectl get kongservice service -o=jsonpath='{.status.conditions}' | jq '.[] | select(.type == "Programmed")' +``` + +The output should look similar to this: + +```console +{ + "observedGeneration": 1, + "reason": "Programmed", + "status": "True", + "type": "Programmed" +} +``` + +At this point, tags should be visible in the Gateway Manager UI.