Skip to content

Add documentation for KubernetesServiceAccountTokenAuthProvider - #570

Merged
michaeljmarshall merged 3 commits into
apache:mainfrom
michaeljmarshall:function-service-account-tokens
May 12, 2023
Merged

michaeljmarshall merged 3 commits into
apache:mainfrom
michaeljmarshall:function-service-account-tokens

Conversation

@michaeljmarshall

Copy link
Copy Markdown
Member

Documentation

  • doc

This PR adds docs for apache/pulsar#19888.

@michaeljmarshall michaeljmarshall self-assigned this May 9, 2023
@github-actions github-actions Bot added the doc Improvements or additions to documentation label May 9, 2023
@Anonymitaet Anonymitaet added this to the 3.0.0 milestone May 10, 2023

@Anonymitaet Anonymitaet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Have you previewed your changes and ensured everything goes as expected?

If not, please preview your changes locally and attach the screenshots in this PR. In this way, you can get your PR merged more quickly. Thanks!

Comment thread docs/functions-runtime-kubernetes.md Resolved
Comment thread docs/functions-runtime-kubernetes.md Outdated

### Enable Kubernetes Service Account Token Projection for Function Pod Authentication

The `KubernetesServiceAccountTokenAuthProvider` uses [Service Account Token Volume Projections](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#serviceaccount-token-volume-projection) to mount a token into the function's pod. The function worker and broker can verify this token using OpenID Connect. The primary benefit of this integration is that tokens have a short time to live, are managed by Kubernetes, and do not inherit the permission used to create the function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `KubernetesServiceAccountTokenAuthProvider` uses [Service Account Token Volume Projections](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#serviceaccount-token-volume-projection) to mount a token into the function's pod. The function worker and broker can verify this token using OpenID Connect. The primary benefit of this integration is that tokens have a short time to live, are managed by Kubernetes, and do not inherit the permission used to create the function.
The `KubernetesServiceAccountTokenAuthProvider` uses [Service Account Token Volume Projections](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#serviceaccount-token-volume-projection) to mount a token into the function's pod. The function worker and broker can verify this token using OpenID Connect. The primary benefit of this integration is that tokens have a short time to live, are managed by Kubernetes, and do not inherit the permission used to create the function.

Comment thread docs/functions-runtime-kubernetes.md Resolved
Comment thread docs/functions-runtime-kubernetes.md Resolved
Comment thread docs/functions-runtime-kubernetes.md Outdated
brokerClientTrustCertsSecretName: "my-secret-pulsar-broker-client-trust-certs"
```

The function pod deploys with the default Kubernetes Service Account for the target namespace. Because the service account name maps to the `sub` claim on the JWT projected into the pod's filesystem, all pods with the same service account will have the same permission within Pulsar. There is ongoing work to improve this integration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The function pod deploys with the default Kubernetes Service Account for the target namespace. Because the service account name maps to the `sub` claim on the JWT projected into the pod's filesystem, all pods with the same service account will have the same permission within Pulsar. There is ongoing work to improve this integration.
The function pod deploys with the default Kubernetes Service Account for the target namespace. Because the service account name maps to the `sub` claim on the JWT projected into the pod's filesystem, all pods with the same service account will have the same permission within Pulsar. There is ongoing work to improve this integration.

Is Kubernetes Service Account a proper noun?

Comment thread docs/functions-runtime-kubernetes.md Resolved
@michaeljmarshall

Copy link
Copy Markdown
Member Author

Thanks for your review @Anonymitaet. Yes, I rendered the changes locally to make sure they look right.

@michaeljmarshall
michaeljmarshall merged commit f7c11ad into apache:main May 12, 2023
@michaeljmarshall
michaeljmarshall deleted the function-service-account-tokens branch May 12, 2023 22:11
@Technoboy- Technoboy- mentioned this pull request Aug 9, 2023
1 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants