Skip to main content
In this guide, we will enable the Talos feature to access the Talos API from within Kubernetes.

Enable the feature

Edit the machine configuration to enable the feature, specifying the Kubernetes namespaces from which Talos API can be accessed and the allowed Talos API roles.
Configure the kubernetesTalosAPIAccess like the following:

Inject Talos ServiceAccount into manifests

Create the following manifest file deployment.yaml: Note: make sure that you replace the IP 172.20.0.2 with a valid Talos node IP. Use talosctl inject serviceaccount command to inject the Talos ServiceAccount into the manifest.
Inspect the generated manifest: As you can notice, your deployment manifest is now injected with the Talos ServiceAccount.

Test API access

Apply the new manifest into default namespace:
Follow the logs of the pods belonging to the deployment:
You’ll see a repeating output similar to the following:
This means that the pod can talk to Talos API of node 172.20.0.2 successfully.