You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/_how-tos/operator-konnect-getstarted-authentication.md
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,15 @@ prereqs:
35
35
36
36
## Create a `KonnectAPIAuthConfiguration` object
37
37
38
-
Depending on your preferences, you can create a `KonnectAPIAuthConfiguration` object with the token specified directly in the spec or as a reference to a Kubernetes Secret. In the CRD, the `serverURL` should be set to the {{site.konnect_short_name}} API url in the region where your account is located.
38
+
Depending on your preferences, you can either:
39
39
40
+
- Create a `KonnectAPIAuthConfiguration` object with the token specified directly in the spec and use RBAC to restrict access to its type.
41
+
- Or you can use a Kubernetes `Secret` (of type `Opaque`) and reference it from the `KonnectAPIAuthConfiguration` object.
42
+
The token has to be specified in `Secret`'s `token` data field.
43
+
44
+
The `serverURL` should be set to the {{site.konnect_short_name}} API url in the region where your account is located.
45
+
46
+
### Using a token in `KonnectAPIAuthConfiguration`
40
47
41
48
<!-- vale off -->
42
49
{% konnect_crd %}
@@ -50,6 +57,32 @@ spec:
50
57
{% endkonnect_crd %}
51
58
<!-- vale on -->
52
59
60
+
### Using a Secret reference
61
+
62
+
```yaml
63
+
apiVersion: v1
64
+
kind: Secret
65
+
metadata:
66
+
name: konnect-api-auth-secret
67
+
namespace: default
68
+
labels:
69
+
konghq.com/secret: konnect
70
+
stringData:
71
+
token: '$KONNECT_TOKEN'
72
+
```
73
+
74
+
<!-- vale off -->
75
+
{% konnect_crd %}
76
+
kind: KonnectAPIAuthConfiguration
77
+
metadata:
78
+
name: konnect-api-auth
79
+
spec:
80
+
type: secretRef
81
+
secretRef:
82
+
name: konnect-api-auth-secret
83
+
serverURL: us.api.konghq.tech
84
+
{% endkonnect_crd %}
85
+
<!-- vale on -->
53
86
54
87
## Validate
55
88
@@ -59,3 +92,21 @@ Run the following command to verify that the authentication configuration was cr
59
92
kubectl get konnectapiauthconfiguration konnect-api-auth -n kong
If you prefer to work with status conditions programmatically, you can also run:
103
+
104
+
```bash
105
+
kubectl get konnectapiauthconfiguration konnect-api-auth -n kong -o jsonpath="{.status.conditions[?(@.type=='APIAuthValid')]}"
106
+
```
107
+
108
+
Which should yield the follow
109
+
110
+
```json
111
+
{"lastTransitionTime":"2025-10-16T11:46:28Z","message":"Token is valid","observedGeneration":1,"reason":"Valid","status":"True","type":"APIAuthValid"}%
0 commit comments