diff --git a/.github/workflows/helm_chart_release.yml b/.github/workflows/helm_chart_release.yml new file mode 100644 index 000000000..8f47da69d --- /dev/null +++ b/.github/workflows/helm_chart_release.yml @@ -0,0 +1,22 @@ +name: Release Helm Charts + +on: [workflow_dispatch] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.0 + - name: Install python + uses: actions/setup-python@v4 + - name: Install Cloudsmith CLI + run: pip install --upgrade cloudsmith-cli + - name: Build and push helm package to Cloudsmith + run: cd helm-charts && sh upload-to-cloudsmith.sh + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index aea82a9d2..695b0ea24 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -1,4 +1,4 @@ -name: goreleaser +name: Go releaser on: push: diff --git a/cli/packages/cmd/root.go b/cli/packages/cmd/root.go index 826ccb4df..42d85e5b2 100644 --- a/cli/packages/cmd/root.go +++ b/cli/packages/cmd/root.go @@ -15,7 +15,7 @@ var rootCmd = &cobra.Command{ Short: "Infisical CLI is used to inject environment variables into any process", Long: `Infisical is a simple, end-to-end encrypted service that enables teams to sync and manage their environment variables across their development life cycle.`, CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true}, - Version: "0.1.5", + Version: "0.1.6", } // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/docs/mint.json b/docs/mint.json index 4ff49b5b9..1d5246680 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -102,8 +102,11 @@ "pages": [ "self-hosting/overview", { - "group": "Deployments", - "pages": ["self-hosting/deployments/linux"] + "group": "Deployments options", + "pages": [ + "self-hosting/deployments/linux", + "self-hosting/deployments/kubernetes" + ] }, { "group": "Configuration", diff --git a/docs/self-hosting/deployments/kubernetes.mdx b/docs/self-hosting/deployments/kubernetes.mdx new file mode 100644 index 000000000..8ed2c0e05 --- /dev/null +++ b/docs/self-hosting/deployments/kubernetes.mdx @@ -0,0 +1,54 @@ +--- +title: "Kubernetes" +description: "Deploy with Kubernetes" +--- + + +Self-host vs. Infisical Cloud + +Self-hosting Infisical means managing the service yourself, taking care of upgrades, scaling, security, etc. + +If you're less technical and looking for a hands-free experience with minimal overhead then we recommend Infisical Cloud. + + + +**Prerequisites** +- You have understanding of [Kubernetes](https://kubernetes.io/) +- You have understanding of [Helm package manager](https://helm.sh/) +- You have [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/) installed and connected to your kubernetes cluster + + +#### 1. Fill our environment variables + +Before you can deploy the Helm chart, you must fill out the required environment variables. To do so, please either download or copy the +contents of [this file](https://raw.githubusercontent.com/Infisical/infisical/main/helm-charts/infisical/values.yaml) to a `.yaml` file. +_Refer to the available [environment variables](../../self-hosting/configuration/envars)_ + +Once you have a local copy of the values file, fill our the required environment variables and save the file. + + +#### 2. Install Infisical Helm repository + +```bash +helm repo add infisical-helm-charts 'https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts/' + +helm repo update +``` + +#### 3. 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 ` to your `helm install` command. + +```bash +## Installs to default namespace +helm install infisical-helm-charts/infisical --values +``` + + +If you have not filled out all of the required environment variables, you will see an error message prompting you to +do so. + + +4. Your Infisical installation is complete and should be running on the host name you specified in Ingress in `values.yaml`. +Note: Please allow an additional time (2 minutes) for the frontend pods to be fully ready. \ No newline at end of file diff --git a/docs/self-hosting/overview.mdx b/docs/self-hosting/overview.mdx index 8f2df5c37..b0729637c 100644 --- a/docs/self-hosting/overview.mdx +++ b/docs/self-hosting/overview.mdx @@ -9,17 +9,22 @@ Self-hosting Infisical means managing the service yourself, taking care of upgra If you're less technical and looking for a hands-free experience with minimal overhead then we recommend Infisical Cloud. -Infisical Cloud also comes with some extra features unavailabe in the self-hosted edition. You can find more information about Infisical Cloud's offering on the pricing page. +Infisical Cloud also comes with some extra features unavailable in the self-hosted edition. You can find more information about Infisical Cloud's offering on the pricing page. ## Deployment options -Infisical can be deployed on a Linux VM with docker-compose. We're rolling out more specific deployment options for DigitalOcean, AWS, GCP, and Azure soon. +Infisical can be deployed on a Linux VM with docker-compose and Kubernetes. We're rolling out more specific deployment options for DigitalOcean, AWS, GCP, and Azure soon. -Options: - -- [Linux VM](/self-hosting/deployments/linux) + + + Deploy to any Linux with Docker + + + Deploy to your Kubernetes cluster + + ## Telemetry diff --git a/helm-charts/README.md b/helm-charts/README.md new file mode 100644 index 000000000..097464028 --- /dev/null +++ b/helm-charts/README.md @@ -0,0 +1,16 @@ +### helm repository Setup +Assuming you have helm already installed, it is straight-forward to add a Cloudsmith-based chart repository: + +``` +helm repo add infisical-helm-charts 'https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts/' + +helm repo update +``` + +### Installing a Helm Chart +``` +helm install infisical-helm-charts/ +``` + +#### Available chart names +- infisical diff --git a/helm-charts/infisical/templates/backend-deployment.yaml b/helm-charts/infisical/templates/backend-deployment.yaml index ca45c528b..9bc72eaf5 100644 --- a/helm-charts/infisical/templates/backend-deployment.yaml +++ b/helm-charts/infisical/templates/backend-deployment.yaml @@ -4,7 +4,6 @@ metadata: name: {{ .Release.Name }}-backend-deployment labels: app: backend - namespace: {{ .Values.namespace }} spec: replicas: {{ .Values.backend.replicaCount }} selector: @@ -35,7 +34,6 @@ apiVersion: v1 kind: Service metadata: name: infisical-backend-service - namespace: {{ .Values.namespace }} spec: selector: app: backend diff --git a/helm-charts/infisical/templates/frontend-deployment.yaml b/helm-charts/infisical/templates/frontend-deployment.yaml index f19beaa3d..e0dbdae0d 100644 --- a/helm-charts/infisical/templates/frontend-deployment.yaml +++ b/helm-charts/infisical/templates/frontend-deployment.yaml @@ -4,7 +4,6 @@ metadata: name: {{ .Release.Name }}-frontend-deployment labels: app: frontend - namespace: {{ .Values.namespace }} spec: replicas: {{ .Values.frontend.replicaCount }} selector: @@ -26,7 +25,6 @@ apiVersion: v1 kind: Service metadata: name: infisical-frontend-service - namespace: {{ .Values.namespace }} spec: selector: app: frontend diff --git a/helm-charts/infisical/templates/ingress.yaml b/helm-charts/infisical/templates/ingress.yaml index e8b0febb3..a987627f4 100644 --- a/helm-charts/infisical/templates/ingress.yaml +++ b/helm-charts/infisical/templates/ingress.yaml @@ -3,7 +3,6 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: infisical-ingress - namespace: {{ .Values.namespace }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm-charts/infisical/templates/mongodb-deployment.yaml b/helm-charts/infisical/templates/mongodb-deployment.yaml index 02d380b1e..90b755ad3 100644 --- a/helm-charts/infisical/templates/mongodb-deployment.yaml +++ b/helm-charts/infisical/templates/mongodb-deployment.yaml @@ -2,7 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: name: mongodb-deployment - namespace: {{ .Values.namespace }} labels: app: mongodb spec: @@ -30,7 +29,6 @@ apiVersion: v1 kind: Service metadata: name: mongodb-service - namespace: {{ .Values.namespace }} spec: selector: app: mongodb diff --git a/helm-charts/infisical/templates/namespace.yaml b/helm-charts/infisical/templates/namespace.yaml deleted file mode 100644 index 3f9c2c1ad..000000000 --- a/helm-charts/infisical/templates/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: infisical \ No newline at end of file diff --git a/helm-charts/upload-to-cloudsmith.sh b/helm-charts/upload-to-cloudsmith.sh new file mode 100644 index 000000000..218c11149 --- /dev/null +++ b/helm-charts/upload-to-cloudsmith.sh @@ -0,0 +1,10 @@ +## Loop through each helm chart directoy and build each into helm package +for d in */ ; do + helm package $d +done + +## Upload each packaged helm chart +for i in *.tgz; do + [ -f "$i" ] || break + cloudsmith push helm --republish infisical/helm-charts $i +done \ No newline at end of file