mirror of
https://github.com/funkypenguin/geek-cookbook/
synced 2025-12-13 01:36:23 +00:00
Add WIP docs on how to ansiblize recipes for premix
Signed-off-by: David Young <davidy@funkypenguin.co.nz>
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
### Tip your waiter (sponsor) 👏
|
### Tip your waiter (sponsor) 👏
|
||||||
|
|
||||||
Did you receive excellent service? Want to compliment the chef? (_..and support development of current and future recipes!_) Sponsor me on [Github][github_sponsor] / [Patreon][patreon], or see the [contribute](/community/contribute/) page for more (_free or paid)_ ways to say thank you! 👏
|
Did you receive excellent service? Want to compliment the chef? (_..and support development of current and future recipes!_) Share a [review](https://fnky.nz/testimonial), sponsor me on [Github][github_sponsor] / [Patreon][patreon], or see the [contribute](/community/contribute/) page for more (_free or paid)_ ways to say thank you! 👏
|
||||||
|
|
||||||
### Employ your chef (engage) 🤝
|
### Employ your chef (engage) 🤝
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Got nothing to contribute, but want to give back to the community? Here are some
|
|||||||
|
|
||||||
1. Star :star: the [repo](https://github.com/geek-cookbook/geek-cookbook/)
|
1. Star :star: the [repo](https://github.com/geek-cookbook/geek-cookbook/)
|
||||||
2. Tweet :bird: the [meat](https://ctt.ac/Vl6mc)!
|
2. Tweet :bird: the [meat](https://ctt.ac/Vl6mc)!
|
||||||
|
3. Send a [testimonial](https://fnky.nz/testimonial)
|
||||||
|
|
||||||
## Contributing moneyz 💰
|
## Contributing moneyz 💰
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ So if you're familiar enough with the concepts above, and you've done self-hosti
|
|||||||
|
|
||||||
-- John McDowall, Founder, [kiso.io](https://kiso.io)
|
-- John McDowall, Founder, [kiso.io](https://kiso.io)
|
||||||
|
|
||||||
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.min.js"></script>
|
||||||
|
<iframe id="p-436b4c83-aaea-41ff-889a-2f8e279ff369" src="https://www.bonjoro.com/pe/436b4c83-aaea-41ff-889a-2f8e279ff369" frameborder="0" scrolling="no" width="100%"></iframe>
|
||||||
|
<script type="text/javascript">iFrameResize({ warningTimeout:30000, log: false,}, "#p-436b4c83-aaea-41ff-889a-2f8e279ff369");</script>
|
||||||
|
|
||||||
## Who made this?
|
## Who made this?
|
||||||
|
|
||||||
### 👋 Hi, I'm David
|
### 👋 Hi, I'm David
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -80,7 +80,7 @@ Now that the "global" elements of this deployment (*Namespace and HelmRepository
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the nginx-ingress-controller-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami/charts/blob/master/bitnami/nginx-ingress-controller/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `nginx-ingress-controller/configmap-nginx-ingress-controller-helm-chart-value-overrides.yaml`:
|
Now we're into the nginx-ingress-controller-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami/charts/blob/master/bitnami/nginx-ingress-controller/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `nginx-ingress-controller/configmap-nginx-ingress-controller-helm-chart-value-overrides.yaml`:
|
||||||
|
|
||||||
??? example "Example ConfigMap (click to expand)"
|
??? example "Example ConfigMap (click to expand)"
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ spec:
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the traefik-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
Now we're into the traefik-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
||||||
|
|
||||||
```yaml title="/traefik/configmap-traefik-helm-chart-value-overrides.yaml"
|
```yaml title="/traefik/configmap-traefik-helm-chart-value-overrides.yaml"
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Now that the "global" elements of this deployment (*Namespace and HelmRepository
|
|||||||
|
|
||||||
### ConfigMap (for HelmRelease)
|
### ConfigMap (for HelmRelease)
|
||||||
|
|
||||||
Now we're into the metallb-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami/charts/blob/master/bitnami/metallb/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `metallb-system/configmap-metallb-helm-chart-value-overrides.yaml`:
|
Now we're into the metallb-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami/charts/blob/master/bitnami/metallb/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `metallb-system/configmap-metallb-helm-chart-value-overrides.yaml`:
|
||||||
|
|
||||||
??? example "Example ConfigMap (click to expand)"
|
??? example "Example ConfigMap (click to expand)"
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ spec:
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the app-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/rook/rook/blob/master/deploy/charts/rook-ceph/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
Now we're into the app-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/rook/rook/blob/master/deploy/charts/rook-ceph/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
||||||
|
|
||||||
```yaml title="/rook-ceph-cluster/configmap-rook-ceph-cluster-helm-chart-value-overrides.yaml"
|
```yaml title="/rook-ceph-cluster/configmap-rook-ceph-cluster-helm-chart-value-overrides.yaml"
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ spec:
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the app-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/rook/rook/blob/master/deploy/charts/rook-ceph/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
Now we're into the app-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/rook/rook/blob/master/deploy/charts/rook-ceph/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
||||||
|
|
||||||
```yaml title="rook-ceph/configmap-rook-ceph-helm-chart-value-overrides.yaml"
|
```yaml title="rook-ceph/configmap-rook-ceph-helm-chart-value-overrides.yaml"
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ Now that the "global" elements of this deployment (*Namespace and HelmRepository
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the topolvm-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/topolvm/topolvm/blob/main/charts/topolvm/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `topolvm/configmap-topolvm-helm-chart-value-overrides.yaml`:
|
Now we're into the topolvm-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/topolvm/topolvm/blob/main/charts/topolvm/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `topolvm/configmap-topolvm-helm-chart-value-overrides.yaml`:
|
||||||
|
|
||||||
??? example "Example ConfigMap (click to expand)"
|
??? example "Example ConfigMap (click to expand)"
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ Now that the "global" elements of this deployment (*just the HelmRepository in t
|
|||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
Now we're into the sealed-secrets-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami-labs/sealed-secrets/blob/main/helm/sealed-secrets/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `sealed-secrets/configmap-sealed-secrets-helm-chart-value-overrides.yaml`:
|
Now we're into the sealed-secrets-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami-labs/sealed-secrets/blob/main/helm/sealed-secrets/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo at `sealed-secrets/configmap-sealed-secrets-helm-chart-value-overrides.yaml`:
|
||||||
|
|
||||||
??? example "Example ConfigMap (click to expand)"
|
??? example "Example ConfigMap (click to expand)"
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ spec:
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the cert-manager-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami-labs/cert-manager/blob/main/helm/cert-manager/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
Now we're into the cert-manager-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami-labs/cert-manager/blob/main/helm/cert-manager/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
||||||
|
|
||||||
```yaml title="/cert-manager/configmap-cert-manager-helm-chart-value-overrides.yaml"
|
```yaml title="/cert-manager/configmap-cert-manager-helm-chart-value-overrides.yaml"
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ spec:
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the secret-replicator-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/kiwigrid/helm-charts/blob/master/charts/secret-replicator/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
Now we're into the secret-replicator-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/kiwigrid/helm-charts/blob/master/charts/secret-replicator/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
||||||
|
|
||||||
```yaml hl_lines="21 27" title="/secret-replicator/configmap-secret-replicator-helm-chart-value-overrides.yaml"
|
```yaml hl_lines="21 27" title="/secret-replicator/configmap-secret-replicator-helm-chart-value-overrides.yaml"
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
10
docs/premix/ansiblizing/index.md
Normal file
10
docs/premix/ansiblizing/index.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Ansiblizing
|
||||||
|
|
||||||
|
!!! warning "This section is under construction :hammer:"
|
||||||
|
This section is a serious work-in-progress, and reflects the current development on the [sponsors](https://github.com/sponsors/funkypenguin)' "premix" repository
|
||||||
|
So... There may be errors and inaccuracies. Jump into [Discord](http://chat.funkypenguin.co.nz) in the #premium-support channel if you're encountering issues 😁
|
||||||
|
|
||||||
|
So you want to add a recipe to the the premix playbook which is not yet an Ansible role? Read on for details...
|
||||||
|
|
||||||
|
1. [Ansiblizing for Docker Swarm](/premix/ansiblizing/swarm/)
|
||||||
|
2. [Ansiblizing for Kubernetes (flux)](/premix/ansiblizing/kubernetes/)
|
||||||
41
docs/premix/ansiblizing/kubernetes.md
Normal file
41
docs/premix/ansiblizing/kubernetes.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Ansiblizing a recipe for Kubernetes
|
||||||
|
|
||||||
|
!!! warning "This section is under construction :hammer:"
|
||||||
|
This section is a serious work-in-progress, and reflects the current development on the [sponsors](https://github.com/sponsors/funkypenguin)' "premix" repository
|
||||||
|
So... There may be errors and inaccuracies. Jump into [Discord](http://chat.funkypenguin.co.nz) in the #premium-support channel if you're encountering issues 😁
|
||||||
|
|
||||||
|
## Update deploy.yml
|
||||||
|
|
||||||
|
Edit `ansible/deploy.yml`, and find the kubernetes section, starting with:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Create flux manifests using localhost
|
||||||
|
- hosts: localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
Add an `import_role` task like this (*alphabeticized*) at the bottom:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Traefik
|
||||||
|
- { import_role: { name: flux-repo }, vars: { recipe: traefik, config: traefik }, tags: [ traefik ], when: combined_config.traefik.enabled | bool }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update config
|
||||||
|
|
||||||
|
Edit `ansible/group_vars/all/main.yml`, and edit the `recipe_default_config` dictionary, adding the necessary values, like this:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
traefik:
|
||||||
|
enabled: true
|
||||||
|
helm_chart_namespace: traefik
|
||||||
|
helm_chart_name: traefik
|
||||||
|
helm_chart_repo: traefik
|
||||||
|
helm_chart_repo_url: https://helm.traefik.io/traefik
|
||||||
|
helm_chart_version: latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## That's it!
|
||||||
|
|
||||||
|
What, that's all? So easy?
|
||||||
|
|
||||||
|
Yes, but remember all they playbook does in the case of a flux deployment is to create the necessary files for the user to customize themselves, since it's impractical to try to contain any chart config within our playbook!
|
||||||
44
docs/premix/ansiblizing/swarm.md
Normal file
44
docs/premix/ansiblizing/swarm.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Ansiblizing a recipe for Swarm
|
||||||
|
|
||||||
|
!!! warning "This section is under construction :hammer:"
|
||||||
|
This section is a serious work-in-progress, and reflects the current development on the [sponsors](https://github.com/sponsors/funkypenguin)' "premix" repository
|
||||||
|
So... There may be errors and inaccuracies. Jump into [Discord](http://chat.funkypenguin.co.nz) in the #premium-support channel if you're encountering issues 😁
|
||||||
|
|
||||||
|
## Update deploy.yml
|
||||||
|
|
||||||
|
Edit `ansible/deploy.yml`, and find the swarm section, starting with:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
### non-critical swarm recipes start here, alphabeticized
|
||||||
|
```
|
||||||
|
|
||||||
|
Add an `import_role` task like this (*alphabeticized*) at the bottom:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Setup immich
|
||||||
|
- { import_role: { name: docker-stack }, vars: { recipe: immich }, tags: [ immich ], when: combined_config.immich.enabled | bool }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update config
|
||||||
|
|
||||||
|
Edit `ansible/group_vars/all/main.yml`, and edit the `recipe_default_config` dictionary, adding the necessary values, like this:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
immich:
|
||||||
|
enabled: false #(1)!
|
||||||
|
run_pre_deploy: | #(2)!
|
||||||
|
mkdir -p /var/data/immich/database-dump
|
||||||
|
mkdir -p /var/data/immich/upload
|
||||||
|
mkdir -p /var/data/runtime/immich/database
|
||||||
|
run_post_deploy: | #(3)!
|
||||||
|
echo "this is just an example to show that it's possible to run tasks post-deploy!"
|
||||||
|
```
|
||||||
|
|
||||||
|
1. We disable all non-essential services by default - that way, the user can opt into them in their own config, which is later merged with this master config.
|
||||||
|
2. Add as many pre-deploy commands as necessary - typically these will create the necessary data directories. `/var/data/config/<recipe>` will be created automatically.
|
||||||
|
3. Likewise, add any necessary post-deployment commands
|
||||||
|
|
||||||
|
## Ensure the recipe files are valid
|
||||||
|
|
||||||
|
The playbook assumes that `/<recipe-name>/<recipe-name>.yml` and `/<recipe-name>/<recipe-name>.env-sample` exist. Without these (*and any other supporting files, ending in `-sample`*), unpleasant things will happen!
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ spec:
|
|||||||
|
|
||||||
### ConfigMap
|
### ConfigMap
|
||||||
|
|
||||||
Now we're into the mastodon-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami-labs/mastodon/blob/main/helm/mastodon/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 tabs (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
Now we're into the mastodon-specific YAMLs. First, we create a ConfigMap, containing the entire contents of the helm chart's [values.yaml](https://github.com/bitnami-labs/mastodon/blob/main/helm/mastodon/values.yaml). Paste the values into a `values.yaml` key as illustrated below, indented 4 spaces (*since they're "encapsulated" within the ConfigMap YAML*). I create this example yaml in my flux repo:
|
||||||
|
|
||||||
```yaml title="mastodon/configmap-mastodon-helm-chart-value-overrides.yaml"
|
```yaml title="mastodon/configmap-mastodon-helm-chart-value-overrides.yaml"
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
16
mkdocs.yml
16
mkdocs.yml
@@ -273,10 +273,18 @@ nav:
|
|||||||
# - Webook Receiver: kubernetes/wip.md
|
# - Webook Receiver: kubernetes/wip.md
|
||||||
- 🚀 Get Premix!:
|
- 🚀 Get Premix!:
|
||||||
- premix/index.md
|
- premix/index.md
|
||||||
- Operation: premix/ansible/operation.md
|
- Get Started:
|
||||||
- Design: premix/ansible/design.md
|
- Setup: premix/ansible/operation.md
|
||||||
# - Swarm: premix/swarm.md
|
- Deploy!:
|
||||||
# - Kubernetes: premix/kubernetes.md
|
- Swarm: premix/swarm.md
|
||||||
|
- Kubernetes: premix/kubernetes.md
|
||||||
|
- Contribute:
|
||||||
|
- Ansiblizing:
|
||||||
|
- premix/ansiblizing/index.md
|
||||||
|
- Swarm: premix/ansiblizing/swarm.md
|
||||||
|
- Kubernetes: premix/ansiblizing/kubernetes.md
|
||||||
|
- Reference:
|
||||||
|
- Design: premix/ansible/design.md
|
||||||
- ☑️ Reviews:
|
- ☑️ Reviews:
|
||||||
- review/index.md
|
- review/index.md
|
||||||
- Immich: review/immich.md
|
- Immich: review/immich.md
|
||||||
|
|||||||
Reference in New Issue
Block a user