1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Rename 'gitops-system' namespace to 'gotk-system'

To align with the project name, and the group introduced in #236.
This commit is contained in:
Hidde Beydals
2020-09-15 15:51:55 +02:00
parent 0e1a862e34
commit ff6a1c14be
80 changed files with 162 additions and 162 deletions

View File

@@ -21,8 +21,8 @@ To be able to release a Helm chart, the source that contains the chart
the source-controller, so that the `HelmRelease` can reference to it.
A cluster administrator should register trusted sources by creating
the resources in the `gitops-system` namespace. By default, the
source-controller watches for sources only in the `gitops-system`
the resources in the `gotk-system` namespace. By default, the
source-controller watches for sources only in the `gotk-system`
namespace, this way cluster admins can prevent untrusted sources from
being registered by users.
@@ -42,7 +42,7 @@ apiVersion: source.toolkit.fluxcd.io/v1alpha1
kind: HelmRepository
metadata:
name: podinfo
namespace: gitops-system
namespace: gotk-system
spec:
interval: 1m
url: https://stefanprodan.github.io/podinfo
@@ -86,7 +86,7 @@ apiVersion: source.toolkit.fluxcd.io/v1alpha1
kind: GitRepository
metadata:
name: podinfo
namespace: gitops-system
namespace: gotk-system
spec:
interval: 1m
url: https://github.com/stefanprodan/podinfo
@@ -142,7 +142,7 @@ spec:
sourceRef:
kind: <HelmRepository|GitRepository>
name: podinfo
namespace: gitops-system
namespace: gotk-system
interval: 1m
values:
replicaCount: 2
@@ -221,7 +221,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 `gitops-system` to start receiving notifications about the Helm
the `gotk-system` to start receiving notifications about the Helm
release:
```yaml
@@ -230,7 +230,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1alpha1
metadata:
generation: 2
name: helm-podinfo
namespace: gitops-system
namespace: gotk-system
spec:
providerRef:
name: slack
@@ -260,7 +260,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 gitops-system create secret generic webhook-token \
kubectl -n gotk-system create secret generic webhook-token \
--from-literal=token=$TOKEN
```
@@ -271,7 +271,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1alpha1
kind: Receiver
metadata:
name: helm-podinfo
namespace: gitops-system
namespace: gotk-system
spec:
type: harbor
secretRef:
@@ -286,7 +286,7 @@ The notification-controller generates a unique URL using the provided token and
Find the URL with:
```console
$ kubectl -n gitops-system get receiver/helm-podinfo
$ kubectl -n gotk-system get receiver/helm-podinfo
NAME READY STATUS
helm-podinfo True Receiver initialised with URL: /hook/bed6d00b5555b1603e1f59b94d7fdbca58089cb5663633fb83f2815dc626d92b

View File

@@ -75,12 +75,12 @@ cluster e.g. `staging-cluster` and `production-cluster`:
```sh
├── staging-cluster # <- path=staging-cluster
│   └── gitops-system # <- namespace dir generated by bootstrap
│   └── gotk-system # <- namespace dir generated by bootstrap
│   ├── toolkit-components.yaml
│   ├── toolkit-kustomization.yaml
│   └── toolkit-source.yaml
└── production-cluster # <- path=production-cluster
└── gitops-system
└── gotk-system
```
!!! hint "Change the default branch"
@@ -185,7 +185,7 @@ cd my-repository
Create a directory inside the repository:
```sh
mkdir -p ./my-cluster/gitops-system
mkdir -p ./my-cluster/gotk-system
```
Generate the toolkit manifests with:
@@ -193,7 +193,7 @@ Generate the toolkit manifests with:
```sh
gotk install --version=latest \
--arch=amd64 \ # on ARM64/AARCH64 clusters use --arch=arm64
--export > ./my-cluster/gitops-system/toolkit-components.yaml
--export > ./my-cluster/gotk-system/toolkit-components.yaml
```
If your cluster must pull images from a private container registry, first you should pull
@@ -205,12 +205,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 `gitops-system` namespace:
Create the pull secret in the `gotk-system` namespace:
```sh
kubectl create ns gitops-system
kubectl create ns gotk-system
kubectl -n gitops-system create secret generic regcred \
kubectl -n gotk-system create secret generic regcred \
--from-file=.dockerconfigjson=/.docker/config.json \
--type=kubernetes.io/dockerconfigjson
```
@@ -221,7 +221,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/gitops-system/toolkit-components.yaml
--export > ./my-cluster/gotk-system/toolkit-components.yaml
```
Commit and push the manifest to the master branch:
@@ -233,7 +233,7 @@ git add -A && git commit -m "add toolkit manifests" && git push
Apply the manifests on your cluster:
```sh
kubectl apply -f ./my-cluster/gitops-system/toolkit-components.yaml
kubectl apply -f ./my-cluster/gotk-system/toolkit-components.yaml
```
Verify that the toolkit controllers have started:
@@ -245,7 +245,7 @@ gotk check
Create a `GitRepository` object on your cluster by specifying the SSH address of your repo:
```sh
gotk create source git gitops-system \
gotk create source git gotk-system \
--url= ssh://<host>/<org>/my-repository \
--ssh-key-algorithm=ecdsa \
--ssh-ecdsa-curve=p521 \
@@ -259,7 +259,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 gitops-system \
gotk create source git gotk-system \
--url=https://<host>/<org>/my-repository \
--username=my-username \
--password=my-password \
@@ -270,8 +270,8 @@ gotk create source git gitops-system \
Create a `Kustomization` object on your cluster:
```sh
gotk create kustomization gitops-system \
--source=gitops-system \
gotk create kustomization gotk-system \
--source=gotk-system \
--path="./my-cluster" \
--prune=true \
--interval=10m
@@ -280,11 +280,11 @@ gotk create kustomization gitops-system \
Export both objects, commit and push the manifests to Git:
```sh
gotk export source git gitops-system \
> ./my-cluster/gitops-system/toolkit-source.yaml
gotk export source git gotk-system \
> ./my-cluster/gotk-system/toolkit-source.yaml
gotk export kustomization gitops-system \
> ./my-cluster/gitops-system/toolkit-kustomization.yaml
gotk export kustomization gotk-system \
> ./my-cluster/gotk-system/toolkit-kustomization.yaml
git add -A && git commit -m "add toolkit reconciliation" && git push
```
@@ -293,7 +293,7 @@ To upgrade the toolkit to a newer version, run the install command and commit th
```sh
gotk install --version=latest \
--export > ./my-cluster/gitops-system/toolkit-components.yaml
--export > ./my-cluster/gotk-system/toolkit-components.yaml
git add -A && git commit -m "update toolkit" && git push
```
@@ -347,7 +347,7 @@ gotk create source helm stable \
gotk create helmrelease sealed-secrets \
--interval=1h \
--release-name=sealed-secrets \
--target-namespace=gitops-system \
--target-namespace=gotk-system \
--source=HelmRepository/stable \
--chart=sealed-secrets \
--chart-version="1.10.x"
@@ -356,7 +356,7 @@ gotk create helmrelease sealed-secrets \
## Monitoring with Prometheus and Grafana
The GitOps Toolkit comes with an optional monitoring stack.
You can install the stack in the `gitops-system` namespace with:
You can install the stack in the `gotk-system` namespace with:
```yaml
kustomize build github.com/fluxcd/toolkit/manifests/monitoring?ref=master | kubectl apply -f-
@@ -377,7 +377,7 @@ If you wish to use your own Prometheus and Grafana instances, then you can impor
!!! hint
Note that the toolkit controllers expose the `/metrics` endpoint on port `8080`.
When using Prometheus Operator you should create `PodMonitor` objects to configure scraping.
When Prometheus is running outside of the `gitops-system` namespace, you have to create a network policy
When Prometheus is running outside of the `gotk-system` namespace, you have to create a network policy
that allows traffic on port `8080` from the namespace where Prometheus is deployed.
## Uninstall

View File

@@ -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 `gitops-system` namespace:
create a Kubernetes secret named `sops-gpg` in the `gotk-system` namespace:
```sh
gpg --export-secret-keys \
--armor 1F3D1CED2F865F5E59CA564553241F147E7C5FA4 |
kubectl create secret generic sops-gpg \
--namespace=gitops-system \
--namespace=gotk-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
`gitops-system` namespace for kustomize-controller to be able to fetch
`gotk-system` namespace for kustomize-controller to be able to fetch
keys from KMS.
## GitOps workflow
@@ -119,7 +119,7 @@ apiVersion: source.toolkit.fluxcd.io/v1alpha1
kind: GitRepository
metadata:
name: my-secrets
namespace: gitops-system
namespace: gotk-system
spec:
interval: 1m
url: https://github.com/my-org/my-secrets
@@ -132,7 +132,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1alpha1
kind: Kustomization
metadata:
name: my-secrets
namespace: gitops-system
namespace: gotk-system
spec:
interval: 10m0s
sourceRef:

