Skip to content

Commit

Permalink
Merge pull request #314 from Grraahaam/feat/helm-mongodb-persistence
Browse files Browse the repository at this point in the history
feat(chart): mongodb persistence
  • Loading branch information
maidul98 authored Feb 18, 2023
2 parents d885997 + b5d4cfe commit 1659dab
Show file tree
Hide file tree
Showing 10 changed files with 638 additions and 107 deletions.
43 changes: 31 additions & 12 deletions helm-charts/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
### helm repository Setup
Assuming you have helm already installed, it is straight-forward to add a Cloudsmith-based chart repository:
# Infisical Helm Charts

```
helm repo add infisical-helm-charts 'https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts/'
Welcome to Infisical Helm Charts repository! Find instructions below to setup and install our charts.

```sh
# Add the Infisical repository
helm repo add infisical 'https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts/' && helm repo update

# Install Infisical
helm upgrade --install --atomic \
-n infisical-dev --create-namespace \
infisical infisical/infisical

helm repo update
# Install Infisical Secrets Operator
helm upgrade --install --atomic \
-n infisical-dev --create-namespace \
infisical-secrets-operator infisical/secrets-operator
```

### Installing a Helm Chart
```
helm install infisical-helm-charts/<name-of-helm-chart>
```
## Charts

Here's the link to our charts corresponding documentation :
- **`[infisical](./infisical/README.md)`**
- **`secrets-operator`**

## Documentation

We're trying to follow a documentation convention across our charts, allowing us to auto-generate markdown documentation thanks to [this tool](https://github.com/bitnami-labs/readme-generator-for-helm)

#### Available chart names
- infisical
- secrets-operator
Steps to update the documentation :
1. `cd helm-charts/<chart>`
1. `git clone https://github.com/bitnami-labs/readme-generator-for-helm`
2. `npm install ./readme-generator-for-helm`
3. `npm exec readme-generator -- --readme README.md --values values.yaml`
- It'll insert the table below the `## Parameters` title
- It'll output errors if some of the path aren't documented
3 changes: 3 additions & 0 deletions helm-charts/infisical/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts/
node_modules/
package*.json
9 changes: 9 additions & 0 deletions helm-charts/infisical/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 13.6.7
- name: mailhog
repository: https://codecentric.github.io/helm-charts
version: 5.2.3
digest: sha256:a54ae9ee60775f6f1aa916b59aee55b3ed5234b6bd88185fcb118b7f69539d70
generated: "2023-02-13T14:13:27.525541038+01:00"
12 changes: 11 additions & 1 deletion helm-charts/infisical/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.13
version: 0.1.14

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.17.0"

dependencies:
- name: mongodb
version: "~13.6.7"
repository: "https://charts.bitnami.com/bitnami"
condition: mongodb.enabled
- name: mailhog
version: "~5.2.3"
repository: "https://codecentric.github.io/helm-charts"
condition: mailhog.enabled
187 changes: 187 additions & 0 deletions helm-charts/infisical/README.md

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions helm-charts/infisical/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
##

-- Infisical Helm Chart --

