Read Only Kubeconfig
Guide to set up a new Service Account with Read only access to a K8s cluster
Kubernetes import is in private beta at the moment
if you are interested in testing this out, please reach out to the support team, and we will enable it on your account
To connect to your Kubernetes clusters you will need to create or obtain a copy of your kubeconfig configuration and import it into Hava.
We recommend creating a new service account that has read only access to the resources in the kubernetes cluster, and use that to provide access to Hava.
Supported kubeconfig authentication methods
Hava does not support authentication methods that require access to external files or programs, such as use of the client-certificate
or cmd-path
values in your users section, or the certificate-authority
value in the clusters section.
If you make use of certificate files you can convert them to the corresponding -data fields.
Unfortunately there is no replacement for cmd-path
and cmd-arg
values.
Creating a read-only kubeconfig access file
The best practice when creating a kubeconfig file for Hava is to create a new read-only role that can be attached to a service account for Hava to access. We'll also create it in a separate 'hava' namespace so that removing access is as simple as removing the namespace.
Creating the role and service account
We'll use the following manifest to create the role and service account in your current context using kubectl, so make sure you have the correct context selected by running kubectl config current-context
.
Create the following file as hava-role-manifest.yml
:
Now run kubectl apply -f hava-role-manifest.yml
to create your role and service account.
This will allow Hava access to read data from all resource types across all namespaces. If this is still too open you can lock it down further by limiting it by namespace or resource types - Hava will ignore anything it doesn't have access to.
Use the service account details to create your kubeconfig
You can now run the following shell script to output a kubeconfig configuration file to allow Hava to access and import your cluster:
This script depends onkubectl
, jq
, and base64
It has been tested on MacOS, jq
and base64
might require slight modifications to the commands on linux and Windows
After running this you can now upload the hava-kubeconfig.yml
file into Hava and click 'Import'.
Hava will connect to your environment and pull back the resources and relationships between them and build a complete visualisation of your environment.
Last updated