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