-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional documentation for OAuth 0.15.0 features and how to use Service Accounts #10317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Marko. I left a few suggestions, including removing repeating callout descriptions that we already describe earlier in particular sections to be a bit more streamline.
...in/java/io/strimzi/api/kafka/model/common/authentication/KafkaClientAuthenticationOAuth.java
Outdated
Show resolved
Hide resolved
...in/java/io/strimzi/api/kafka/model/common/authentication/KafkaClientAuthenticationOAuth.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/strimzi/api/kafka/model/kafka/listener/KafkaListenerAuthenticationOAuth.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/strimzi/api/kafka/model/kafka/listener/KafkaListenerAuthenticationOAuth.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/strimzi/api/kafka/model/kafka/listener/KafkaListenerAuthenticationOAuth.java
Outdated
Show resolved
Hide resolved
- secretName: oauth-server-cert | ||
pattern: "*.crt" | ||
---- | ||
<1> Authentication type set to `oauth`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop 1, 2 and 4 callouts as we described the properties in the previous example.
type: oauth # <1> | ||
accessTokenLocation: /var/run/secrets/kubernetes.io/serviceaccount/token # <2> | ||
---- | ||
<1> Authentication type set to `oauth`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove callout 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made additional changes suggested in the review
maxSecondsWithoutReauthentication: 3600 # <8> | ||
customClaimCheck: "@.['kubernetes.io'] && @.['kubernetes.io'].['namespace'] in ['example']" # <9> | ||
---- | ||
<1> Listener type set to `oauth`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
<7> Certificates stored in X.509 format within the specified secrets for TLS connection to the authorization server. | ||
<8> Activates the Kafka re-authentication mechanism that enforces session expiry to the same length of time as the access token. If the specified value is less than the time left for the access token to expire, then the client will have to re-authenticate before the actual token expiry. By default, the session does not expire when the access token expires, and the client does not attempt re-authentication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
2e205dc
to
d9c65ba
Compare
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
d9c65ba
to
eddbc1a
Compare
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Marko. Just a couple of suggestions
...ion/api/io.strimzi.api.kafka.model.common.authentication.KafkaClientAuthenticationOAuth.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/oauth/con-oauth-authentication-client.adoc
Outdated
Show resolved
Hide resolved
Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
tlsTrustedCertificates: | ||
- secretName: oauth-server-cert | ||
pattern: "*.crt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do I get this Secret? I guess it should be using /var/run/secrets/kubernetes.io/serviceaccount/ca.crt? But it is not present in any Secret by default :-/. It might be in the ConfigMap, but not sure if it applies to all environments .
Note that the `tlsTrustedCertificates` is configured to point to a manually created Secret that contains the Kubernetes API server public certificate, which is mounted to the running pods under `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt`. | ||
The Secret can be created using the following command: | ||
[source,shell,subs=attributes+] | ||
---- | ||
kubectl get cm kube-root-ca.crt -o jsonpath="{['data']['ca\.crt']}" > /tmp/ca.crt | ||
kubectl create secret generic oauth-server-cert --from-file=ca.crt=/tmp/ca.crt | ||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, you describe it here -> that should be in a callout of the example above.
We also might need to address it in some better way. Can't we configure the path to the CA directly? If not, we might need add support for loading the public keys from a CM as requested in #10308. (not necessarily blocker for this PR)
I opened #10354 to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within current CRD functionality I didn't find a way to specify this as a path to the file on the disk - basically a passthrough String rather than a Secret, with the expectation that the file is provided to the container by the infrastructure or another operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scholzj I don't think you can add a code block to the content of the callout. Best I can do is refer to the further section that explains it in more detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried something like this? That should work:
<6> Trusted certificates to connect to authorization server. This should point to a manually created Secret that contains the Kubernetes API server public certificate, which is mounted to the running pods under `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt`. You can use the following commend to create the Secret:
+
[source,shell,subs=attributes+]
----
kubectl get cm kube-root-ca.crt -o jsonpath="{['data']['ca\.crt']}" > /tmp/ca.crt
kubectl create secret generic oauth-server-cert --from-file=ca.crt=/tmp/ca.crt
----
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I modified it as you suggested. Looks like the plus does the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
documentation/modules/oauth/con-oauth-authentication-broker.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/oauth/con-oauth-authentication-broker.adoc
Outdated
Show resolved
Hide resolved
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Thanks @mstruk |
Type of change
Description
This PR adds documentation for features introduced in #9970
Checklist
Please go through this checklist and make sure all applicable tasks have been done