__ __
( _) ( _)
/ / \\ / /\_\_
/ / \\ / / | \ \
/ / \\ / / |\ \ \
/ / , \ , / / /| \ \
/ / |\_ /| / / / \ \_\
/ / |\/ _ '_|\ / / / \ \\
| / |/ 0 \0\\ / | | \ \\
| |\| \_\_ / / | \ \\
| | |/ \.\ o\o) / \ | \\
\ | /\\`v-v / | | \\
| \/ /_| \\_| / | | \ \\
| | /__/_ / _____ | | \ \\
\| [__] \_/ |_________ \ | \ ()
/ [___] ( \ \ |\ | | //
| [___] |\| \| / |/
/| [____] \ |/\ / / ||
( \ [____ / ) _\ \ \ \| | ||
\ \ [_____| / / __/ \ / / //
| \ [_____/ / / \ | \/ //
| / '----| /=\____ _/ | / //
__ / / | / ___/ _/\ \ | ||
(/-(/-\) / \ (/\/\)/ | / | /
(/\/\) / / //
_________/ / /
\____________/ (

██╗███╗ ██╗███████╗██╗███████╗██╗ ██████╗ █████╗ ██╗
██║████╗ ██║██╔════╝██║██╔════╝██║██╔════╝██╔══██╗██║
██║██╔██╗ ██║█████╗ ██║███████╗██║██║ ███████║██║
██║██║╚██╗██║██╔══╝ ██║╚════██║██║██║ ██╔══██║██║
██║██║ ╚████║██║ ██║███████║██║╚██████╗██║ ██║███████╗
╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝
{{ .Chart.Name }} ({{ .Chart.Version }})


╭―― Thank you for installing Infisical! 👋 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――┤
│ Infisical / All-in-one open-source SecretOps solution to manage your secrets across your infra! 🔒🔑
│ Visit < https://infisical.com/docs/self-hosting/overview > for further documentation about self-hosting!
│ Current installation (infisical) :
│ • infisical-frontend : {{ .Values.frontend.enabled }}
│ • infisical-backend : {{ .Values.backend.enabled }}
│ • mongodb : {{ .Values.mongodb.enabled }}
│ • mailhog : {{ .Values.mailhog.enabled }}
╰―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――┤

╭―― Here's a list of helpfull commands to get you started 📝 ―――――――――――――――――――――――――――――――――――――――――┤
│ → Get all the Infisical resources (excluding secrets/pvcs)
│ $ kubectl get all -n {{ .Release.Namespace }}
│ → Get your release status
│ $ helm status {{ .Release.Namespace }} {{ .Release.Name }}
│ → Get your release resources
│ $ helm get all {{ .Release.Namespace }} {{ .Release.Name }}
│ → Uninstall your release
│ $ helm uninstall {{ .Release.Namespace }} {{ .Release.Name }}
│ → Get MongoDB root password
│ $ kubectl get secret {{ .Release.Namespace }} mongodb
│ -o jsonpath="{.data['mongodb-root-password']}" | base64 -d
│ → Get MongoDB users passwords
│ $ kubectl get secret {{ .Release.Namespace }} mongodb
│ -o jsonpath="{.data['mongodb-passwords']}" | base64 -d
╰―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――┤

##
7 changes: 4 additions & 3 deletions helm-charts/infisical/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ Create the mongodb connection string.
{{- define "infisical.mongodb.connectionString" -}}
{{- $host := include "infisical.mongodb.fullname" . -}}
{{- $port := 27017 -}}
{{- $user := "root" -}}
{{- $pass := "root" -}}
{{- $connectionString := printf "mongodb://%s:%s@%s:%d/" $user $pass $host $port -}}
{{- $user := first .Values.mongodb.auth.usernames | default "root" -}}
{{- $pass := first .Values.mongodb.auth.passwords | default "root" -}}
{{- $database := first .Values.mongodb.auth.databases | default "test" -}}
{{- $connectionString := printf "mongodb://%s:%s@%s:%d/%s" $user $pass $host $port $database -}}
{{- if .Values.mongodbConnection.externalMongoDBConnectionString -}}
{{- $connectionString = .Values.mongodbConnection.externalMongoDBConnectionString -}}
{{- end -}}
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/infisical/templates/backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.backend.service.type }}
selector:
{{- include "infisical.backend.matchLabels" . | nindent 8 }}
ports:
- protocol: TCP
port: 4000
targetPort: 4000 # container port
{{- if eq .Values.backend.service.type "NodePort" }}
nodePort: {{ .Values.backend.service.nodePort }}
{{- end }}
49 changes: 0 additions & 49 deletions helm-charts/infisical/templates/mongodb-deployment.yaml

This file was deleted.

Loading

0 comments on commit 1659dab

Please sign in to comment.