|
| 1 | +{{ template "chart.header" . }} |
| 2 | +{{ template "chart.description" . }} |
| 3 | + |
| 4 | +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} |
| 5 | + |
| 6 | +## Additional Information |
| 7 | + |
| 8 | +The Venafi Kubernetes Agent connects your Kubernetes or OpenShift cluster to the Venafi Control Plane. |
| 9 | +You will require a Venafi Control Plane account to connect your cluster. |
| 10 | +If you do not have you, you can sign up for a free trial now at: |
| 11 | +- https://venafi.com/try-venafi/tls-protect/ |
| 12 | + |
| 13 | +Note that there are EU and US Venafi Control Plane options. |
| 14 | +Upon signing up you will be redirected to one of either of the following login URLs: |
| 15 | +- https://ui.venafi.cloud/ (US) |
| 16 | +- https://ui.venafi.eu/ (EU) |
| 17 | + |
| 18 | +## Installation: |
| 19 | + |
| 20 | +Using chart installation, there are two credentials required. |
| 21 | + |
| 22 | +1) A registry credential to allow helm to pull the chart from our private OCI registry. |
| 23 | +2) A service account key pair used by the agent to authenticate to the Venafi Control Plane. |
| 24 | + |
| 25 | +### 1) Setup registry credentials |
| 26 | + |
| 27 | +The helm chart is an OCI chart artifact hosted on both EU and US registries: |
| 28 | + |
| 29 | +- `oci://eu.gcr.io/jetstack-secure-enterprise/charts/venafi-kubernetes-agent` |
| 30 | +- `oci://us.gcr.io/jetstack-secure-enterprise/charts/venafi-kubernetes-agent` |
| 31 | + |
| 32 | +More detailed instructions on how to access our registry are available in [this guide](https://platform.jetstack.io/documentation/installation/enterprise-registry). |
| 33 | + |
| 34 | +For chart installation, run the following to set a registry configuration |
| 35 | +file, so `helm` can authenticate to our private OCI registry: |
| 36 | + |
| 37 | +```shell |
| 38 | +export VENAFI_DOCKER_CONFIG_PATH="$(pwd)" |
| 39 | +export VENAFI_DOCKER_CONFIG_FILE="${TLSPK_DOCKER_CONFIG_PATH}/config.json" |
| 40 | +jsctl registry auth output --format=dockerconfig > "${VENAFI_DOCKER_CONFIG_FILE}" |
| 41 | +``` |
| 42 | + |
| 43 | +To validate you registry credentials are working with `helm`, we can use it to |
| 44 | +show us the full list of values available to configure the chart: |
| 45 | + |
| 46 | +```shell |
| 47 | +export VENAFI_REGISTRY="eu.gcr.io/jetstack-secure-enterprise" |
| 48 | +helm show values oci://${VENAFI_REGISTRY}/charts/venafi-kubernetes-agent \ |
| 49 | + --registry-config "${VENAFI_DOCKER_CONFIG_FILE}" |
| 50 | +``` |
| 51 | + |
| 52 | +**Note**: Feel free to alter the registry to the US equivalent if that is closer to you. |
| 53 | +For example: `export VENAFI_REGISTRY="us.gcr.io/jetstack-secure-enterprise"` |
| 54 | + |
| 55 | +### 2) Creating Venafi Service Account: |
| 56 | + |
| 57 | +First we need to create an OpenSSL key pair and save the private key securely. |
| 58 | +The private key is used by the agent and you should have a unique key for each agent you connect to the Venafi Control Plane. |
| 59 | +The public key will be added to the Venafi Control Plane as the service account credential and assigned to the appropriate team for ownership. |
| 60 | + |
| 61 | +```shell |
| 62 | +export VENAFI_NAMESPACE="venafi" VENAFI_SERVICE_ACCOUNT="example-cluster" |
| 63 | +openssl genrsa -out ${VENAFI_SERVICE_ACCOUNT}.pem |
| 64 | +openssl rsa -in ${VENAFI_SERVICE_ACCOUNT}.pem -pubout --out ${VENAFI_SERVICE_ACCOUNT}.pub |
| 65 | +``` |
| 66 | + |
| 67 | +Now that you have both the private and public key we now need to use the Venafi Control Plane to create a service account. |
| 68 | + |
| 69 | +- Navigate to the [service accounts page](https://ui.venafi.cloud/service-accounts/) and select "New" |
| 70 | +- Add a unique name matching the variable we used, eg: "example-cluster" |
| 71 | +- Assign a team that owns this credential |
| 72 | +- The scope should be "Kubernetes Discovery" only. |
| 73 | +- Set the validity period of your pubic key up to a maximum of 365 days. |
| 74 | +- Now paste in the **public key** from the pair you generated. |
| 75 | + |
| 76 | +Once created, you will be returned to the service accounts list. |
| 77 | +Find your newest entry matching the name you entered, and copy the "Client ID" column. |
| 78 | + |
| 79 | +### 3) Deploying the chart: |
| 80 | + |
| 81 | +Now we have the service account, let us prepare a namespace with the relevant private key needed at runtime. |
| 82 | + |
| 83 | +```shell |
| 84 | +export VENAFI_CLIENT_ID="<PASTE YOURS HERE>" |
| 85 | +kubectl create namespace ${VENAFI_NAMESPACE} |
| 86 | +kubectl create secret generic agent-credentials -n ${VENAFI_NAMESPACE} \ |
| 87 | + --from-file=privatekey.pem=${VENAFI_SERVICE_ACCOUNT}.pem |
| 88 | +``` |
| 89 | + |
| 90 | +Install the chart by setting the `config.clientId` field: |
| 91 | + |
| 92 | +```shell |
| 93 | +helm upgrade --install venafi-kubernetes-agent deploy/charts/venafi-kubernetes-agent \ |
| 94 | + --namespace ${VENAFI_NAMESPACE} \ |
| 95 | + --set config.clientId="${VENAFI_CLIENT_ID}" |
| 96 | +``` |
| 97 | + |
| 98 | +Optionally if you need to change the backend to the EU Venafi Control Plane you can use: |
| 99 | + |
| 100 | +```shell |
| 101 | +export VENAFI_SERVER_URL="https://api.venafi.eu/" |
| 102 | +helm upgrade --install venafi-kubernetes-agent deploy/charts/venafi-kubernetes-agent \ |
| 103 | + --namespace ${VENAFI_NAMESPACE} \ |
| 104 | + --set config.clientId="${VENAFI_CLIENT_ID}" \ |
| 105 | + --set config.server="${VENAFI_SERVER_URL}" |
| 106 | +``` |
| 107 | + |
| 108 | +### 4) Add Cluster in Venafi Control Plane |
| 109 | + |
| 110 | +- Go to "Installations" -> "Kubernetes Clusters" [here](https://ui.venafi.cloud/clusters-inventory) and click "Connect". **Note** you may need to click [here](https://ui.venafi.eu/clusters-inventory) for the EU backend. |
| 111 | +- On step 1 select "Continue". |
| 112 | +- On step 2 select "Advanced Connection". |
| 113 | +- On step 3 select "Continue" to skip. |
| 114 | +- On step 4, fill in the details as needed: |
| 115 | + - "Name" should match your service account name from before, e.g. "example-cluster". |
| 116 | + - Under "Service Account" click that drop down and select the previously created service account. |
| 117 | + - Then check the "The connection command has completed." box and select "continue". |
| 118 | +- On step 5, either wait for validation or select "Finish" to go back to the cluster list. |
| 119 | + |
| 120 | +### 5) Deployment Verification |
| 121 | + |
| 122 | +Check the agent logs to ensure you see a similar entry to the following: |
| 123 | + |
| 124 | +```console |
| 125 | +2023/10/24 12:10:03 Running Agent... |
| 126 | +2023/10/24 12:10:03 Posting data to: https://api.venafi.cloud/ |
| 127 | +2023/10/24 12:10:04 Data sent successfully. |
| 128 | +``` |
| 129 | + |
| 130 | +You can do this with the following command: |
| 131 | + |
| 132 | +```shell |
| 133 | +kubectl logs -n ${VENAFI_NAMESPACE} $(kubectl get pod -n ${VENAFI_NAMESPACE} -l app.kubernetes.io/instance={{ .Release.Name }} -o jsonpath='{.items[0].metadata.name}') |
| 134 | +``` |
| 135 | + |
| 136 | +You can also check in the Venafi Control Plane to see when the "Last Check In" was for your cluster. |
| 137 | + |
| 138 | +{{ template "chart.requirementsSection" . }} |
| 139 | + |
| 140 | +{{ template "chart.valuesSection" . }} |
| 141 | + |
| 142 | +{{ template "helm-docs.versionFooter" . }} |
0 commit comments