βΈοΈKubernetes
This topic describes how to add and configure P0βs Kubernetes integration so users can use P0 to grant access to a Kubernetes cluster.
Prerequisites
Ensure you have the following before continuing:
Access to an existing Amazon Web Services (AWS), Azure, or Google Cloud service with a Kubernetes cluster.
You must have the cluster-admin
role in the Kubernetes cluster.
The example in this topic demonstrates the process using Google Cloud. The processes for AWS and Azure are similar.
A command-line application such as:
Standard local terminal application that supports Secure Shell (SSH) (e.g., Terminal, Command, PowerShell, or Bash)
Cloud service-specific command-line (CLI) shell (AWS CLI, Azure CLI, or Google Cloud)
kubectl command-line tool
jq JSON processor
Add the Kubernetes Cluster Integration
To add the Kubernetes Cluster integration to the P0 application:
If you have multiple clusters, you can repeat these steps to integrate each.
Open p0.app in your browser and log in.
Select Integrations, navigate to the Resources section, and click Kubernetes.
Click IAM management.
On the IAM management screen, click + Add cluster.
On the IAM management screen, populate the following fields to add the Kubernetes cluster to P0:
The screenshots below show where to get the values in the Google Cloud console.
Cluster identifier: ID of the cluster. Use the ID in the Name field under Cluster basics:
Cluster endpoint: IP address of the cluster in the form of https://<address>:[port]. Navigate to Control Plane Networking and use the Public endpoint:
The port is optional.
Ensure you use https:// and not http://, since HTTP is not supported.
Cluster certification authority: Base64-encoded certificate data that verifies the API serverβs authenticity. Click Show cluster certificate to display a popup where you can copy the certificate:
Ensure you copy the certificate including the -----BEGIN CERTIFICATION-----
and -----END CERTIFICATE-----
statements and paste it into the Cluster certification authority in P0.
Network Connectivity:
Public: Select this if the cluster's API is accessible directly over the Internet.
P0 Proxy: Select this if you are routing through P0βs reverse HTTPS proxy (used for private network setups).
Hosting: Select your cloud provider (e.g. Google Cloud) and enter the cluster details (e.g., GCP Project ID, GKE cluster name, and Location for Google Cloud).
At the bottom of the IAM management screen, click Next.
Open Google Cloud Shell (recommended) or a local shell, and run the following command to log into Google Cloud:
gcloud auth login
This displays Googleβs login browser screen where you enter your login details.
Return to P0βs IAM management screen and copy the kubectl commands provided
Return to your shell, and paste the commands you just copied to enable P0βs admission controller. The output should look similar to the following:
If you chose the Network Connectivity P0 Proxy option , an additional deployment called braekhus is created, which acts as a proxy between P0 and the Kubernetes control plane. For additional information, see the braekhus GitHub repo.
For additional kubectl information, see Install kubectl and configure cluster access.
Return to the P0 IAM management screen, click Next, and copy the cluster token.
In your shell, paste the command copied in the previous step to generate a token.
Copy the resulting token from the shell, return to the P0 IAM management screen, and paste it into the Cluster token input field.
Review the rest of the configuration and click Finish. P0 installs the integration and shows the clusterβs State as
Installed
once complete.To ensure your integration works see Requesting Access.
Congratulations, you have successfully integrated a Kubernetes cluster with P0 and can make access requests to it via P0βs Slack bot.
Last updated