# Converting certificate files to certificate data fields

{% hint style="warning" %}
Kubernetes import is in private beta at the moment&#x20;

if you are interested in testing this out, please reach out to the support team, and we will enable it on your account
{% endhint %}

Hava does not support accessing external files within your kubeconfig for authentication using client certificates. Luckily, it's a simple process to convert these to data fields that can be entered directly into your configuration.

The fields that will need to be converted are:

* `certificate-authority` to become `certificate-authority-data`
* `client-certificate` to become `client-certificate-data`
* `client-key` to become `client-key-data`

### Finding and converting the files

For this example we have the following kubeconfig using local certificates files.

```
apiVersion: v1
kind: Config
preferences: {}
clusters:
  - cluster:
      certificate-authority: /Users/example/ca.crt
      server: https://kubeserver:8443
    name: kube
contexts:
  - context:
      cluster: kube
      user: kube
    name: kube
users:
  - name: kube
    user:
      client-certificate: /Users/example/client.crt
      client-key: /Users/example/client.key
```

For each of these external files we need to convert them to base64 and then update the configuration with the base64 string.&#x20;

Here's an example using the certificate authority file:

#### Linux and MacOS

`cat /Users/example/ca.crt | base64`

#### Windows

`certutil -f -encode "c:/Users/example/ca.crt" "output-file"`

### Update the config to use the new values

Once you've got the base64 data for all 3 values you can update the config file.

```
apiVersion: v1
kind: Config
preferences: {}
clusters:
  - cluster:
      certificate-authority-data: <base64 ca.crt>
      server: https://kubeserver:8443
    name: kube
contexts:
  - context:
      cluster: kube
      user: kube
    name: kube
users:
  - name: kube
    user:
      client-certificate-data: <base64 client.crt>
      client-key-data: <base64 client.key>
```

Your configuration is now ready to import into Hava to connect and display your Kubernetes clusters!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hava.io/importing/kubernetes/getting-started-with-kubernetes/converting-certificate-files-to-certificate-data-fields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
