update detailed kubernetes helm docs

This commit is contained in:
Maidul Islam
2023-05-09 16:41:20 -04:00
parent 420d71d923
commit fb4c811414

View File

@@ -1,16 +1,24 @@
---
title: "Kubernetes via Helm Chart"
description: "Use our Helm chart to Install Infisical on your Kubernetes cluster"
---
<iframe width="100%" height="375" src="https://www.youtube.com/embed/ugJZSCcZaV8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
---
**Prerequisites**
- You have understanding of [Kubernetes](https://kubernetes.io/)
- Installed [Helm package manager](https://helm.sh/) version v3.11.3 or greater
- You have [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/) installed and connected to your kubernetes cluster
<iframe width="100%" height="375" src="https://www.youtube.com/embed/ugJZSCcZaV8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
#### 1. Install Infisical Helm repository
By deploying Infisical on Kubernetes, you can take advantage of its features to ensure that the application is fault-tolerant, highly available, and scalable.
To make the installation process easier and more streamlined, we have created a Helm chart that you can use to install Infisical on Kubernetes.
Helm is a package manager for Kubernetes that simplifies the installation and management of Kubernetes applications.
With our Helm chart, you can easily install Infisical on Kubernetes, configure it to your liking, and scale it up or down as needed.
In the following guide, we'll walk you through the step-by-step process of installing Infisical on Kubernetes using our Helm chart. By the end of this guide, you'll have a fully functional deployment of Infisical running on Kubernetes.
## Install Infisical Helm repository
```bash
helm repo add infisical-helm-charts 'https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts/'
@@ -18,18 +26,137 @@ helm repo add infisical-helm-charts 'https://dl.cloudsmith.io/public/infisical/h
helm repo update
```
#### 2. Install the Helm chart
## Add Helm configurations
Create a values.yaml file to configure various installation settings, such as the docker image tags and environment variables for both the frontend and backend. To explore all configurable properties for your values file, [visit this page](https://github.com/Infisical/infisical/tree/main/helm-charts/infisical).
#### Set image tags
By default, the application will use the latest tag to retrieve the required Docker images, which may be appropriate for most cases. However, it's important to specify a particular version of Infisical during installation to prevent any significant updates from disrupting your deployment.
To determine the appropriate versions to use for the docker images, please follow this [link](https://hub.docker.com/r/infisical/frontend/tags) for the frontend and this [link](https://hub.docker.com/r/infisical/backend/tags) for the backend.
#### Configure environment variables
You can configure environment variable for the frontend and backend in your Helm values file under the property `frontendEnvironmentVariables` and `backendEnvironmentVariables` respectively. View configurable [environment variables](../configuration/envars).
Infisical requires the following backend environment variables to be defined: _`ENCRYPTION_KEY`_, _`JWT_SIGNUP_SECRET`_, _`JWT_REFRESH_SECRET`_, _`JWT_AUTH_SECRET`_, _`JWT_MFA_SECRET`_ and _`JWT_SERVICE_SECRET`_.
However, when the above environment variables are not defined, our Helm chart
will automatically generate these environment variables for you. The generated environment variables will be saved to a Kubernetes secret and will be preserved between upgrades or uninstalls.
#### Routing external traffic
By default, Infisical takes all traffic coming to your external load balancer's IP address and routes them Infisical's services.
Infisical uses Nginx to route external traffic. You can install install Nginx along with Infisical by setting `ingress.enabled` to `true` in the Helm values file.
#### Example helm values
```yaml simple-values-example.yaml
ingress:
nginx:
enabled: false #<-- if you would like to install nginx along with Infisical
frontend:
name: frontend
replicaCount: 2
image:
repository: infisical/frontend
tag: "v0.1.3"
pullPolicy: Always
backend:
replicaCount: 2
image:
repository: infisical/backend
tag: "v0.1.3"
pullPolicy: Always
backendEnvironmentVariables:
HTTPS_ENABLED: true
```
<Accordion title="Full helm values example">
```yaml values.yaml
ingress:
nginx:
enabled: true
frontend:
enabled: true
name: frontend
podAnnotations: {}
deploymentAnnotations: {}
replicaCount: 4
image:
repository: infisical/frontend
tag: "v0.1.3"
pullPolicy: IfNotPresent
kubeSecretRef: null
service:
annotations: {}
type: ClusterIP
nodePort: ""
backend:
enabled: true
name: backend
podAnnotations: {}
deploymentAnnotations: {}
replicaCount: 4
image:
repository: infisical/backend
tag: "v0.1.3"
pullPolicy: IfNotPresent
kubeSecretRef: null
service:
annotations: {}
type: ClusterIP
nodePort: ""
# View all environment variables https://infisical.com/docs/self-hosting/configuration/envars
backendEnvironmentVariables:
MONGO_URL: <>
HTTPS_ENABLED: <>
## Mongo DB persistence
mongodb:
enabled: false
persistence:
enabled: false
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod" # <-- if you are setting up HTTPS
hostName: app.infisical.com ## <- Replace with your own domain
frontend:
path: /
pathType: Prefix
backend:
path: /api
pathType: Prefix
tls: # <-- if you are setting up HTTPS
- secretName: echo-tls
hosts:
- app.infisical.com
```
</Accordion>
<Info>
Infisical assumes that you have configured HTTPS. If you didn't configure HTTPS, set `HTTPS_ENABLED` to `false` in the backend environment variable to avoid frequent logouts.
</Info>
### Install the Helm chart
By default, the helm chart will be installed on your default namespace. If you wish to install the Chart on a different namespace, you may specify
that by adding the `--namespace <namespace-to-install-to>` to your `helm install` command.
```bash
## Installs to default namespace
helm install infisical-helm-charts/infisical --generate-name
helm install infisical-helm-charts/infisical --generate-name --values /path/to/values.yaml
```
#### 3. Access Infisical
#### 4. Access Infisical
Allow 3-5 minutes for the deployment to complete. Once done, you should now be able to access Infisical on the IP address exposed via Ingress on your load balancer. If you are not sure what the IP address is run `kubectl get ingress` to view the external IP address exposing Infisical.
#### Custom configuration
To configure environment variables, database and deployments, you'll need to set the parameters in a `values.yaml` file. To view all available parameters [visit here](https://github.com/Infisical/infisical/tree/main/helm-charts/infisical#parameters)