diff --git a/.ci/mkdocs/mkdocs.yaml b/.ci/mkdocs/mkdocs.yaml index a66073f5..3ace6f2f 100644 --- a/.ci/mkdocs/mkdocs.yaml +++ b/.ci/mkdocs/mkdocs.yaml @@ -45,9 +45,6 @@ theme: docs_dir: ../../docs site_dir: ../../_site -extra_css: - - _static/custom.css - # Plugins plugins: - search @@ -71,6 +68,10 @@ markdown_extensions: - footnotes - meta - md_in_html + - pymdownx.highlight + - pymdownx.snippets: + check_paths: true + - pymdownx.superfences - toc: permalink: true diff --git a/docs/app-template/introduction.md b/docs/app-template/introduction.md index a7ae1f00..f43a7bd0 100644 --- a/docs/app-template/introduction.md +++ b/docs/app-template/introduction.md @@ -14,40 +14,14 @@ Be sure to check out the [common library docs](../../common-library/introduction and its [`values.yaml`](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common/values.yaml) for more information about the available configuration options. -#### Example +#### Examples -This is an example `values.yaml` file that would deploy the [echo-server](https://github.com/jmalloc/echo-server) -application. +This is an example `values.yaml` file that would deploy the [vaultwarden](https://github.com/dani-garcia/vaultwarden) +application. For more deployment examples, check out the [`examples` folder](https://github.com/bjw-s/helm-charts/tree/main/examples/). -```yaml -image: - repository: docker.io/jmalloc/echo-server - tag: 0.3.3 -service: - main: - ports: - http: - port: 8080 - -ingress: - main: - enabled: true - ingressClassName: "nginx" - hosts: - - host: &host "echo-server.${INGRESS_DOMAIN}" - paths: - - path: / - tls: - - hosts: - - *host - -resources: - requests: - cpu: 15m - memory: 64M - limits: - memory: 128M +``` yaml title="values.yaml" +--8<-- "./examples/helm/values.yaml" ``` ## Source code diff --git a/examples/flux/README.md b/examples/flux/README.md new file mode 100644 index 00000000..1bcbde58 --- /dev/null +++ b/examples/flux/README.md @@ -0,0 +1,10 @@ +# Deployment example using a Flux HelmRelease + +### Prerequisites + +Make sure that the [`bjws-helm-charts` HelmRepository](helmrepository.yaml) is added to your cluster. + +### Deployment + +When you add the [HelmRelease](helmrelease.yaml) to your cluster, Flux will automatically render and +apply the rendered manifest(s) to your cluster. diff --git a/examples/flux/helmrelease.yaml b/examples/flux/helmrelease.yaml new file mode 100644 index 00000000..6297b152 --- /dev/null +++ b/examples/flux/helmrelease.yaml @@ -0,0 +1,77 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: vaultwarden + namespace: default +spec: + interval: 15m + chart: + spec: + chart: app-template + # -- Version of the app-template helm chart + # this example is not automatically updated, so be sure to use the latest chart version + version: 0.1.1 + interval: 15m + sourceRef: + kind: HelmRepository + name: bjw-s-helm-charts + namespace: flux-system + + values: + image: + # -- image repository + repository: vaultwarden/server + # -- image pull policy + pullPolicy: IfNotPresent + # -- image tag + # this example is not automatically updated, so be sure to use the latest image + tag: 1.25.2 + + strategy: + type: Recreate + + # -- environment variables. + # See [image docs](https://github.com/dani-garcia/vaultwarden/blob/main/.env.template) for more details. + env: + # -- Config dir + DATA_FOLDER: "config" + + # -- Configures service settings for the chart. + service: + main: + ports: + http: + port: 80 + websocket: + enabled: true + port: 3012 + + ingress: + # -- Enable and configure ingress settings for the chart under this key. + main: + enabled: false + hosts: + - host: chart-example.local + paths: + - path: / + pathType: Prefix + service: + port: http + - path: /notifications/hub/negotiate + pathType: Prefix + service: + port: http + - path: /notifications/hub + pathType: Prefix + service: + port: websocket + + # -- Configure persistence settings for the chart under this key. + persistence: + config: + enabled: true + type: pvc + accessMode: ReadWriteOnce + size: 1Gi + mountPath: /config diff --git a/examples/flux/helmrepository.yaml b/examples/flux/helmrepository.yaml new file mode 100644 index 00000000..09071a94 --- /dev/null +++ b/examples/flux/helmrepository.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: bjw-s-helm-charts + namespace: flux-system +spec: + interval: 30m + url: https://bjw-s.github.io/helm-charts/ + timeout: 3m diff --git a/examples/helm/README.md b/examples/helm/README.md new file mode 100644 index 00000000..5076b2e7 --- /dev/null +++ b/examples/helm/README.md @@ -0,0 +1,21 @@ +# Deployment example using Kustomize + +### Prerequisites + +Makre sure the Helm repository is installed as follows: + +```console +helm repo add bjw-s https://bjw-s.github.io/helm-charts +helm repo update +``` + +### Deployment + +In order to deploy the manifest for this example, issue the +following command: + +```console +helm install vaultwarden bjw-s/app-template --namespace default --values values.yaml +``` + +This will apply the rendered manifest(s) to your cluster. diff --git a/examples/helm/values.yaml b/examples/helm/values.yaml new file mode 100644 index 00000000..b459ff73 --- /dev/null +++ b/examples/helm/values.yaml @@ -0,0 +1,56 @@ +image: + # -- image repository + repository: vaultwarden/server + # -- image pull policy + pullPolicy: IfNotPresent + # -- image tag + # this example is not automatically updated, so be sure to use the latest image + tag: 1.25.2 + +strategy: + type: Recreate + +# -- environment variables. +# See [image docs](https://github.com/dani-garcia/vaultwarden/blob/main/.env.template) for more details. +env: + # -- Config dir + DATA_FOLDER: "config" + +# -- Configures service settings for the chart. +service: + main: + ports: + http: + port: 80 + websocket: + enabled: true + port: 3012 + +ingress: + # -- Enable and configure ingress settings for the chart under this key. + main: + enabled: false + hosts: + - host: chart-example.local + paths: + - path: / + pathType: Prefix + service: + port: http + - path: /notifications/hub/negotiate + pathType: Prefix + service: + port: http + - path: /notifications/hub + pathType: Prefix + service: + port: websocket + +# -- Configure persistence settings for the chart under this key. +persistence: + config: + enabled: true + type: pvc + accessMode: ReadWriteOnce + size: 1Gi + mountPath: /config diff --git a/examples/kustomize/README.md b/examples/kustomize/README.md new file mode 100644 index 00000000..acc84b88 --- /dev/null +++ b/examples/kustomize/README.md @@ -0,0 +1,25 @@ +# Deployment example using Kustomize + +### Deployment + +#### Build + +In order to view the resulting manifest for this example through Kustomize, issue +the following command: + +```console +kubectl kustomize --enable-helm . +``` + +This will print the rendered manifest(s) to your console. + +#### Apply + +In order to deploy the manifest for this example through Kustomize, issue the +following command: + +```console +kubectl kustomize --enable-helm . | kubectl apply -f - +``` + +This will apply the rendered manifest(s) to your cluster. diff --git a/examples/kustomize/kustomization.yaml b/examples/kustomize/kustomization.yaml new file mode 100644 index 00000000..b585342e --- /dev/null +++ b/examples/kustomize/kustomization.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +helmCharts: + - name: app-template + repo: https://bjw-s.github.io/helm-charts/ + # this example is not automatically updated, so be sure to use the latest chart version + version: 0.1.1 + releaseName: &releaseName vaultwarden + namespace: &releaseNamespace default + valuesFile: values.yaml +commonAnnotations: + meta.helm.sh/release-name: *releaseName + meta.helm.sh/release-namespace: *releaseNamespace +commonLabels: + app.kubernetes.io/managed-by: Helm diff --git a/examples/kustomize/values.yaml b/examples/kustomize/values.yaml new file mode 100644 index 00000000..b459ff73 --- /dev/null +++ b/examples/kustomize/values.yaml @@ -0,0 +1,56 @@ +image: + # -- image repository + repository: vaultwarden/server + # -- image pull policy + pullPolicy: IfNotPresent + # -- image tag + # this example is not automatically updated, so be sure to use the latest image + tag: 1.25.2 + +strategy: + type: Recreate + +# -- environment variables. +# See [image docs](https://github.com/dani-garcia/vaultwarden/blob/main/.env.template) for more details. +env: + # -- Config dir + DATA_FOLDER: "config" + +# -- Configures service settings for the chart. +service: + main: + ports: + http: + port: 80 + websocket: + enabled: true + port: 3012 + +ingress: + # -- Enable and configure ingress settings for the chart under this key. + main: + enabled: false + hosts: + - host: chart-example.local + paths: + - path: / + pathType: Prefix + service: + port: http + - path: /notifications/hub/negotiate + pathType: Prefix + service: + port: http + - path: /notifications/hub + pathType: Prefix + service: + port: websocket + +# -- Configure persistence settings for the chart under this key. +persistence: + config: + enabled: true + type: pvc + accessMode: ReadWriteOnce + size: 1Gi + mountPath: /config