Skip to content

Commit 0b1a7ef

Browse files
committed
Update README
1 parent cc2c081 commit 0b1a7ef

1 file changed

Lines changed: 2 additions & 96 deletions

File tree

kubernetes/README.md

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ There are a few components that need to installed manually before the cluster ca
4040

4141
After the initial Talos cluster creation (with the CNI set to none), the cluster will be waiting for a CNI to be installed ([docs](https://www.talos.dev/v1.9/kubernetes-guides/network/deploying-cilium/)).
4242

43-
To install the initial bootstrap components, use `helmfile`:
43+
To install the initial bootstrap components, use the bootstrap script at `bootstrap/bootstrap.sh`:
4444

4545
```bash
46-
helmfile --file kubernetes/homelab/bootstrap/helmfile.yaml apply --skip-diff-on-install --suppress-diff
46+
./bootstrap.sh
4747
```
4848

4949
## Storage
@@ -68,100 +68,6 @@ For this hyperconverged route, I might consider using [Harvester](https://github
6868

6969
I use [`sops`](https://github.com/getsops/sops) to manage secrets in a GitOps way. There's a good overview of sops [here](https://blog.gitguardian.com/a-comprehensive-guide-to-sops/).
7070

71-
### Secrets With Flux
72-
73-
To properly ensure secrets are GitOps-ified and still kept secret across the wide array of apps in this repo, there are numerous methods in which an app can be supplied secrets. This section describes numerous ways to supply secrets with [Flux](https://fluxcd.io/) and [SOPS](https://github.com/mozilla/sops).
74-
75-
_This guide will not be covering how to integrate SOPS into Flux initially (i.e. bootstrapping SOPS with Flux during initial setup). For that, check out the [Flux documentation on integrating SOPS](https://fluxcd.io/docs/guides/mozilla-sops/). This guide is also not covering [External Secrets](https://external-secrets.io/latest/), which is also used in this repository._
76-
77-
For the first three examples, the following secret will be used:.
78-
79-
```yaml
80-
apiVersion: v1
81-
kind: Secret
82-
metadata:
83-
name: application-secret
84-
namespace: default
85-
stringData:
86-
SUPER_SECRET_KEY: "SUPER SECRET VALUE"
87-
```
88-
89-
#### Method 1: `envFrom`
90-
91-
> _Use `envFrom` in a deployment or a Helm chart that supports the setting, this will pass all secret items from the secret into the containers environment._
92-
93-
```yaml
94-
envFrom:
95-
- secretRef:
96-
name: application-secret
97-
```
98-
99-
View example [Helm Release](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/default/home-assistant/helm-release.yaml) and corresponding [Secret](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/default/home-assistant/secret.sops.yaml).
100-
101-
#### Method 2: `env.valueFrom`
102-
103-
> _Similar to the above but it's possible with `env` to pick an item from a secret._
104-
105-
```yaml
106-
env:
107-
- name: WAY_COOLER_ENV_VARIABLE
108-
valueFrom:
109-
secretKeyRef:
110-
name: application-secret
111-
key: SUPER_SECRET_KEY
112-
```
113-
114-
View example [Helm Release](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/networking/external-dns/helm-release.yaml) and corresponding [Secret](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/networking/external-dns/secret.sops.yaml).
115-
116-
#### Method 3: `spec.valuesFrom`
117-
118-
> _The Flux HelmRelease option `valuesFrom` can inject a secret item into the Helm values of a `HelmRelease`_
119-
>
120-
> * _Does not work with merging array values_
121-
> * _Care needed with keys that contain dot notation in the name_
122-
123-
```yaml
124-
valuesFrom:
125-
- targetPath: config."admin\.password"
126-
kind: Secret
127-
name: application-secret
128-
valuesKey: SUPER_SECRET_KEY
129-
```
130-
131-
View example [Helm Release](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/default/emqx/helm-release.yaml) and corresponding [Secret](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/default/emqx/secret.sops.yaml).
132-
133-
#### Method 4: Variable Substitution with Flux
134-
135-
> _Flux variable substitution can inject secrets into any YAML manifest. This requires the [Flux Kustomization](https://fluxcd.io/docs/components/kustomize/kustomization/) configured to enable [variable substitution](https://fluxcd.io/docs/components/kustomize/kustomization/#variable-substitution). Correctly configured this allows you to use `${GLOBAL_SUPER_SECRET_KEY}` in any YAML manifest._
136-
137-
```yaml
138-
apiVersion: v1
139-
kind: Secret
140-
metadata:
141-
name: cluster-secrets
142-
namespace: flux-system
143-
stringData:
144-
GLOBAL_SUPER_SECRET_KEY: "GLOBAL SUPER SECRET VALUE"
145-
```
146-
147-
```yaml
148-
apiVersion: kustomize.toolkit.fluxcd.io/v1
149-
kind: Kustomization
150-
# ...
151-
spec:
152-
# ...
153-
decryption:
154-
provider: sops
155-
secretRef:
156-
name: sops-age
157-
postBuild:
158-
substituteFrom:
159-
- kind: Secret
160-
name: cluster-secrets
161-
```
162-
163-
View example [Fluxtomization](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/flux/apps.yaml), [Helm Release](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/apps/monitoring/kube-prometheus-stack/helm-release.yaml), and corresponding [Secret](https://github.com/onedr0p/home-ops/blob/782ec8c15cacc17329aec08841380aba134794a1/cluster/config/cluster-secrets.sops.yaml).
164-
16571
### Kustomization Wait & DependOn
16672

16773
When managing dependencies between HelmReleases and Flux Kustomizations (i.e. KS), there are some import configuration flags that could have a large impact on developer experience: `wait` and `dependsOn`. As a quick overview: there are two bits of configuration that are relevant here:

0 commit comments

Comments
 (0)