Rename gotk-system namespace to flux-system
Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
@@ -22,8 +22,8 @@ first to the source-controller, so that the `HelmRelease` can reference
|
||||
to it.
|
||||
|
||||
A cluster administrator should register trusted sources by creating
|
||||
the resources in the `gotk-system` namespace. By default, the
|
||||
source-controller watches for sources only in the `gotk-system`
|
||||
the resources in the `flux-system` namespace. By default, the
|
||||
source-controller watches for sources only in the `flux-system`
|
||||
namespace, this way cluster admins can prevent untrusted sources from
|
||||
being registered by users.
|
||||
|
||||
@@ -43,7 +43,7 @@ apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m
|
||||
url: https://stefanprodan.github.io/podinfo
|
||||
@@ -82,7 +82,7 @@ apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m
|
||||
url: https://github.com/stefanprodan/podinfo
|
||||
@@ -184,7 +184,7 @@ spec:
|
||||
sourceRef:
|
||||
kind: <HelmRepository|GitRepository|Bucket>
|
||||
name: podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
interval: 1m
|
||||
values:
|
||||
replicaCount: 2
|
||||
@@ -265,7 +265,7 @@ broadcast events to the [notification-controller](../components/notification/con
|
||||
To receive the events as notifications, a `Provider` needs to be setup
|
||||
first as described in the [notifications guide](notifications.md#define-a-provider).
|
||||
Once you have set up the `Provider`, create a new `Alert` resource in
|
||||
the `gotk-system` to start receiving notifications about the Helm
|
||||
the `flux-system` to start receiving notifications about the Helm
|
||||
release:
|
||||
|
||||
```yaml
|
||||
@@ -274,7 +274,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
metadata:
|
||||
generation: 2
|
||||
name: helm-podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
providerRef:
|
||||
name: slack
|
||||
@@ -304,7 +304,7 @@ First generate a random string and create a secret with a `token` field:
|
||||
TOKEN=$(head -c 12 /dev/urandom | shasum | cut -d ' ' -f1)
|
||||
echo $TOKEN
|
||||
|
||||
kubectl -n gotk-system create secret generic webhook-token \
|
||||
kubectl -n flux-system create secret generic webhook-token \
|
||||
--from-literal=token=$TOKEN
|
||||
```
|
||||
|
||||
@@ -315,7 +315,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
kind: Receiver
|
||||
metadata:
|
||||
name: helm-podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
type: harbor
|
||||
secretRef:
|
||||
@@ -330,7 +330,7 @@ The notification-controller generates a unique URL using the provided token and
|
||||
Find the URL with:
|
||||
|
||||
```console
|
||||
$ kubectl -n gotk-system get receiver/helm-podinfo
|
||||
$ kubectl -n flux-system get receiver/helm-podinfo
|
||||
|
||||
NAME READY STATUS
|
||||
helm-podinfo True Receiver initialised with URL: /hook/bed6d00b5555b1603e1f59b94d7fdbca58089cb5663633fb83f2815dc626d92b
|
||||
|
||||
@@ -75,12 +75,12 @@ cluster e.g. `staging-cluster` and `production-cluster`:
|
||||
|
||||
```sh
|
||||
├── staging-cluster # <- path=staging-cluster
|
||||
│ └── gotk-system # <- namespace dir generated by bootstrap
|
||||
│ └── flux-system # <- namespace dir generated by bootstrap
|
||||
│ ├── toolkit-components.yaml
|
||||
│ ├── toolkit-kustomization.yaml
|
||||
│ └── toolkit-source.yaml
|
||||
└── production-cluster # <- path=production-cluster
|
||||
└── gotk-system
|
||||
└── flux-system
|
||||
```
|
||||
|
||||
!!! hint "Change the default branch"
|
||||
@@ -205,7 +205,7 @@ cd my-repository
|
||||
Create a directory inside the repository:
|
||||
|
||||
```sh
|
||||
mkdir -p ./my-cluster/gotk-system
|
||||
mkdir -p ./my-cluster/flux-system
|
||||
```
|
||||
|
||||
Generate the toolkit manifests with:
|
||||
@@ -213,7 +213,7 @@ Generate the toolkit manifests with:
|
||||
```sh
|
||||
gotk install --version=latest \
|
||||
--arch=amd64 \ # on ARM64/AARCH64 clusters use --arch=arm64
|
||||
--export > ./my-cluster/gotk-system/toolkit-components.yaml
|
||||
--export > ./my-cluster/flux-system/toolkit-components.yaml
|
||||
```
|
||||
|
||||
If your cluster must pull images from a private container registry, first you should pull
|
||||
@@ -225,12 +225,12 @@ docker tag ghcr.io/fluxcd/source-controller:v0.0.14 registry.internal/fluxcd/sou
|
||||
docker push registry.internal/fluxcd/source-controller:v0.0.14
|
||||
```
|
||||
|
||||
Create the pull secret in the `gotk-system` namespace:
|
||||
Create the pull secret in the `flux-system` namespace:
|
||||
|
||||
```sh
|
||||
kubectl create ns gotk-system
|
||||
kubectl create ns flux-system
|
||||
|
||||
kubectl -n gotk-system create secret generic regcred \
|
||||
kubectl -n flux-system create secret generic regcred \
|
||||
--from-file=.dockerconfigjson=/.docker/config.json \
|
||||
--type=kubernetes.io/dockerconfigjson
|
||||
```
|
||||
@@ -241,7 +241,7 @@ Set your registry domain, and the pull secret when generating the manifests:
|
||||
gotk install --version=latest \
|
||||
--registry=registry.internal/fluxcd \
|
||||
--image-pull-secret=regcred \
|
||||
--export > ./my-cluster/gotk-system/toolkit-components.yaml
|
||||
--export > ./my-cluster/flux-system/toolkit-components.yaml
|
||||
```
|
||||
|
||||
Commit and push the manifest to the master branch:
|
||||
@@ -253,7 +253,7 @@ git add -A && git commit -m "add toolkit manifests" && git push
|
||||
Apply the manifests on your cluster:
|
||||
|
||||
```sh
|
||||
kubectl apply -f ./my-cluster/gotk-system/toolkit-components.yaml
|
||||
kubectl apply -f ./my-cluster/flux-system/toolkit-components.yaml
|
||||
```
|
||||
|
||||
Verify that the toolkit controllers have started:
|
||||
@@ -265,7 +265,7 @@ gotk check
|
||||
Create a `GitRepository` object on your cluster by specifying the SSH address of your repo:
|
||||
|
||||
```sh
|
||||
gotk create source git gotk-system \
|
||||
gotk create source git flux-system \
|
||||
--url= ssh://<host>/<org>/my-repository \
|
||||
--ssh-key-algorithm=ecdsa \
|
||||
--ssh-ecdsa-curve=p521 \
|
||||
@@ -279,7 +279,7 @@ If you don't specify the SSH algorithm, then gotk will generate an RSA 2048 bits
|
||||
If your Git server supports basic auth, you can set the URL to HTTPS and specify the credentials with:
|
||||
|
||||
```sh
|
||||
gotk create source git gotk-system \
|
||||
gotk create source git flux-system \
|
||||
--url=https://<host>/<org>/my-repository \
|
||||
--username=my-username \
|
||||
--password=my-password \
|
||||
@@ -290,8 +290,8 @@ gotk create source git gotk-system \
|
||||
Create a `Kustomization` object on your cluster:
|
||||
|
||||
```sh
|
||||
gotk create kustomization gotk-system \
|
||||
--source=gotk-system \
|
||||
gotk create kustomization flux-system \
|
||||
--source=flux-system \
|
||||
--path="./my-cluster" \
|
||||
--prune=true \
|
||||
--interval=10m
|
||||
@@ -300,11 +300,11 @@ gotk create kustomization gotk-system \
|
||||
Export both objects, commit and push the manifests to Git:
|
||||
|
||||
```sh
|
||||
gotk export source git gotk-system \
|
||||
> ./my-cluster/gotk-system/toolkit-source.yaml
|
||||
gotk export source git flux-system \
|
||||
> ./my-cluster/flux-system/toolkit-source.yaml
|
||||
|
||||
gotk export kustomization gotk-system \
|
||||
> ./my-cluster/gotk-system/toolkit-kustomization.yaml
|
||||
gotk export kustomization flux-system \
|
||||
> ./my-cluster/flux-system/toolkit-kustomization.yaml
|
||||
|
||||
git add -A && git commit -m "add toolkit reconciliation" && git push
|
||||
```
|
||||
@@ -313,7 +313,7 @@ To upgrade the toolkit to a newer version, run the install command and commit th
|
||||
|
||||
```sh
|
||||
gotk install --version=latest \
|
||||
--export > ./my-cluster/gotk-system/toolkit-components.yaml
|
||||
--export > ./my-cluster/flux-system/toolkit-components.yaml
|
||||
|
||||
git add -A && git commit -m "update toolkit" && git push
|
||||
```
|
||||
@@ -367,7 +367,7 @@ gotk create source helm stable \
|
||||
gotk create helmrelease sealed-secrets \
|
||||
--interval=1h \
|
||||
--release-name=sealed-secrets \
|
||||
--target-namespace=gotk-system \
|
||||
--target-namespace=flux-system \
|
||||
--source=HelmRepository/stable \
|
||||
--chart=sealed-secrets \
|
||||
--chart-version="1.10.x"
|
||||
|
||||
@@ -27,14 +27,14 @@ gotk create kustomization monitoring \
|
||||
--prune=true \
|
||||
--source=monitoring \
|
||||
--path="./manifests/monitoring" \
|
||||
--health-check="Deployment/prometheus.gotk-system" \
|
||||
--health-check="Deployment/grafana.gotk-system"
|
||||
--health-check="Deployment/prometheus.flux-system" \
|
||||
--health-check="Deployment/grafana.flux-system"
|
||||
```
|
||||
|
||||
You can access Grafana using port forwarding:
|
||||
|
||||
```sh
|
||||
kubectl -n gotk-system port-forward svc/grafana 3000:3000
|
||||
kubectl -n flux-system port-forward svc/grafana 3000:3000
|
||||
```
|
||||
|
||||
## Grafana dashboards
|
||||
|
||||
@@ -41,13 +41,13 @@ sec rsa3072 2020-09-06 [SC]
|
||||
```
|
||||
|
||||
Export the public and private keypair from your local GPG keyring and
|
||||
create a Kubernetes secret named `sops-gpg` in the `gotk-system` namespace:
|
||||
create a Kubernetes secret named `sops-gpg` in the `flux-system` namespace:
|
||||
|
||||
```sh
|
||||
gpg --export-secret-keys \
|
||||
--armor 1F3D1CED2F865F5E59CA564553241F147E7C5FA4 |
|
||||
kubectl create secret generic sops-gpg \
|
||||
--namespace=gotk-system \
|
||||
--namespace=flux-system \
|
||||
--from-file=sops.asc=/dev/stdin
|
||||
```
|
||||
|
||||
@@ -104,7 +104,7 @@ secrets by iterating over all the private keys until it finds one that works.
|
||||
!!! hint KMS
|
||||
When using AWS/GCP KMS or Azure Key Vault, you'll have to bind an IAM Role
|
||||
with read access to the KMS keys to the `default` service account of the
|
||||
`gotk-system` namespace for kustomize-controller to be able to fetch
|
||||
`flux-system` namespace for kustomize-controller to be able to fetch
|
||||
keys from KMS.
|
||||
|
||||
## GitOps workflow
|
||||
@@ -119,7 +119,7 @@ apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: my-secrets
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m
|
||||
url: https://github.com/my-org/my-secrets
|
||||
@@ -132,7 +132,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: my-secrets
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 10m0s
|
||||
sourceRef:
|
||||
|
||||
@@ -23,7 +23,7 @@ The notification controller is part of the default toolkit installation.
|
||||
First create a secret with your Slack incoming webhook:
|
||||
|
||||
```sh
|
||||
kubectl -n gotk-system create secret generic slack-url \
|
||||
kubectl -n flux-system create secret generic slack-url \
|
||||
--from-literal=address=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK
|
||||
```
|
||||
|
||||
@@ -37,7 +37,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
kind: Provider
|
||||
metadata:
|
||||
name: slack
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
type: slack
|
||||
channel: general
|
||||
@@ -61,7 +61,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
kind: Alert
|
||||
metadata:
|
||||
name: on-call-webapp
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
providerRef:
|
||||
name: slack
|
||||
@@ -78,7 +78,7 @@ Apply the above files or commit them to the `fleet-infra` repository.
|
||||
To verify that the alert has been acknowledge by the notification controller do:
|
||||
|
||||
```console
|
||||
$ kubectl -n gotk-system get alerts
|
||||
$ kubectl -n flux-system get alerts
|
||||
|
||||
NAME READY STATUS AGE
|
||||
on-call-webapp True Initialized 1m
|
||||
@@ -141,7 +141,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
kind: Provider
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
type: github
|
||||
channel: general
|
||||
@@ -153,7 +153,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
kind: Alert
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
providerRef:
|
||||
name: podinfo
|
||||
@@ -161,7 +161,7 @@ spec:
|
||||
eventSources:
|
||||
- kind: Kustomization
|
||||
name: podinfo
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
```
|
||||
|
||||
The secret referenced in the provider is expected to contain a [personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
|
||||
@@ -171,7 +171,7 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: github
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
data:
|
||||
token: <token>
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ Create a Helm release that installs the latest version of sealed-secrets control
|
||||
gotk create helmrelease sealed-secrets \
|
||||
--interval=1h \
|
||||
--release-name=sealed-secrets \
|
||||
--target-namespace=gotk-system \
|
||||
--target-namespace=flux-system \
|
||||
--source=HelmRepository/stable \
|
||||
--chart=sealed-secrets \
|
||||
--chart-version="1.10.x"
|
||||
@@ -59,14 +59,14 @@ With chart version `1.10.x` we configure helm-controller to automatically upgrad
|
||||
when a new chart patch version is fetched by source-controller.
|
||||
|
||||
At startup, the sealed-secrets controller generates a 4096-bit RSA key pair and
|
||||
persists the private and public keys as Kubernetes secrets in the `gotk-system` namespace.
|
||||
persists the private and public keys as Kubernetes secrets in the `flux-system` namespace.
|
||||
|
||||
You can retrieve the public key with:
|
||||
|
||||
```sh
|
||||
kubeseal --fetch-cert \
|
||||
--controller-name=sealed-secrets \
|
||||
--controller-namespace=gotk-system \
|
||||
--controller-namespace=flux-system \
|
||||
> pub-sealed-secrets.pem
|
||||
```
|
||||
|
||||
@@ -120,7 +120,7 @@ apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: stable
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1h0m0s
|
||||
url: https://charts.helm.sh/stable
|
||||
@@ -133,7 +133,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: sealed-secrets
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
@@ -144,7 +144,7 @@ spec:
|
||||
version: "1.10.x"
|
||||
interval: 1h0m0s
|
||||
releaseName: sealed-secrets
|
||||
targetNamespace: gotk-system
|
||||
targetNamespace: flux-system
|
||||
```
|
||||
|
||||
!!! hint
|
||||
|
||||
@@ -35,7 +35,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: receiver
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
@@ -50,7 +50,7 @@ spec:
|
||||
Wait for Kubernetes to assign a public address with:
|
||||
|
||||
```sh
|
||||
watch kubectl -n gotk-system get svc/receiver
|
||||
watch kubectl -n flux-system get svc/receiver
|
||||
```
|
||||
|
||||
## Define a Git repository
|
||||
@@ -62,7 +62,7 @@ apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: webapp
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 60m
|
||||
url: https://github.com/<GH-ORG>/<GH-REPO>
|
||||
@@ -82,7 +82,7 @@ First generate a random string and create a secret with a `token` field:
|
||||
TOKEN=$(head -c 12 /dev/urandom | shasum | cut -d ' ' -f1)
|
||||
echo $TOKEN
|
||||
|
||||
kubectl -n gotk-system create secret generic webhook-token \
|
||||
kubectl -n flux-system create secret generic webhook-token \
|
||||
--from-literal=token=$TOKEN
|
||||
```
|
||||
|
||||
@@ -93,7 +93,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1beta1
|
||||
kind: Receiver
|
||||
metadata:
|
||||
name: webapp
|
||||
namespace: gotk-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
type: github
|
||||
events:
|
||||
@@ -116,7 +116,7 @@ The notification controller generates a unique URL using the provided token and
|
||||
Find the URL with:
|
||||
|
||||
```console
|
||||
$ kubectl -n gotk-system get receiver/webapp
|
||||
$ kubectl -n flux-system get receiver/webapp
|
||||
|
||||
NAME READY STATUS
|
||||
webapp True Receiver initialised with URL: /hook/bed6d00b5555b1603e1f59b94d7fdbca58089cb5663633fb83f2815dc626d92b
|
||||
|
||||
Reference in New Issue
Block a user