View File

@@ -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 gitops-system create secret generic slack-url \
kubectl -n gotk-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/v1alpha1
kind: Provider
metadata:
name: slack
namespace: gitops-system
namespace: gotk-system
spec:
type: slack
channel: general
@@ -61,7 +61,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1alpha1
kind: Alert
metadata:
name: on-call-webapp
namespace: gitops-system
namespace: gotk-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 gitops-system get alerts
$ kubectl -n gotk-system get alerts
NAME READY STATUS AGE
on-call-webapp True Initialized 1m
@@ -121,7 +121,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1alpha1
kind: Provider
metadata:
name: podinfo
namespace: gitops-system
namespace: gotk-system
spec:
type: github
channel: general
@@ -133,7 +133,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1alpha1
kind: Alert
metadata:
name: podinfo
namespace: gitops-system
namespace: gotk-system
spec:
providerRef:
name: podinfo
@@ -141,7 +141,7 @@ spec:
eventSources:
- kind: Kustomization
name: podinfo
namespace: gitops-system
namespace: gotk-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)
@@ -151,7 +151,7 @@ apiVersion: v1
kind: Secret
metadata:
name: github
namespace: gitops-system
namespace: gotk-system
data:
token: <token>
```

View File

@@ -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=gitops-system \
--target-namespace=gotk-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 `gitops-system` namespace.
persists the private and public keys as Kubernetes secrets in the `gotk-system` namespace.
You can retrieve the public key with:
```sh
kubeseal --fetch-cert \
--controller-name=sealed-secrets \
--controller-namespace=gitops-system \
--controller-namespace=gotk-system \
> pub-sealed-secrets.pem
```
@@ -120,7 +120,7 @@ apiVersion: source.toolkit.fluxcd.io/v1alpha1
kind: HelmRepository
metadata:
name: stable
namespace: gitops-system
namespace: gotk-system
spec:
interval: 1h0m0s
url: https://kubernetes-charts.storage.googleapis.com
@@ -133,7 +133,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2alpha1
kind: HelmRelease
metadata:
name: sealed-secrets
namespace: gitops-system
namespace: gotk-system
spec:
chart:
spec:
@@ -144,7 +144,7 @@ spec:
version: "1.10.x"
interval: 1h0m0s
releaseName: sealed-secrets
targetNamespace: gitops-system
targetNamespace: gotk-system
```
!!! hint

View File

@@ -35,7 +35,7 @@ apiVersion: v1
kind: Service
metadata:
name: receiver
namespace: gitops-system
namespace: gotk-system
spec:
type: LoadBalancer
selector:
@@ -50,7 +50,7 @@ spec:
Wait for Kubernetes to assign a public address with:
```sh
watch kubectl -n gitops-system get svc/receiver
watch kubectl -n gotk-system get svc/receiver
```
## Define a Git repository
@@ -62,7 +62,7 @@ apiVersion: source.toolkit.fluxcd.io/v1alpha1
kind: GitRepository
metadata:
name: webapp
namespace: gitops-system
namespace: gotk-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 gitops-system create secret generic webhook-token \
kubectl -n gotk-system create secret generic webhook-token \
--from-literal=token=$TOKEN
```
@@ -93,7 +93,7 @@ apiVersion: notification.toolkit.fluxcd.io/v1alpha1
kind: Receiver
metadata:
name: webapp
namespace: gitops-system
namespace: gotk-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 gitops-system get receiver/webapp
$ kubectl -n gotk-system get receiver/webapp
NAME READY STATUS
webapp True Receiver initialised with URL: /hook/bed6d00b5555b1603e1f59b94d7fdbca58089cb5663633fb83f2815dc626d92b