Compare commits
120 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebf742d272 | ||
|
|
a7b1b04920 | ||
|
|
1218d6abe8 | ||
|
|
f9d546676b | ||
|
|
afef6960b9 | ||
|
|
f6626b8975 | ||
|
|
b1e66f81ab | ||
|
|
9cc018e618 | ||
|
|
797cd9bea2 | ||
|
|
9dbfca3d7a | ||
|
|
f18d1efdcb | ||
|
|
29a9b89224 | ||
|
|
11b5b9808b | ||
|
|
ca1f84d22b | ||
|
|
d6c6c88e6e | ||
|
|
ee33702463 | ||
|
|
8b6995e9ec | ||
|
|
36ba8f0fcb | ||
|
|
bfb560ec50 | ||
|
|
78bb11dcbf | ||
|
|
5c8d00665f | ||
|
|
f4d78cc08e | ||
|
|
2aa395ba12 | ||
|
|
ac862e6822 | ||
|
|
1b55ead16e | ||
|
|
b24727ec22 | ||
|
|
2768926683 | ||
|
|
3f07bd6471 | ||
|
|
2f861f19c0 | ||
|
|
6b397cff73 | ||
|
|
44a3cf86d3 | ||
|
|
dfb0a40293 | ||
|
|
7719dd378b | ||
|
|
c9f8e43681 | ||
|
|
4a7538041d | ||
|
|
dd3b2288e2 | ||
|
|
496abc3a98 | ||
|
|
8b9abfb26e | ||
|
|
330e21e2ba | ||
|
|
e53d0dadbf | ||
|
|
fa56685767 | ||
|
|
2727f4b92d | ||
|
|
0f74f65af8 | ||
|
|
8e03968370 | ||
|
|
969f181f3e | ||
|
|
cc18077192 | ||
|
|
47d07b2326 | ||
|
|
a96bb72fb8 | ||
|
|
75364dd5b4 | ||
|
|
22624ae4d5 | ||
|
|
cb23d3ff3c | ||
|
|
e751bdc8a9 | ||
|
|
2078d048a1 | ||
|
|
22ff25269d | ||
|
|
1ee9a6a39d | ||
|
|
50efd865d9 | ||
|
|
d688d3837f | ||
|
|
6cb438440d | ||
|
|
2c5771d9e8 | ||
|
|
0ce06116e6 | ||
|
|
706bc0fdfe | ||
|
|
0b5b1ba11a | ||
|
|
0ed8ca961e | ||
|
|
31d4b62bf3 | ||
|
|
35d6172d06 | ||
|
|
b5ed8f0183 | ||
|
|
7cb3bb0d4e | ||
|
|
d27d42d9ca | ||
|
|
e2fd6e8f86 | ||
|
|
a8e534a8a4 | ||
|
|
479d7575fa | ||
|
|
4707a3075e | ||
|
|
21a189e0b7 | ||
|
|
ab7ff6551f | ||
|
|
248961d58c | ||
|
|
473e226883 | ||
|
|
2ebb06d330 | ||
|
|
cc88e68c4e | ||
|
|
f8704747d9 | ||
|
|
0c33df883c | ||
|
|
3fbc396bc8 | ||
|
|
17df7a46e2 | ||
|
|
925c1d3d8e | ||
|
|
1976d4cc1b | ||
|
|
d98578f260 | ||
|
|
8d1dddf205 | ||
|
|
2584b6ca5b | ||
|
|
70897cebfe | ||
|
|
0e80cd5c44 | ||
|
|
b979e313b2 | ||
|
|
533cb42d29 | ||
|
|
35a209903e | ||
|
|
824de61579 | ||
|
|
17ca3f8ac2 | ||
|
|
87a299736e | ||
|
|
e86286722a | ||
|
|
c4a0724c8d | ||
|
|
17139f34dd | ||
|
|
1779714b0d | ||
|
|
1ff4495737 | ||
|
|
02c0dc1217 | ||
|
|
fb43c194b9 | ||
|
|
ae94bb56d9 | ||
|
|
123433c4ea | ||
|
|
58619076ea | ||
|
|
a50d1c5784 | ||
|
|
91c8cb197f | ||
|
|
427c60618f | ||
|
|
2d417f200d | ||
|
|
54b11e7b25 | ||
|
|
50d2eb7d57 | ||
|
|
dfb20dd1ca | ||
|
|
4f22016f13 | ||
|
|
430a2d0454 | ||
|
|
db23c8ce9f | ||
|
|
ffd4784916 | ||
|
|
750830c302 | ||
|
|
d245ef9b39 | ||
|
|
c8586d1ef4 | ||
|
|
316cba1cb8 |
6
.github/actions/kustomize/Dockerfile
vendored
6
.github/actions/kustomize/Dockerfile
vendored
@@ -1,6 +0,0 @@
|
|||||||
FROM giantswarm/tiny-tools
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
9
.github/actions/kustomize/action.yml
vendored
9
.github/actions/kustomize/action.yml
vendored
@@ -1,9 +0,0 @@
|
|||||||
name: 'kustomize'
|
|
||||||
description: 'A GitHub Action to run kustomize commands'
|
|
||||||
author: 'Stefan Prodan'
|
|
||||||
branding:
|
|
||||||
icon: 'command'
|
|
||||||
color: 'blue'
|
|
||||||
runs:
|
|
||||||
using: 'docker'
|
|
||||||
image: 'Dockerfile'
|
|
||||||
12
.github/actions/kustomize/entrypoint.sh
vendored
12
.github/actions/kustomize/entrypoint.sh
vendored
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh -l
|
|
||||||
|
|
||||||
VERSION=3.5.4
|
|
||||||
curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${VERSION}/kustomize_v${VERSION}_linux_amd64.tar.gz | tar xz
|
|
||||||
|
|
||||||
mkdir -p $GITHUB_WORKSPACE/bin
|
|
||||||
cp ./kustomize $GITHUB_WORKSPACE/bin
|
|
||||||
chmod +x $GITHUB_WORKSPACE/bin/kustomize
|
|
||||||
ls -lh $GITHUB_WORKSPACE/bin
|
|
||||||
|
|
||||||
echo "::add-path::$GITHUB_WORKSPACE/bin"
|
|
||||||
echo "::add-path::$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin"
|
|
||||||
74
.github/workflows/bootstrap.yaml
vendored
Normal file
74
.github/workflows/bootstrap.yaml
vendored
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
name: bootstrap
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
github:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Restore Go cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.14.x
|
||||||
|
- name: Setup Kubernetes
|
||||||
|
uses: engineerd/setup-kind@v0.4.0
|
||||||
|
- name: Set outputs
|
||||||
|
id: vars
|
||||||
|
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||||
|
- name: Build
|
||||||
|
run: sudo go build -o ./bin/gotk ./cmd/gotk
|
||||||
|
- name: bootstrap init
|
||||||
|
run: |
|
||||||
|
./bin/gotk bootstrap github \
|
||||||
|
--owner=fluxcd-testing \
|
||||||
|
--repository=gotk-test-${{ steps.vars.outputs.sha_short }} \
|
||||||
|
--path=test-cluster
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||||
|
- name: bootstrap no-op
|
||||||
|
run: |
|
||||||
|
./bin/gotk bootstrap github \
|
||||||
|
--owner=fluxcd-testing \
|
||||||
|
--repository=gotk-test-${{ steps.vars.outputs.sha_short }} \
|
||||||
|
--path=test-cluster
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||||
|
- name: uninstall
|
||||||
|
run: |
|
||||||
|
./bin/gotk suspend kustomization gitops-system
|
||||||
|
./bin/gotk uninstall --resources --crds -s
|
||||||
|
- name: bootstrap reinstall
|
||||||
|
run: |
|
||||||
|
./bin/gotk bootstrap github \
|
||||||
|
--owner=fluxcd-testing \
|
||||||
|
--repository=gotk-test-${{ steps.vars.outputs.sha_short }} \
|
||||||
|
--path=test-cluster
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||||
|
- name: delete repository
|
||||||
|
run: |
|
||||||
|
./bin/gotk bootstrap github \
|
||||||
|
--owner=fluxcd-testing \
|
||||||
|
--repository=gotk-test-${{ steps.vars.outputs.sha_short }} \
|
||||||
|
--path=test-cluster \
|
||||||
|
--delete
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||||
|
- name: Debug failure
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
kubectl -n gitops-system get all
|
||||||
|
kubectl -n gitops-system logs deploy/source-controller
|
||||||
|
kubectl -n gitops-system logs deploy/kustomize-controller
|
||||||
56
.github/workflows/docs.yaml
vendored
56
.github/workflows/docs.yaml
vendored
@@ -14,29 +14,47 @@ jobs:
|
|||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Copy assets
|
- name: Copy assets
|
||||||
run: |
|
run: |
|
||||||
# source-controller CRDs
|
controller_version() {
|
||||||
curl https://raw.githubusercontent.com/fluxcd/source-controller/master/docs/api/source.md > docs/components/source/api.md
|
sed -n "s/\(.*$1\/.*?ref=\)//p;n" "manifests/bases/$1/kustomization.yaml"
|
||||||
curl https://raw.githubusercontent.com/fluxcd/source-controller/master/docs/spec/v1alpha1/gitrepositories.md > docs/components/source/gitrepositories.md
|
}
|
||||||
curl https://raw.githubusercontent.com/fluxcd/source-controller/master/docs/spec/v1alpha1/helmrepositories.md > docs/components/source/helmrepositories.md
|
|
||||||
curl https://raw.githubusercontent.com/fluxcd/source-controller/master/docs/spec/v1alpha1/helmcharts.md > docs/components/source/helmcharts.md
|
|
||||||
|
|
||||||
# kustomize-controller CRDs
|
{
|
||||||
curl https://raw.githubusercontent.com/fluxcd/kustomize-controller/master/docs/api/kustomize.md > docs/components/kustomize/api.md
|
# source-controller CRDs
|
||||||
curl https://raw.githubusercontent.com/fluxcd/kustomize-controller/master/docs/spec/v1alpha1/kustomization.md > docs/components/kustomize/kustomization.md
|
SOURCE_VER=$(controller_version source-controller)
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/gitrepositories.md" > docs/components/source/gitrepositories.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/helmrepositories.md" > docs/components/source/helmrepositories.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/helmcharts.md" > docs/components/source/helmcharts.md
|
||||||
|
}
|
||||||
|
|
||||||
# helm-controller CRDs
|
{
|
||||||
curl https://raw.githubusercontent.com/fluxcd/helm-controller/master/docs/api/helmrelease.md > docs/components/helm/api.md
|
# kustomize-controller CRDs
|
||||||
curl https://raw.githubusercontent.com/fluxcd/helm-controller/master/docs/spec/v2alpha1/helmreleases.md > docs/components/helm/helmreleases.md
|
KUSTOMIZE_VER=$(controller_version kustomize-controller)
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/api/kustomize.md" > docs/components/kustomize/api.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/spec/v1alpha1/kustomization.md" > docs/components/kustomize/kustomization.md
|
||||||
|
}
|
||||||
|
|
||||||
# notification-controller CRDs
|
{
|
||||||
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/api/notification.md > docs/components/notification/api.md
|
# helm-controller CRDs
|
||||||
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/event.md > docs/components/notification/event.md
|
HELM_VER=$(controller_version helm-controller)
|
||||||
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/alert.md > docs/components/notification/alert.md
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/api/helmrelease.md" > docs/components/helm/api.md
|
||||||
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/provider.md > docs/components/notification/provider.md
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/spec/v2alpha1/helmreleases.md" > docs/components/helm/helmreleases.md
|
||||||
curl https://raw.githubusercontent.com/fluxcd/notification-controller/master/docs/spec/v1alpha1/receiver.md > docs/components/notification/receiver.md
|
}
|
||||||
|
|
||||||
# install script
|
{
|
||||||
cp install/tk.sh docs/install.sh
|
# notification-controller CRDs
|
||||||
|
NOTIFICATION_VER=$(controller_version notification-controller)
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/api/notification.md" > docs/components/notification/api.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/event.md" > docs/components/notification/event.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/alert.md" > docs/components/notification/alert.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/provider.md" > docs/components/notification/provider.md
|
||||||
|
curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/receiver.md" > docs/components/notification/receiver.md
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
# install script
|
||||||
|
cp install/gotk.sh docs/install.sh
|
||||||
|
}
|
||||||
- name: Deploy docs
|
- name: Deploy docs
|
||||||
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
||||||
env:
|
env:
|
||||||
|
|||||||
103
.github/workflows/e2e.yaml
vendored
103
.github/workflows/e2e.yaml
vendored
@@ -37,30 +37,30 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- name: Build
|
- name: Build
|
||||||
run: sudo go build -o ./bin/tk ./cmd/tk
|
run: sudo go build -o ./bin/gotk ./cmd/gotk
|
||||||
- name: tk check --pre
|
- name: gotk check --pre
|
||||||
run: |
|
run: |
|
||||||
./bin/tk check --pre
|
./bin/gotk check --pre
|
||||||
- name: tk install --version
|
- name: gotk install --version
|
||||||
run: |
|
run: |
|
||||||
./bin/tk install --version=master --namespace=test --verbose --components="source-controller,kustomize-controller"
|
./bin/gotk install --version=master --namespace=test --verbose --components="source-controller,kustomize-controller"
|
||||||
- name: tk uninstall
|
- name: gotk uninstall
|
||||||
run: |
|
run: |
|
||||||
./bin/tk uninstall --namespace=test --crds --silent
|
./bin/gotk uninstall --namespace=test --crds --silent
|
||||||
- name: tk install --manifests
|
- name: gotk install --manifests
|
||||||
run: |
|
run: |
|
||||||
./bin/tk install --manifests ./manifests/install/ --version=""
|
./bin/gotk install --manifests ./manifests/install/ --version=""
|
||||||
- name: tk create source git
|
- name: gotk create source git
|
||||||
run: |
|
run: |
|
||||||
./bin/tk create source git podinfo \
|
./bin/gotk create source git podinfo \
|
||||||
--url https://github.com/stefanprodan/podinfo \
|
--url https://github.com/stefanprodan/podinfo \
|
||||||
--tag-semver=">=3.2.3"
|
--tag-semver=">=3.2.3"
|
||||||
- name: tk get sources git
|
- name: gotk get sources git
|
||||||
run: |
|
run: |
|
||||||
./bin/tk get sources git
|
./bin/gotk get sources git
|
||||||
- name: tk create kustomization
|
- name: gotk create kustomization
|
||||||
run: |
|
run: |
|
||||||
./bin/tk create kustomization podinfo \
|
./bin/gotk create kustomization podinfo \
|
||||||
--source=podinfo \
|
--source=podinfo \
|
||||||
--path="./deploy/overlays/dev" \
|
--path="./deploy/overlays/dev" \
|
||||||
--prune=true \
|
--prune=true \
|
||||||
@@ -69,54 +69,63 @@ jobs:
|
|||||||
--health-check="Deployment/frontend.dev" \
|
--health-check="Deployment/frontend.dev" \
|
||||||
--health-check="Deployment/backend.dev" \
|
--health-check="Deployment/backend.dev" \
|
||||||
--health-check-timeout=3m
|
--health-check-timeout=3m
|
||||||
- name: tk sync kustomization --with-source
|
- name: gotk sync kustomization --with-source
|
||||||
run: |
|
run: |
|
||||||
./bin/tk reconcile kustomization podinfo --with-source
|
./bin/gotk reconcile kustomization podinfo --with-source
|
||||||
- name: tk get kustomizations
|
- name: gotk get kustomizations
|
||||||
run: |
|
run: |
|
||||||
./bin/tk get kustomizations
|
./bin/gotk get kustomizations
|
||||||
- name: tk suspend kustomization
|
- name: gotk suspend kustomization
|
||||||
run: |
|
run: |
|
||||||
./bin/tk suspend kustomization podinfo
|
./bin/gotk suspend kustomization podinfo
|
||||||
- name: tk resume kustomization
|
- name: gotk resume kustomization
|
||||||
run: |
|
run: |
|
||||||
./bin/tk resume kustomization podinfo
|
./bin/gotk resume kustomization podinfo
|
||||||
- name: tk export
|
- name: gotk export
|
||||||
run: |
|
run: |
|
||||||
./bin/tk export source git --all
|
./bin/gotk export source git --all
|
||||||
./bin/tk export kustomization --all
|
./bin/gotk export kustomization --all
|
||||||
- name: tk delete kustomization
|
- name: gotk delete kustomization
|
||||||
run: |
|
run: |
|
||||||
./bin/tk delete kustomization podinfo --silent
|
./bin/gotk delete kustomization podinfo --silent
|
||||||
- name: tk delete source git
|
- name: gotk create source helm
|
||||||
run: |
|
run: |
|
||||||
./bin/tk delete source git podinfo --silent
|
./bin/gotk create source helm podinfo \
|
||||||
- name: tk create source helm
|
|
||||||
run: |
|
|
||||||
./bin/tk create source helm podinfo \
|
|
||||||
--url https://stefanprodan.github.io/podinfo
|
--url https://stefanprodan.github.io/podinfo
|
||||||
- name: tk create helmrelease
|
- name: gotk create helmrelease --source=HelmRepository/podinfo
|
||||||
run: |
|
run: |
|
||||||
./bin/tk create hr podinfo \
|
./bin/gotk create hr podinfo-helm \
|
||||||
--target-namespace=default \
|
--target-namespace=default \
|
||||||
--source=podinfo \
|
--source=HelmRepository/podinfo \
|
||||||
--chart-name=podinfo \
|
--chart=podinfo \
|
||||||
--chart-version=">4.0.0 <5.0.0"
|
--chart-version=">4.0.0 <5.0.0"
|
||||||
- name: tk get helmreleases
|
- name: gotk create helmrelease --source=GitRepository/podinfo
|
||||||
run: |
|
run: |
|
||||||
./bin/tk get helmreleases
|
./bin/gotk create hr podinfo-git \
|
||||||
- name: tk export helmrelease
|
--target-namespace=default \
|
||||||
|
--source=GitRepository/podinfo \
|
||||||
|
--chart=./charts/podinfo
|
||||||
|
- name: gotk get helmreleases
|
||||||
run: |
|
run: |
|
||||||
./bin/tk export hr --all
|
./bin/gotk get helmreleases
|
||||||
- name: tk delete helmrelease
|
- name: gotk export helmrelease
|
||||||
run: |
|
run: |
|
||||||
./bin/tk delete hr podinfo --silent
|
./bin/gotk export hr --all
|
||||||
- name: tk delete source helm
|
- name: gotk delete helmrelease podinfo-helm
|
||||||
run: |
|
run: |
|
||||||
./bin/tk delete source helm podinfo --silent
|
./bin/gotk delete hr podinfo-helm --silent
|
||||||
- name: tk check
|
- name: gotk delete helmrelease podinfo-git
|
||||||
run: |
|
run: |
|
||||||
./bin/tk check
|
./bin/gotk delete hr podinfo-git --silent
|
||||||
|
- name: gotk delete source helm
|
||||||
|
run: |
|
||||||
|
./bin/gotk delete source helm podinfo --silent
|
||||||
|
- name: gotk delete source git
|
||||||
|
run: |
|
||||||
|
./bin/gotk delete source git podinfo --silent
|
||||||
|
- name: gotk check
|
||||||
|
run: |
|
||||||
|
./bin/gotk check
|
||||||
- name: Debug failure
|
- name: Debug failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
5
.github/workflows/release.yaml
vendored
5
.github/workflows/release.yaml
vendored
@@ -24,9 +24,9 @@ jobs:
|
|||||||
- name: Generate release notes
|
- name: Generate release notes
|
||||||
run: |
|
run: |
|
||||||
echo 'CHANGELOG' > /tmp/release.txt
|
echo 'CHANGELOG' > /tmp/release.txt
|
||||||
github-release-notes -org fluxcd -repo toolkit -since-latest-release >> /tmp/release.txt
|
github-release-notes -org fluxcd -repo toolkit -since-latest-release -include-author >> /tmp/release.txt
|
||||||
- name: Setup Kustomize
|
- name: Setup Kustomize
|
||||||
uses: ./.github/actions/kustomize
|
uses: fluxcd/pkg//actions/kustomize@master
|
||||||
- name: Generate manifests tarball
|
- name: Generate manifests tarball
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./output
|
mkdir -p ./output
|
||||||
@@ -82,3 +82,4 @@ jobs:
|
|||||||
args: release --release-notes=/tmp/release.txt --skip-validate
|
args: release --release-notes=/tmp/release.txt --skip-validate
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
|
|||||||
73
.github/workflows/update.yml
vendored
Normal file
73
.github/workflows/update.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
name: Update Components
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "*/10 * * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-components:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Update component versions
|
||||||
|
id: update
|
||||||
|
run: |
|
||||||
|
PR_BODY=""
|
||||||
|
|
||||||
|
bump_version() {
|
||||||
|
local RELEASE_VERSION=$(curl -s https://api.github.com/repos/fluxcd/$1/releases | jq -r 'sort_by(.published_at) | .[-1] | .tag_name')
|
||||||
|
local CURRENT_VERSION=$(sed -n "s/\(.*$1\/.*?ref=\)//p;n" "manifests/bases/$1/kustomization.yaml")
|
||||||
|
|
||||||
|
if [[ "${RELEASE_VERSION}" != "${CURRENT_VERSION}" ]]; then
|
||||||
|
# bump kustomize
|
||||||
|
sed -i "s/\($1\/.*?ref=\).*/\1${RELEASE_VERSION}/g" "manifests/bases/$1/kustomization.yaml"
|
||||||
|
|
||||||
|
if [[ ! -z $(go list -m all | grep "github.com/fluxcd/$1/api" | awk '{print $2}') ]]; then
|
||||||
|
# bump go mod
|
||||||
|
go mod edit -require="github.com/fluxcd/$1/api@${RELEASE_VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PR_BODY="$PR_BODY- $1 to ${RELEASE_VERSION}%0A"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
# bump controller versions
|
||||||
|
bump_version helm-controller
|
||||||
|
bump_version kustomize-controller
|
||||||
|
bump_version source-controller
|
||||||
|
bump_version notification-controller
|
||||||
|
|
||||||
|
# add missing and remove unused modules
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
# diff change
|
||||||
|
git diff
|
||||||
|
|
||||||
|
# export PR_BODY for PR
|
||||||
|
echo "::set-output name=pr_body::$PR_BODY"
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
id: cpr
|
||||||
|
uses: peter-evans/create-pull-request@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
commit-message: Update toolkit components
|
||||||
|
committer: GitHub <noreply@github.com>
|
||||||
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||||
|
title: Update toolkit components
|
||||||
|
body: |
|
||||||
|
${{ steps.update.outputs.pr_body }}
|
||||||
|
|
||||||
|
Auto-generated by [create-pull-request][1]
|
||||||
|
|
||||||
|
[1]: https://github.com/peter-evans/create-pull-request
|
||||||
|
branch: update-components
|
||||||
|
reviewers: ${{ secrets.ASSIGNEES }}
|
||||||
|
|
||||||
|
- name: Check output
|
||||||
|
run: |
|
||||||
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||||
@@ -1,16 +1,31 @@
|
|||||||
builds:
|
builds:
|
||||||
- main: ./cmd/tk
|
- main: ./cmd/gotk
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.VERSION={{ .Version }}
|
- -s -w -X main.VERSION={{ .Version }}
|
||||||
binary: tk
|
binary: gotk
|
||||||
goos:
|
goos:
|
||||||
- darwin
|
- darwin
|
||||||
- linux
|
- linux
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
|
- arm64
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
archives:
|
archives:
|
||||||
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||||
files:
|
files:
|
||||||
- none*
|
- none*
|
||||||
|
brews:
|
||||||
|
- name: gotk
|
||||||
|
tap:
|
||||||
|
owner: fluxcd
|
||||||
|
name: homebrew-tap
|
||||||
|
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
||||||
|
folder: Formula
|
||||||
|
homepage: "https://toolkit.fluxcd.io/"
|
||||||
|
description: "GitOps Toolkit CLI"
|
||||||
|
dependencies:
|
||||||
|
- name: kubectl
|
||||||
|
type: optional
|
||||||
|
test: |
|
||||||
|
system "#{bin}/gotk --version"
|
||||||
|
|||||||
@@ -18,16 +18,39 @@ organization.
|
|||||||
|
|
||||||
## Communications
|
## Communications
|
||||||
|
|
||||||
The project uses Slack: To join the conversation, simply join the
|
For realtime communications we use Slack: To join the conversation, simply
|
||||||
[CNCF](https://slack.cncf.io/) Slack workspace and use the
|
join the [CNCF](https://slack.cncf.io/) Slack workspace and use the
|
||||||
[#flux-dev](https://cloud-native.slack.com/messages/flux-dev/) channel.
|
[#flux-dev](https://cloud-native.slack.com/messages/flux-dev/) channel.
|
||||||
|
|
||||||
The developers use a mailing list to discuss development as well.
|
To discuss ideas and specifications we use [Github
|
||||||
Simply subscribe to [flux-dev on cncf.io](https://lists.cncf.io/g/cncf-flux-dev)
|
Discussions](https://github.com/fluxcd/toolkit/discussions).
|
||||||
to join the conversation (this will also add an invitation to your
|
|
||||||
Google calendar for our [Flux
|
For announcements we use a mailing list as well. Simply subscribe to
|
||||||
|
[flux-dev on cncf.io](https://lists.cncf.io/g/cncf-flux-dev)
|
||||||
|
to join the conversation (there you can also add calendar invites
|
||||||
|
to your Google calendar for our [Flux
|
||||||
meeting](https://docs.google.com/document/d/1l_M0om0qUEN_NNiGgpqJ2tvsF2iioHkaARDeh6b70B0/edit#)).
|
meeting](https://docs.google.com/document/d/1l_M0om0qUEN_NNiGgpqJ2tvsF2iioHkaARDeh6b70B0/edit#)).
|
||||||
|
|
||||||
|
## Understanding the GitOps Toolkit
|
||||||
|
|
||||||
|
If you are entirely new to the GitOps Toolkit,
|
||||||
|
you might want to take a look at the [introductory talk and demo](https://www.youtube.com/watch?v=qQBtSkgl7tI).
|
||||||
|
|
||||||
|
This project is composed of:
|
||||||
|
|
||||||
|
- [/f/toolkit](https://github.com/fluxcd/toolkit): The GitOps Toolkit CLI
|
||||||
|
- [/f/source-manager](https://github.com/fluxcd/source-controller): Kubernetes operator for managing sources
|
||||||
|
- [/f/kustomize-controller](https://github.com/fluxcd/kustomize-controller): Kubernetes operator for building GitOps pipelines with Kustomize
|
||||||
|
- [/f/helm-controller](https://github.com/fluxcd/helm-controller): Kubernetes operator for building GitOps pipelines with Helm
|
||||||
|
- [/f/notification-controller](https://github.com/fluxcd/notification-controller): Kubernetes operator for handling inbound and outbound events
|
||||||
|
|
||||||
|
### Understanding the code
|
||||||
|
|
||||||
|
To get started with developing controllers, you might want to review
|
||||||
|
[our guide](https://toolkit.fluxcd.io/dev-guides/source-watcher/) which
|
||||||
|
walks you through writing a short and concise controller that watches out
|
||||||
|
for source changes.
|
||||||
|
|
||||||
### How to run the test suite
|
### How to run the test suite
|
||||||
|
|
||||||
You can run the unit tests by simply doing
|
You can run the unit tests by simply doing
|
||||||
@@ -66,16 +89,3 @@ For the GitOps Toolkit controllers we prefer the following rules for good commit
|
|||||||
|
|
||||||
The [following article](https://chris.beams.io/posts/git-commit/#seven-rules)
|
The [following article](https://chris.beams.io/posts/git-commit/#seven-rules)
|
||||||
has some more helpful advice on documenting your work.
|
has some more helpful advice on documenting your work.
|
||||||
|
|
||||||
## Understanding the GitOps Toolkit
|
|
||||||
|
|
||||||
If you are entirely new to the GitOps Toolkit,
|
|
||||||
you might want to take a look at the [introductory talk and demo](https://www.youtube.com/watch?v=qQBtSkgl7tI).
|
|
||||||
|
|
||||||
This project is composed of:
|
|
||||||
|
|
||||||
- [/f/toolkit](https://github.com/fluxcd/toolkit): The GitOps Toolkit CLI
|
|
||||||
- [/f/source-manager](https://github.com/fluxcd/source-controller): Kubernetes operator for managing sources
|
|
||||||
- [/f/kustomize-controller](https://github.com/fluxcd/kustomize-controller): Kubernetes operator for building GitOps pipelines with Kustomize
|
|
||||||
- [/f/helm-controller](https://github.com/fluxcd/helm-controller): Kubernetes operator for building GitOps pipelines with Helm
|
|
||||||
- [/f/notification-controller](https://github.com/fluxcd/notification-controller): Kubernetes operator for handling inbound and outbound events
|
|
||||||
|
|||||||
10
Makefile
10
Makefile
@@ -1,4 +1,4 @@
|
|||||||
VERSION?=$(shell grep 'VERSION' cmd/tk/main.go | awk '{ print $$4 }' | tr -d '"')
|
VERSION?=$(shell grep 'VERSION' cmd/gotk/main.go | awk '{ print $$4 }' | tr -d '"')
|
||||||
|
|
||||||
all: test build
|
all: test build
|
||||||
|
|
||||||
@@ -15,14 +15,14 @@ test: tidy fmt vet docs
|
|||||||
go test ./... -coverprofile cover.out
|
go test ./... -coverprofile cover.out
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 go build -o ./bin/tk ./cmd/tk
|
CGO_ENABLED=0 go build -o ./bin/gotk ./cmd/gotk
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install cmd/tk
|
go install cmd/gotk
|
||||||
|
|
||||||
.PHONY: docs
|
.PHONY: docs
|
||||||
docs:
|
docs:
|
||||||
mkdir -p ./docs/cmd && go run ./cmd/tk/ docgen
|
mkdir -p ./docs/cmd && go run ./cmd/gotk/ docgen
|
||||||
|
|
||||||
install-dev:
|
install-dev:
|
||||||
CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/tk
|
CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/gotk
|
||||||
|
|||||||
@@ -7,6 +7,6 @@
|
|||||||
|
|
||||||
Experimental toolkit for assembling CD pipelines the GitOps way.
|
Experimental toolkit for assembling CD pipelines the GitOps way.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
To get started with the toolkit please read the [docs](https://toolkit.fluxcd.io/).
|
To get started with the toolkit please read the [docs](https://toolkit.fluxcd.io/).
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sigs.k8s.io/yaml"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -33,6 +32,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
"sigs.k8s.io/yaml"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1"
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||||
@@ -49,10 +49,12 @@ var (
|
|||||||
bootstrapComponents []string
|
bootstrapComponents []string
|
||||||
bootstrapRegistry string
|
bootstrapRegistry string
|
||||||
bootstrapImagePullSecret string
|
bootstrapImagePullSecret string
|
||||||
|
bootstrapArch string
|
||||||
|
bootstrapBranch string
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
bootstrapBranch = "master"
|
bootstrapDefaultBranch = "master"
|
||||||
bootstrapInstallManifest = "toolkit-components.yaml"
|
bootstrapInstallManifest = "toolkit-components.yaml"
|
||||||
bootstrapSourceManifest = "toolkit-source.yaml"
|
bootstrapSourceManifest = "toolkit-source.yaml"
|
||||||
bootstrapKustomizationManifest = "toolkit-kustomization.yaml"
|
bootstrapKustomizationManifest = "toolkit-kustomization.yaml"
|
||||||
@@ -63,22 +65,26 @@ func init() {
|
|||||||
"toolkit version")
|
"toolkit version")
|
||||||
bootstrapCmd.PersistentFlags().StringSliceVar(&bootstrapComponents, "components", defaultComponents,
|
bootstrapCmd.PersistentFlags().StringSliceVar(&bootstrapComponents, "components", defaultComponents,
|
||||||
"list of components, accepts comma-separated values")
|
"list of components, accepts comma-separated values")
|
||||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapRegistry, "registry", "docker.io/fluxcd",
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapRegistry, "registry", "ghcr.io/fluxcd",
|
||||||
"container registry where the toolkit images are published")
|
"container registry where the toolkit images are published")
|
||||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapImagePullSecret, "image-pull-secret", "",
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapImagePullSecret, "image-pull-secret", "",
|
||||||
"Kubernetes secret name used for pulling the toolkit images from a private registry")
|
"Kubernetes secret name used for pulling the toolkit images from a private registry")
|
||||||
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArch, "arch", "amd64",
|
||||||
|
"arch can be amd64 or arm64")
|
||||||
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapBranch, "branch", bootstrapDefaultBranch,
|
||||||
|
"default branch (for GitHub this must match the default branch setting for the organization)")
|
||||||
rootCmd.AddCommand(bootstrapCmd)
|
rootCmd.AddCommand(bootstrapCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateInstallManifests(targetPath, namespace, tmpDir string) (string, error) {
|
func generateInstallManifests(targetPath, namespace, tmpDir string) (string, error) {
|
||||||
tkDir := path.Join(tmpDir, ".tk")
|
gotkDir := path.Join(tmpDir, ".gotk")
|
||||||
defer os.RemoveAll(tkDir)
|
defer os.RemoveAll(gotkDir)
|
||||||
|
|
||||||
if err := os.MkdirAll(tkDir, os.ModePerm); err != nil {
|
if err := os.MkdirAll(gotkDir, os.ModePerm); err != nil {
|
||||||
return "", fmt.Errorf("generating manifests failed: %w", err)
|
return "", fmt.Errorf("generating manifests failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := genInstallManifests(bootstrapVersion, namespace, bootstrapComponents, bootstrapRegistry, bootstrapImagePullSecret, tkDir); err != nil {
|
if err := genInstallManifests(bootstrapVersion, namespace, bootstrapComponents, bootstrapRegistry, bootstrapImagePullSecret, bootstrapArch, gotkDir); err != nil {
|
||||||
return "", fmt.Errorf("generating manifests failed: %w", err)
|
return "", fmt.Errorf("generating manifests failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +94,7 @@ func generateInstallManifests(targetPath, namespace, tmpDir string) (string, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
manifest := path.Join(manifestsDir, bootstrapInstallManifest)
|
manifest := path.Join(manifestsDir, bootstrapInstallManifest)
|
||||||
if err := buildKustomization(tkDir, manifest); err != nil {
|
if err := buildKustomization(gotkDir, manifest); err != nil {
|
||||||
return "", fmt.Errorf("build kustomization failed: %w", err)
|
return "", fmt.Errorf("build kustomization failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,8 +117,8 @@ func applyInstallManifests(ctx context.Context, manifestPath string, components
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateSyncManifests(url, name, namespace, targetPath, tmpDir string, interval time.Duration) error {
|
func generateSyncManifests(url, branch, name, namespace, targetPath, tmpDir string, interval time.Duration) error {
|
||||||
gvk := sourcev1.GroupVersion.WithKind("GitRepository")
|
gvk := sourcev1.GroupVersion.WithKind(sourcev1.GitRepositoryKind)
|
||||||
gitRepository := sourcev1.GitRepository{
|
gitRepository := sourcev1.GitRepository{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: gvk.Kind,
|
Kind: gvk.Kind,
|
||||||
@@ -128,7 +134,7 @@ func generateSyncManifests(url, name, namespace, targetPath, tmpDir string, inte
|
|||||||
Duration: interval,
|
Duration: interval,
|
||||||
},
|
},
|
||||||
Reference: &sourcev1.GitRepositoryRef{
|
Reference: &sourcev1.GitRepositoryRef{
|
||||||
Branch: "master",
|
Branch: branch,
|
||||||
},
|
},
|
||||||
SecretRef: &corev1.LocalObjectReference{
|
SecretRef: &corev1.LocalObjectReference{
|
||||||
Name: name,
|
Name: name,
|
||||||
@@ -145,7 +151,7 @@ func generateSyncManifests(url, name, namespace, targetPath, tmpDir string, inte
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
gvk = kustomizev1.GroupVersion.WithKind("Kustomization")
|
gvk = kustomizev1.GroupVersion.WithKind(kustomizev1.KustomizationKind)
|
||||||
kustomization := kustomizev1.Kustomization{
|
kustomization := kustomizev1.Kustomization{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: gvk.Kind,
|
Kind: gvk.Kind,
|
||||||
@@ -42,19 +42,22 @@ the bootstrap command will perform an upgrade if needed.`,
|
|||||||
export GITHUB_TOKEN=<my-token>
|
export GITHUB_TOKEN=<my-token>
|
||||||
|
|
||||||
# Run bootstrap for a private repo owned by a GitHub organization
|
# Run bootstrap for a private repo owned by a GitHub organization
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name>
|
gotk bootstrap github --owner=<organization> --repository=<repo name>
|
||||||
|
|
||||||
# Run bootstrap for a private repo and assign organization teams to it
|
# Run bootstrap for a private repo and assign organization teams to it
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
|
||||||
|
|
||||||
# Run bootstrap for a repository path
|
# Run bootstrap for a repository path
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
|
||||||
|
|
||||||
# Run bootstrap for a public repository on a personal account
|
# Run bootstrap for a public repository on a personal account
|
||||||
tk bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
|
gotk bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
|
||||||
|
|
||||||
# Run bootstrap for a private repo hosted on GitHub Enterprise
|
# Run bootstrap for a private repo hosted on GitHub Enterprise
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain>
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain>
|
||||||
|
|
||||||
|
# Run bootstrap for a an existing repository with a branch named main
|
||||||
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --branch=main
|
||||||
`,
|
`,
|
||||||
RunE: bootstrapGitHubCmdRun,
|
RunE: bootstrapGitHubCmdRun,
|
||||||
}
|
}
|
||||||
@@ -68,6 +71,7 @@ var (
|
|||||||
ghHostname string
|
ghHostname string
|
||||||
ghPath string
|
ghPath string
|
||||||
ghTeams []string
|
ghTeams []string
|
||||||
|
ghDelete bool
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -84,6 +88,9 @@ func init() {
|
|||||||
bootstrapGitHubCmd.Flags().StringVar(&ghHostname, "hostname", git.GitHubDefaultHostname, "GitHub hostname")
|
bootstrapGitHubCmd.Flags().StringVar(&ghHostname, "hostname", git.GitHubDefaultHostname, "GitHub hostname")
|
||||||
bootstrapGitHubCmd.Flags().StringVar(&ghPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
|
bootstrapGitHubCmd.Flags().StringVar(&ghPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
|
||||||
|
|
||||||
|
bootstrapGitHubCmd.Flags().BoolVar(&ghDelete, "delete", false, "delete repository (used for testing only)")
|
||||||
|
bootstrapGitHubCmd.Flags().MarkHidden("delete")
|
||||||
|
|
||||||
bootstrapCmd.AddCommand(bootstrapGitHubCmd)
|
bootstrapCmd.AddCommand(bootstrapGitHubCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +100,11 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("%s environment variable not found", git.GitHubTokenName)
|
return fmt.Errorf("%s environment variable not found", git.GitHubTokenName)
|
||||||
}
|
}
|
||||||
|
|
||||||
repository, err := git.NewRepository(ghRepository, ghOwner, ghHostname, ghToken, "tk", ghOwner+"@users.noreply.github.com")
|
if !utils.containsItemString(supportedArch, bootstrapArch) {
|
||||||
|
return fmt.Errorf("arch %s is not supported, can be %v", bootstrapArch, supportedArch)
|
||||||
|
}
|
||||||
|
|
||||||
|
repository, err := git.NewRepository(ghRepository, ghOwner, ghHostname, ghToken, "gotk", ghOwner+"@users.noreply.github.com")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -103,11 +114,6 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
IsPersonal: ghPersonal,
|
IsPersonal: ghPersonal,
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeClient, err := utils.kubeClient(kubeconfig)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", namespace)
|
tmpDir, err := ioutil.TempDir("", namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -117,6 +123,14 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
if ghDelete {
|
||||||
|
if err := provider.DeleteRepository(ctx, repository); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("repository deleted")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// create GitHub repository if doesn't exists
|
// create GitHub repository if doesn't exists
|
||||||
logger.Actionf("connecting to %s", ghHostname)
|
logger.Actionf("connecting to %s", ghHostname)
|
||||||
changed, err := provider.CreateRepository(ctx, repository)
|
changed, err := provider.CreateRepository(ctx, repository)
|
||||||
@@ -169,6 +183,11 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
logger.Successf("components are up to date")
|
logger.Successf("components are up to date")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kubeClient, err := utils.kubeClient(kubeconfig)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// determine if repo synchronization is working
|
// determine if repo synchronization is working
|
||||||
isInstall := shouldInstallManifests(ctx, kubeClient, namespace)
|
isInstall := shouldInstallManifests(ctx, kubeClient, namespace)
|
||||||
|
|
||||||
@@ -194,9 +213,9 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("generating deploy key failed: %w", err)
|
return fmt.Errorf("generating deploy key failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
keyName := "tk"
|
keyName := "gotk"
|
||||||
if ghPath != "" {
|
if ghPath != "" {
|
||||||
keyName = fmt.Sprintf("tk-%s", ghPath)
|
keyName = fmt.Sprintf("gotk-%s", ghPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {
|
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {
|
||||||
@@ -207,22 +226,19 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// configure repo synchronization
|
// configure repo synchronization
|
||||||
if isInstall {
|
logger.Actionf("generating sync manifests")
|
||||||
// generate source and kustomization manifests
|
if err := generateSyncManifests(repository.GetSSH(), bootstrapBranch, namespace, namespace, ghPath, tmpDir, ghInterval); err != nil {
|
||||||
logger.Actionf("generating sync manifests")
|
return err
|
||||||
if err := generateSyncManifests(repository.GetSSH(), namespace, namespace, ghPath, tmpDir, ghInterval); err != nil {
|
}
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// commit and push manifests
|
// commit and push manifests
|
||||||
if changed, err = repository.Commit(ctx, path.Join(ghPath, namespace), "Add manifests"); err != nil {
|
if changed, err = repository.Commit(ctx, path.Join(ghPath, namespace), "Add manifests"); err != nil {
|
||||||
|
return err
|
||||||
|
} else if changed {
|
||||||
|
if err := repository.Push(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
} else if changed {
|
|
||||||
if err := repository.Push(ctx); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
logger.Successf("sync manifests pushed")
|
|
||||||
}
|
}
|
||||||
|
logger.Successf("sync manifests pushed")
|
||||||
|
|
||||||
// apply manifests and waiting for sync
|
// apply manifests and waiting for sync
|
||||||
logger.Actionf("applying sync manifests")
|
logger.Actionf("applying sync manifests")
|
||||||
@@ -42,28 +42,32 @@ the bootstrap command will perform an upgrade if needed.`,
|
|||||||
export GITLAB_TOKEN=<my-token>
|
export GITLAB_TOKEN=<my-token>
|
||||||
|
|
||||||
# Run bootstrap for a private repo owned by a GitLab group
|
# Run bootstrap for a private repo owned by a GitLab group
|
||||||
tk bootstrap gitlab --owner=<group> --repository=<repo name>
|
gotk bootstrap gitlab --owner=<group> --repository=<repo name>
|
||||||
|
|
||||||
# Run bootstrap for a repository path
|
# Run bootstrap for a repository path
|
||||||
tk bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
|
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
|
||||||
|
|
||||||
# Run bootstrap for a public repository on a personal account
|
# Run bootstrap for a public repository on a personal account
|
||||||
tk bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true
|
gotk bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true
|
||||||
|
|
||||||
# Run bootstrap for a private repo hosted on a GitLab server
|
# Run bootstrap for a private repo hosted on a GitLab server
|
||||||
tk bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain>
|
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain>
|
||||||
|
|
||||||
|
# Run bootstrap for a an existing repository with a branch named main
|
||||||
|
gotk bootstrap gitlab --owner=<organization> --repository=<repo name> --branch=main
|
||||||
`,
|
`,
|
||||||
RunE: bootstrapGitLabCmdRun,
|
RunE: bootstrapGitLabCmdRun,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
glOwner string
|
glOwner string
|
||||||
glRepository string
|
glRepository string
|
||||||
glInterval time.Duration
|
glInterval time.Duration
|
||||||
glPersonal bool
|
glPersonal bool
|
||||||
glPrivate bool
|
glPrivate bool
|
||||||
glHostname string
|
glHostname string
|
||||||
glPath string
|
glSSHHostname string
|
||||||
|
glPath string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -73,6 +77,7 @@ func init() {
|
|||||||
bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository")
|
bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository")
|
||||||
bootstrapGitLabCmd.Flags().DurationVar(&glInterval, "interval", time.Minute, "sync interval")
|
bootstrapGitLabCmd.Flags().DurationVar(&glInterval, "interval", time.Minute, "sync interval")
|
||||||
bootstrapGitLabCmd.Flags().StringVar(&glHostname, "hostname", git.GitLabDefaultHostname, "GitLab hostname")
|
bootstrapGitLabCmd.Flags().StringVar(&glHostname, "hostname", git.GitLabDefaultHostname, "GitLab hostname")
|
||||||
|
bootstrapGitLabCmd.Flags().StringVar(&glSSHHostname, "ssh-hostname", "", "GitLab SSH hostname, defaults to hostname if not specified")
|
||||||
bootstrapGitLabCmd.Flags().StringVar(&glPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
|
bootstrapGitLabCmd.Flags().StringVar(&glPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
|
||||||
|
|
||||||
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
||||||
@@ -84,11 +89,19 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("%s environment variable not found", git.GitLabTokenName)
|
return fmt.Errorf("%s environment variable not found", git.GitLabTokenName)
|
||||||
}
|
}
|
||||||
|
|
||||||
repository, err := git.NewRepository(glRepository, glOwner, glHostname, glToken, "tk", glOwner+"@users.noreply.gitlab.com")
|
if !utils.containsItemString(supportedArch, bootstrapArch) {
|
||||||
|
return fmt.Errorf("arch %s is not supported, can be %v", bootstrapArch, supportedArch)
|
||||||
|
}
|
||||||
|
|
||||||
|
repository, err := git.NewRepository(glRepository, glOwner, glHostname, glToken, "gotk", glOwner+"@users.noreply.gitlab.com")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if glSSHHostname != "" {
|
||||||
|
repository.SSHHost = glSSHHostname
|
||||||
|
}
|
||||||
|
|
||||||
provider := &git.GitLabProvider{
|
provider := &git.GitLabProvider{
|
||||||
IsPrivate: glPrivate,
|
IsPrivate: glPrivate,
|
||||||
IsPersonal: glPersonal,
|
IsPersonal: glPersonal,
|
||||||
@@ -172,9 +185,9 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("generating deploy key failed: %w", err)
|
return fmt.Errorf("generating deploy key failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
keyName := "tk"
|
keyName := "gotk"
|
||||||
if glPath != "" {
|
if glPath != "" {
|
||||||
keyName = fmt.Sprintf("tk-%s", glPath)
|
keyName = fmt.Sprintf("gotk-%s", glPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {
|
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {
|
||||||
@@ -185,22 +198,19 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// configure repo synchronization
|
// configure repo synchronization
|
||||||
if isInstall {
|
logger.Actionf("generating sync manifests")
|
||||||
// generate source and kustomization manifests
|
if err := generateSyncManifests(repository.GetSSH(), bootstrapBranch, namespace, namespace, glPath, tmpDir, glInterval); err != nil {
|
||||||
logger.Actionf("generating sync manifests")
|
return err
|
||||||
if err := generateSyncManifests(repository.GetSSH(), namespace, namespace, glPath, tmpDir, glInterval); err != nil {
|
}
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// commit and push manifests
|
// commit and push manifests
|
||||||
if changed, err = repository.Commit(ctx, path.Join(glPath, namespace), "Add manifests"); err != nil {
|
if changed, err = repository.Commit(ctx, path.Join(glPath, namespace), "Add manifests"); err != nil {
|
||||||
|
return err
|
||||||
|
} else if changed {
|
||||||
|
if err := repository.Push(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
} else if changed {
|
|
||||||
if err := repository.Push(ctx); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
logger.Successf("sync manifests pushed")
|
|
||||||
}
|
}
|
||||||
|
logger.Successf("sync manifests pushed")
|
||||||
|
|
||||||
// apply manifests and waiting for sync
|
// apply manifests and waiting for sync
|
||||||
logger.Actionf("applying sync manifests")
|
logger.Actionf("applying sync manifests")
|
||||||
@@ -35,10 +35,10 @@ var checkCmd = &cobra.Command{
|
|||||||
Long: `The check command will perform a series of checks to validate that
|
Long: `The check command will perform a series of checks to validate that
|
||||||
the local environment is configured correctly and if the installed components are healthy.`,
|
the local environment is configured correctly and if the installed components are healthy.`,
|
||||||
Example: ` # Run pre-installation checks
|
Example: ` # Run pre-installation checks
|
||||||
tk check --pre
|
gotk check --pre
|
||||||
|
|
||||||
# Run installation checks
|
# Run installation checks
|
||||||
tk check
|
gotk check
|
||||||
`,
|
`,
|
||||||
RunE: runCheckCmd,
|
RunE: runCheckCmd,
|
||||||
}
|
}
|
||||||
@@ -27,12 +27,12 @@ var completionCmd = &cobra.Command{
|
|||||||
Short: "Generates bash completion scripts",
|
Short: "Generates bash completion scripts",
|
||||||
Example: `To load completion run
|
Example: `To load completion run
|
||||||
|
|
||||||
. <(tk completion)
|
. <(gotk completion)
|
||||||
|
|
||||||
To configure your bash shell to load completions for each session add to your bashrc
|
To configure your bash shell to load completions for each session add to your bashrc
|
||||||
|
|
||||||
# ~/.bashrc or ~/.profile
|
# ~/.bashrc or ~/.profile
|
||||||
. <(tk completion)
|
. <(gotk completion)
|
||||||
`,
|
`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
rootCmd.GenBashCompletion(os.Stdout)
|
rootCmd.GenBashCompletion(os.Stdout)
|
||||||
@@ -17,8 +17,12 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/apimachinery/pkg/util/validation"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,10 +35,38 @@ var createCmd = &cobra.Command{
|
|||||||
var (
|
var (
|
||||||
interval time.Duration
|
interval time.Duration
|
||||||
export bool
|
export bool
|
||||||
|
labels []string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createCmd.PersistentFlags().DurationVarP(&interval, "interval", "", time.Minute, "source sync interval")
|
createCmd.PersistentFlags().DurationVarP(&interval, "interval", "", time.Minute, "source sync interval")
|
||||||
createCmd.PersistentFlags().BoolVar(&export, "export", false, "export in YAML format to stdout")
|
createCmd.PersistentFlags().BoolVar(&export, "export", false, "export in YAML format to stdout")
|
||||||
|
createCmd.PersistentFlags().StringSliceVar(&labels, "label", nil,
|
||||||
|
"set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)")
|
||||||
rootCmd.AddCommand(createCmd)
|
rootCmd.AddCommand(createCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func parseLabels() (map[string]string, error) {
|
||||||
|
result := make(map[string]string)
|
||||||
|
for _, label := range labels {
|
||||||
|
// validate key value pair
|
||||||
|
parts := strings.Split(label, "=")
|
||||||
|
if len(parts) != 2 {
|
||||||
|
return nil, fmt.Errorf("invalid label format '%s', must be key=value", label)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate label name
|
||||||
|
if errors := validation.IsQualifiedName(parts[0]); len(errors) > 0 {
|
||||||
|
return nil, fmt.Errorf("invalid label '%s': %v", parts[0], errors)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate label value
|
||||||
|
if errors := validation.IsValidLabelValue(parts[1]); len(errors) > 0 {
|
||||||
|
return nil, fmt.Errorf("invalid label value '%s': %v", parts[1], errors)
|
||||||
|
}
|
||||||
|
|
||||||
|
result[parts[0]] = parts[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
@@ -41,29 +42,41 @@ var createHelmReleaseCmd = &cobra.Command{
|
|||||||
Aliases: []string{"hr"},
|
Aliases: []string{"hr"},
|
||||||
Short: "Create or update a HelmRelease resource",
|
Short: "Create or update a HelmRelease resource",
|
||||||
Long: "The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.",
|
Long: "The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.",
|
||||||
Example: ` # Create a HelmRelease from a source
|
Example: ` # Create a HelmRelease with a chart from a HelmRepository source
|
||||||
tk create hr podinfo \
|
gotk create hr podinfo \
|
||||||
--interval=10m \
|
--interval=10m \
|
||||||
--release-name=podinfo \
|
--source=HelmRepository/podinfo \
|
||||||
--target-namespace=default \
|
--chart=podinfo \
|
||||||
--source=podinfo \
|
|
||||||
--chart-name=podinfo \
|
|
||||||
--chart-version=">4.0.0"
|
--chart-version=">4.0.0"
|
||||||
|
|
||||||
# Create a HelmRelease with values for a local YAML file
|
# Create a HelmRelease with a chart from a GitRepository source
|
||||||
tk create hr podinfo \
|
gotk create hr podinfo \
|
||||||
--target-namespace=default \
|
--interval=10m \
|
||||||
--source=podinfo \
|
--source=GitRepository/podinfo \
|
||||||
--chart-name=podinfo \
|
--chart=./charts/podinfo
|
||||||
--chart-version=4.0.5 \
|
|
||||||
|
# Create a HelmRelease with values from a local YAML file
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
--values=./my-values.yaml
|
--values=./my-values.yaml
|
||||||
|
|
||||||
# Create a HelmRelease definition on disk without applying it on the cluster
|
# Create a HelmRelease with a custom release name
|
||||||
tk create hr podinfo \
|
gotk create hr podinfo \
|
||||||
|
--release-name=podinfo-dev
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
|
||||||
|
# Create a HelmRelease targeting another namespace than the resource
|
||||||
|
gotk create hr podinfo \
|
||||||
--target-namespace=default \
|
--target-namespace=default \
|
||||||
--source=podinfo \
|
--source=HelmRepository/podinfo \
|
||||||
--chart-name=podinfo \
|
--chart=podinfo
|
||||||
--chart-version=4.0.5 \
|
|
||||||
|
# Create a HelmRelease definition on disk without applying it on the cluster
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
--values=./values.yaml \
|
--values=./values.yaml \
|
||||||
--export > podinfo-release.yaml
|
--export > podinfo-release.yaml
|
||||||
`,
|
`,
|
||||||
@@ -74,17 +87,17 @@ var (
|
|||||||
hrName string
|
hrName string
|
||||||
hrSource string
|
hrSource string
|
||||||
hrDependsOn []string
|
hrDependsOn []string
|
||||||
hrChartName string
|
hrChart string
|
||||||
hrChartVersion string
|
hrChartVersion string
|
||||||
hrTargetNamespace string
|
hrTargetNamespace string
|
||||||
hrValuesFile string
|
hrValuesFile string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '<target-namespace>-<hr-name>'")
|
createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<hr-name>'")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrSource, "source", "", "HelmRepository name")
|
createHelmReleaseCmd.Flags().StringVar(&hrSource, "source", "", "source that contains the chart (<kind>/<name>)")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrChartName, "chart-name", "", "Helm chart name")
|
createHelmReleaseCmd.Flags().StringVar(&hrChart, "chart", "", "Helm chart name or path")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts semver range")
|
createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
||||||
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed")
|
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
|
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
|
||||||
@@ -100,17 +113,20 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if hrSource == "" {
|
if hrSource == "" {
|
||||||
return fmt.Errorf("source is required")
|
return fmt.Errorf("source is required")
|
||||||
}
|
}
|
||||||
if hrChartName == "" {
|
hrSourceElements := strings.Split(hrSource, "/")
|
||||||
return fmt.Errorf("chart name is required")
|
if len(hrSourceElements) != 2 {
|
||||||
|
return fmt.Errorf("invalid source '%s', must be in format <kind>/<name>", hrSource)
|
||||||
}
|
}
|
||||||
if hrChartVersion == "" {
|
hrSourceKind, hrSourceName := hrSourceElements[0], hrSourceElements[1]
|
||||||
return fmt.Errorf("chart version is required")
|
if !utils.containsItemString(supportedHelmChartSourceKinds, hrSourceKind) {
|
||||||
|
return fmt.Errorf("source kind %s is not supported, can be %v",
|
||||||
|
hrSourceKind, supportedHelmChartSourceKinds)
|
||||||
|
}
|
||||||
|
if hrChart == "" {
|
||||||
|
return fmt.Errorf("chart name or path is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
sourceLabels, err := parseLabels()
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
kubeClient, err := utils.kubeClient(kubeconfig)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -123,6 +139,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: name,
|
Name: name,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
Labels: sourceLabels,
|
||||||
},
|
},
|
||||||
Spec: helmv2.HelmReleaseSpec{
|
Spec: helmv2.HelmReleaseSpec{
|
||||||
ReleaseName: hrName,
|
ReleaseName: hrName,
|
||||||
@@ -132,11 +149,13 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
},
|
},
|
||||||
TargetNamespace: hrTargetNamespace,
|
TargetNamespace: hrTargetNamespace,
|
||||||
Chart: helmv2.HelmChartTemplate{
|
Chart: helmv2.HelmChartTemplate{
|
||||||
Name: hrChartName,
|
Spec: helmv2.HelmChartTemplateSpec{
|
||||||
Version: hrChartVersion,
|
Chart: hrChart,
|
||||||
SourceRef: helmv2.CrossNamespaceObjectReference{
|
Version: hrChartVersion,
|
||||||
Kind: sourcev1.HelmRepositoryKind,
|
SourceRef: helmv2.CrossNamespaceObjectReference{
|
||||||
Name: hrSource,
|
Kind: hrSourceKind,
|
||||||
|
Name: hrSourceName,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Suspend: false,
|
Suspend: false,
|
||||||
@@ -154,13 +173,21 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("converting values to JSON from %s failed: %w", hrValuesFile, err)
|
return fmt.Errorf("converting values to JSON from %s failed: %w", hrValuesFile, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
helmRelease.Spec.Values = apiextensionsv1.JSON{Raw: json}
|
helmRelease.Spec.Values = &apiextensionsv1.JSON{Raw: json}
|
||||||
}
|
}
|
||||||
|
|
||||||
if export {
|
if export {
|
||||||
return exportHelmRelease(helmRelease)
|
return exportHelmRelease(helmRelease)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.kubeClient(kubeconfig)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
logger.Actionf("applying release")
|
logger.Actionf("applying release")
|
||||||
if err := upsertHelmRelease(ctx, kubeClient, helmRelease); err != nil {
|
if err := upsertHelmRelease(ctx, kubeClient, helmRelease); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -217,6 +244,7 @@ func upsertHelmRelease(ctx context.Context, kubeClient client.Client, helmReleas
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
existing.Labels = helmRelease.Labels
|
||||||
existing.Spec = helmRelease.Spec
|
existing.Spec = helmRelease.Spec
|
||||||
if err := kubeClient.Update(ctx, &existing); err != nil {
|
if err := kubeClient.Update(ctx, &existing); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -40,7 +40,7 @@ var createKsCmd = &cobra.Command{
|
|||||||
Short: "Create or update a Kustomization resource",
|
Short: "Create or update a Kustomization resource",
|
||||||
Long: "The kustomization source create command generates a Kustomize resource for a given GitRepository source.",
|
Long: "The kustomization source create command generates a Kustomize resource for a given GitRepository source.",
|
||||||
Example: ` # Create a Kustomization resource from a source at a given path
|
Example: ` # Create a Kustomization resource from a source at a given path
|
||||||
tk create kustomization contour \
|
gotk create kustomization contour \
|
||||||
--source=contour \
|
--source=contour \
|
||||||
--path="./examples/contour/" \
|
--path="./examples/contour/" \
|
||||||
--prune=true \
|
--prune=true \
|
||||||
@@ -51,7 +51,7 @@ var createKsCmd = &cobra.Command{
|
|||||||
--health-check-timeout=3m
|
--health-check-timeout=3m
|
||||||
|
|
||||||
# Create a Kustomization resource that depends on the previous one
|
# Create a Kustomization resource that depends on the previous one
|
||||||
tk create kustomization webapp \
|
gotk create kustomization webapp \
|
||||||
--depends-on=contour \
|
--depends-on=contour \
|
||||||
--source=webapp \
|
--source=webapp \
|
||||||
--path="./deploy/overlays/dev" \
|
--path="./deploy/overlays/dev" \
|
||||||
@@ -60,7 +60,7 @@ var createKsCmd = &cobra.Command{
|
|||||||
--validation=client
|
--validation=client
|
||||||
|
|
||||||
# Create a Kustomization resource that runs under a service account
|
# Create a Kustomization resource that runs under a service account
|
||||||
tk create kustomization webapp \
|
gotk create kustomization webapp \
|
||||||
--source=webapp \
|
--source=webapp \
|
||||||
--path="./deploy/overlays/staging" \
|
--path="./deploy/overlays/staging" \
|
||||||
--prune=true \
|
--prune=true \
|
||||||
@@ -73,15 +73,17 @@ var createKsCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ksSource string
|
ksSource string
|
||||||
ksPath string
|
ksPath string
|
||||||
ksPrune bool
|
ksPrune bool
|
||||||
ksDependsOn []string
|
ksDependsOn []string
|
||||||
ksValidation string
|
ksValidation string
|
||||||
ksHealthCheck []string
|
ksHealthCheck []string
|
||||||
ksHealthTimeout time.Duration
|
ksHealthTimeout time.Duration
|
||||||
ksSAName string
|
ksSAName string
|
||||||
ksSANamespace string
|
ksSANamespace string
|
||||||
|
ksDecryptionProvider string
|
||||||
|
ksDecryptionSecret string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -94,6 +96,8 @@ func init() {
|
|||||||
createKsCmd.Flags().StringArrayVar(&ksDependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied")
|
createKsCmd.Flags().StringArrayVar(&ksDependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied")
|
||||||
createKsCmd.Flags().StringVar(&ksSAName, "sa-name", "", "service account name")
|
createKsCmd.Flags().StringVar(&ksSAName, "sa-name", "", "service account name")
|
||||||
createKsCmd.Flags().StringVar(&ksSANamespace, "sa-namespace", "", "service account namespace")
|
createKsCmd.Flags().StringVar(&ksSANamespace, "sa-namespace", "", "service account namespace")
|
||||||
|
createKsCmd.Flags().StringVar(&ksDecryptionProvider, "decryption-provider", "", "enables secrets decryption, provider can be 'sops'")
|
||||||
|
createKsCmd.Flags().StringVar(&ksDecryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
|
||||||
createCmd.AddCommand(createKsCmd)
|
createCmd.AddCommand(createKsCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,22 +117,20 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("path must begin with ./")
|
return fmt.Errorf("path must begin with ./")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
kubeClient, err := utils.kubeClient(kubeconfig)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !export {
|
if !export {
|
||||||
logger.Generatef("generating kustomization")
|
logger.Generatef("generating kustomization")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ksLabels, err := parseLabels()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
kustomization := kustomizev1.Kustomization{
|
kustomization := kustomizev1.Kustomization{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: name,
|
Name: name,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
Labels: ksLabels,
|
||||||
},
|
},
|
||||||
Spec: kustomizev1.KustomizationSpec{
|
Spec: kustomizev1.KustomizationSpec{
|
||||||
DependsOn: ksDependsOn,
|
DependsOn: ksDependsOn,
|
||||||
@@ -186,10 +188,33 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ksDecryptionProvider != "" {
|
||||||
|
if !utils.containsItemString(supportedDecryptionProviders, ksDecryptionProvider) {
|
||||||
|
return fmt.Errorf("decryption provider %s is not supported, can be %v",
|
||||||
|
ksDecryptionProvider, supportedDecryptionProviders)
|
||||||
|
}
|
||||||
|
|
||||||
|
kustomization.Spec.Decryption = &kustomizev1.Decryption{
|
||||||
|
Provider: ksDecryptionProvider,
|
||||||
|
}
|
||||||
|
|
||||||
|
if ksDecryptionSecret != "" {
|
||||||
|
kustomization.Spec.Decryption.SecretRef = &corev1.LocalObjectReference{Name: ksDecryptionSecret}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if export {
|
if export {
|
||||||
return exportKs(kustomization)
|
return exportKs(kustomization)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.kubeClient(kubeconfig)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
logger.Actionf("applying kustomization")
|
logger.Actionf("applying kustomization")
|
||||||
if err := upsertKustomization(ctx, kubeClient, kustomization); err != nil {
|
if err := upsertKustomization(ctx, kubeClient, kustomization); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -241,6 +266,7 @@ func upsertKustomization(ctx context.Context, kubeClient client.Client, kustomiz
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
existing.Labels = kustomization.Labels
|
||||||
existing.Spec = kustomization.Spec
|
existing.Spec = kustomization.Spec
|
||||||
if err := kubeClient.Update(ctx, &existing); err != nil {
|
if err := kubeClient.Update(ctx, &existing); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -46,35 +46,35 @@ The create source git command generates a GitRepository resource and waits for i
|
|||||||
For Git over SSH, host and SSH keys are automatically generated and stored in a Kubernetes secret.
|
For Git over SSH, host and SSH keys are automatically generated and stored in a Kubernetes secret.
|
||||||
For private Git repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
|
For private Git repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
|
||||||
Example: ` # Create a source from a public Git repository master branch
|
Example: ` # Create a source from a public Git repository master branch
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--branch=master
|
--branch=master
|
||||||
|
|
||||||
# Create a source from a Git repository pinned to specific git tag
|
# Create a source from a Git repository pinned to specific git tag
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--tag="3.2.3"
|
--tag="3.2.3"
|
||||||
|
|
||||||
# Create a source from a public Git repository tag that matches a semver range
|
# Create a source from a public Git repository tag that matches a semver range
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--tag-semver=">=3.2.0 <3.3.0"
|
--tag-semver=">=3.2.0 <3.3.0"
|
||||||
|
|
||||||
# Create a source from a Git repository using SSH authentication
|
# Create a source from a Git repository using SSH authentication
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
--branch=master
|
--branch=master
|
||||||
|
|
||||||
# Create a source from a Git repository using SSH authentication and an
|
# Create a source from a Git repository using SSH authentication and an
|
||||||
# ECDSA P-521 curve public key
|
# ECDSA P-521 curve public key
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
--branch=master \
|
--branch=master \
|
||||||
--ssh-key-algorithm=ecdsa \
|
--ssh-key-algorithm=ecdsa \
|
||||||
--ssh-ecdsa-curve=p521
|
--ssh-ecdsa-curve=p521
|
||||||
|
|
||||||
# Create a source from a Git repository using basic authentication
|
# Create a source from a Git repository using basic authentication
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--username=username \
|
--username=username \
|
||||||
--password=password
|
--password=password
|
||||||
@@ -129,10 +129,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("git URL parse failed: %w", err)
|
return fmt.Errorf("git URL parse failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
sourceLabels, err := parseLabels()
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
kubeClient, err := utils.kubeClient(kubeconfig)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -141,6 +138,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: name,
|
Name: name,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
Labels: sourceLabels,
|
||||||
},
|
},
|
||||||
Spec: sourcev1.GitRepositorySpec{
|
Spec: sourcev1.GitRepositorySpec{
|
||||||
URL: sourceGitURL,
|
URL: sourceGitURL,
|
||||||
@@ -163,6 +161,14 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return exportGit(gitRepository)
|
return exportGit(gitRepository)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.kubeClient(kubeconfig)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
withAuth := false
|
withAuth := false
|
||||||
// TODO(hidde): move all auth prep to separate func?
|
// TODO(hidde): move all auth prep to separate func?
|
||||||
if u.Scheme == "ssh" {
|
if u.Scheme == "ssh" {
|
||||||
@@ -343,6 +349,7 @@ func upsertGitRepository(ctx context.Context, kubeClient client.Client, gitRepos
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
existing.Labels = gitRepository.Labels
|
||||||
existing.Spec = gitRepository.Spec
|
existing.Spec = gitRepository.Spec
|
||||||
if err := kubeClient.Update(ctx, &existing); err != nil {
|
if err := kubeClient.Update(ctx, &existing); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -19,18 +19,19 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/yaml"
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var createSourceHelmCmd = &cobra.Command{
|
var createSourceHelmCmd = &cobra.Command{
|
||||||
@@ -40,15 +41,22 @@ var createSourceHelmCmd = &cobra.Command{
|
|||||||
The create source helm command generates a HelmRepository resource and waits for it to fetch the index.
|
The create source helm command generates a HelmRepository resource and waits for it to fetch the index.
|
||||||
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
|
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
|
||||||
Example: ` # Create a source from a public Helm repository
|
Example: ` # Create a source from a public Helm repository
|
||||||
tk create source helm podinfo \
|
gotk create source helm podinfo \
|
||||||
--url=https://stefanprodan.github.io/podinfo \
|
--url=https://stefanprodan.github.io/podinfo \
|
||||||
--interval=10m
|
--interval=10m
|
||||||
|
|
||||||
# Create a source from a Helm repository using basic authentication
|
# Create a source from a Helm repository using basic authentication
|
||||||
tk create source helm podinfo \
|
gotk create source helm podinfo \
|
||||||
--url=https://stefanprodan.github.io/podinfo \
|
--url=https://stefanprodan.github.io/podinfo \
|
||||||
--username=username \
|
--username=username \
|
||||||
--password=password
|
--password=password
|
||||||
|
|
||||||
|
# Create a source from a Helm repository using TLS authentication
|
||||||
|
gotk create source helm podinfo \
|
||||||
|
--url=https://stefanprodan.github.io/podinfo \
|
||||||
|
--cert-file=./cert.crt \
|
||||||
|
--key-file=./key.crt \
|
||||||
|
--ca-file=./ca.crt
|
||||||
`,
|
`,
|
||||||
RunE: createSourceHelmCmdRun,
|
RunE: createSourceHelmCmdRun,
|
||||||
}
|
}
|
||||||
@@ -57,12 +65,18 @@ var (
|
|||||||
sourceHelmURL string
|
sourceHelmURL string
|
||||||
sourceHelmUsername string
|
sourceHelmUsername string
|
||||||
sourceHelmPassword string
|
sourceHelmPassword string
|
||||||
|
sourceHelmCertFile string
|
||||||
|
sourceHelmKeyFile string
|
||||||
|
sourceHelmCAFile string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createSourceHelmCmd.Flags().StringVar(&sourceHelmURL, "url", "", "Helm repository address")
|
createSourceHelmCmd.Flags().StringVar(&sourceHelmURL, "url", "", "Helm repository address")
|
||||||
createSourceHelmCmd.Flags().StringVarP(&sourceHelmUsername, "username", "u", "", "basic authentication username")
|
createSourceHelmCmd.Flags().StringVarP(&sourceHelmUsername, "username", "u", "", "basic authentication username")
|
||||||
createSourceHelmCmd.Flags().StringVarP(&sourceHelmPassword, "password", "p", "", "basic authentication password")
|
createSourceHelmCmd.Flags().StringVarP(&sourceHelmPassword, "password", "p", "", "basic authentication password")
|
||||||
|
createSourceHelmCmd.Flags().StringVar(&sourceHelmCertFile, "cert-file", "", "TLS authentication cert file path")
|
||||||
|
createSourceHelmCmd.Flags().StringVar(&sourceHelmKeyFile, "key-file", "", "TLS authentication key file path")
|
||||||
|
createSourceHelmCmd.Flags().StringVar(&sourceHelmCAFile, "ca-file", "", "TLS authentication CA file path")
|
||||||
|
|
||||||
createSourceCmd.AddCommand(createSourceHelmCmd)
|
createSourceCmd.AddCommand(createSourceHelmCmd)
|
||||||
}
|
}
|
||||||
@@ -78,6 +92,11 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("url is required")
|
return fmt.Errorf("url is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceLabels, err := parseLabels()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", name)
|
tmpDir, err := ioutil.TempDir("", name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -88,18 +107,11 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("url parse failed: %w", err)
|
return fmt.Errorf("url parse failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
kubeClient, err := utils.kubeClient(kubeconfig)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
helmRepository := sourcev1.HelmRepository{
|
helmRepository := sourcev1.HelmRepository{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: name,
|
Name: name,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
Labels: sourceLabels,
|
||||||
},
|
},
|
||||||
Spec: sourcev1.HelmRepositorySpec{
|
Spec: sourcev1.HelmRepositorySpec{
|
||||||
URL: sourceHelmURL,
|
URL: sourceHelmURL,
|
||||||
@@ -113,35 +125,60 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return exportHelmRepository(helmRepository)
|
return exportHelmRepository(helmRepository)
|
||||||
}
|
}
|
||||||
|
|
||||||
withAuth := false
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
if sourceHelmUsername != "" && sourceHelmPassword != "" {
|
defer cancel()
|
||||||
logger.Actionf("applying secret with basic auth credentials")
|
|
||||||
secret := corev1.Secret{
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Name: secretName,
|
|
||||||
Namespace: namespace,
|
|
||||||
},
|
|
||||||
StringData: map[string]string{
|
|
||||||
"username": sourceHelmUsername,
|
|
||||||
"password": sourceHelmPassword,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
withAuth = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if withAuth {
|
kubeClient, err := utils.kubeClient(kubeconfig)
|
||||||
logger.Successf("authentication configured")
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Generatef("generating source")
|
logger.Generatef("generating source")
|
||||||
|
|
||||||
if withAuth {
|
secret := corev1.Secret{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: secretName,
|
||||||
|
Namespace: namespace,
|
||||||
|
},
|
||||||
|
StringData: map[string]string{},
|
||||||
|
}
|
||||||
|
|
||||||
|
if sourceHelmUsername != "" && sourceHelmPassword != "" {
|
||||||
|
secret.StringData["username"] = sourceHelmUsername
|
||||||
|
secret.StringData["password"] = sourceHelmPassword
|
||||||
|
}
|
||||||
|
|
||||||
|
if sourceHelmCertFile != "" && sourceHelmKeyFile != "" {
|
||||||
|
cert, err := ioutil.ReadFile(sourceHelmCertFile)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to read repository cert file '%s': %w", sourceHelmCertFile, err)
|
||||||
|
}
|
||||||
|
secret.StringData["certFile"] = string(cert)
|
||||||
|
|
||||||
|
key, err := ioutil.ReadFile(sourceHelmKeyFile)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to read repository key file '%s': %w", sourceHelmKeyFile, err)
|
||||||
|
}
|
||||||
|
secret.StringData["keyFile"] = string(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
if sourceHelmCAFile != "" {
|
||||||
|
ca, err := ioutil.ReadFile(sourceHelmCAFile)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to read repository CA file '%s': %w", sourceHelmCAFile, err)
|
||||||
|
}
|
||||||
|
secret.StringData["caFile"] = string(ca)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(secret.StringData) > 0 {
|
||||||
|
logger.Actionf("applying secret with repository credentials")
|
||||||
|
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
helmRepository.Spec.SecretRef = &corev1.LocalObjectReference{
|
helmRepository.Spec.SecretRef = &corev1.LocalObjectReference{
|
||||||
Name: secretName,
|
Name: secretName,
|
||||||
}
|
}
|
||||||
|
logger.Successf("authentication configured")
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Actionf("applying source")
|
logger.Actionf("applying source")
|
||||||
@@ -195,6 +232,7 @@ func upsertHelmRepository(ctx context.Context, kubeClient client.Client, helmRep
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
existing.Labels = helmRepository.Labels
|
||||||
existing.Spec = helmRepository.Spec
|
existing.Spec = helmRepository.Spec
|
||||||
if err := kubeClient.Update(ctx, &existing); err != nil {
|
if err := kubeClient.Update(ctx, &existing); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -203,27 +241,3 @@ func upsertHelmRepository(ctx context.Context, kubeClient client.Client, helmRep
|
|||||||
logger.Successf("source updated")
|
logger.Successf("source updated")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func exportHelmRepository(source sourcev1.HelmRepository) error {
|
|
||||||
gvk := sourcev1.GroupVersion.WithKind(sourcev1.HelmRepositoryKind)
|
|
||||||
export := sourcev1.HelmRepository{
|
|
||||||
TypeMeta: metav1.TypeMeta{
|
|
||||||
Kind: gvk.Kind,
|
|
||||||
APIVersion: gvk.GroupVersion().String(),
|
|
||||||
},
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Name: source.Name,
|
|
||||||
Namespace: source.Namespace,
|
|
||||||
},
|
|
||||||
Spec: source.Spec,
|
|
||||||
}
|
|
||||||
|
|
||||||
data, err := yaml.Marshal(export)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println("---")
|
|
||||||
fmt.Println(string(data))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -33,7 +33,7 @@ var deleteHelmReleaseCmd = &cobra.Command{
|
|||||||
Short: "Delete a HelmRelease resource",
|
Short: "Delete a HelmRelease resource",
|
||||||
Long: "The delete helmrelease command removes the given HelmRelease from the cluster.",
|
Long: "The delete helmrelease command removes the given HelmRelease from the cluster.",
|
||||||
Example: ` # Delete a Helm release and the Kubernetes resources created by it
|
Example: ` # Delete a Helm release and the Kubernetes resources created by it
|
||||||
tk delete hr podinfo
|
gotk delete hr podinfo
|
||||||
`,
|
`,
|
||||||
RunE: deleteHelmReleaseCmdRun,
|
RunE: deleteHelmReleaseCmdRun,
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ var deleteKsCmd = &cobra.Command{
|
|||||||
Short: "Delete a Kustomization resource",
|
Short: "Delete a Kustomization resource",
|
||||||
Long: "The delete kustomization command deletes the given Kustomization from the cluster.",
|
Long: "The delete kustomization command deletes the given Kustomization from the cluster.",
|
||||||
Example: ` # Delete a kustomization and the Kubernetes resources created by it
|
Example: ` # Delete a kustomization and the Kubernetes resources created by it
|
||||||
tk delete kustomization podinfo
|
gotk delete kustomization podinfo
|
||||||
`,
|
`,
|
||||||
RunE: deleteKsCmdRun,
|
RunE: deleteKsCmdRun,
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ var deleteSourceGitCmd = &cobra.Command{
|
|||||||
Short: "Delete a GitRepository source",
|
Short: "Delete a GitRepository source",
|
||||||
Long: "The delete source git command deletes the given GitRepository from the cluster.",
|
Long: "The delete source git command deletes the given GitRepository from the cluster.",
|
||||||
Example: ` # Delete a Git repository
|
Example: ` # Delete a Git repository
|
||||||
tk delete source git podinfo
|
gotk delete source git podinfo
|
||||||
`,
|
`,
|
||||||
RunE: deleteSourceGitCmdRun,
|
RunE: deleteSourceGitCmdRun,
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ var deleteSourceHelmCmd = &cobra.Command{
|
|||||||
Short: "Delete a HelmRepository source",
|
Short: "Delete a HelmRepository source",
|
||||||
Long: "The delete source helm command deletes the given HelmRepository from the cluster.",
|
Long: "The delete source helm command deletes the given HelmRepository from the cluster.",
|
||||||
Example: ` # Delete a Helm repository
|
Example: ` # Delete a Helm repository
|
||||||
tk delete source helm podinfo
|
gotk delete source helm podinfo
|
||||||
`,
|
`,
|
||||||
RunE: deleteSourceHelmCmdRun,
|
RunE: deleteSourceHelmCmdRun,
|
||||||
}
|
}
|
||||||
@@ -35,10 +35,10 @@ var exportHelmReleaseCmd = &cobra.Command{
|
|||||||
Short: "Export HelmRelease resources in YAML format",
|
Short: "Export HelmRelease resources in YAML format",
|
||||||
Long: "The export helmrelease command exports one or all HelmRelease resources in YAML format.",
|
Long: "The export helmrelease command exports one or all HelmRelease resources in YAML format.",
|
||||||
Example: ` # Export all HelmRelease resources
|
Example: ` # Export all HelmRelease resources
|
||||||
tk export helmrelease --all > kustomizations.yaml
|
gotk export helmrelease --all > kustomizations.yaml
|
||||||
|
|
||||||
# Export a HelmRelease
|
# Export a HelmRelease
|
||||||
tk export hr my-app > app-release.yaml
|
gotk export hr my-app > app-release.yaml
|
||||||
`,
|
`,
|
||||||
RunE: exportHelmReleaseCmdRun,
|
RunE: exportHelmReleaseCmdRun,
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ func exportHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(list.Items) == 0 {
|
if len(list.Items) == 0 {
|
||||||
logger.Failuref("no kustomizations found in %s namespace", namespace)
|
logger.Failuref("no helmrelease found in %s namespace", namespace)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +101,10 @@ func exportHelmRelease(helmRelease helmv2.HelmRelease) error {
|
|||||||
APIVersion: gvk.GroupVersion().String(),
|
APIVersion: gvk.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: helmRelease.Name,
|
Name: helmRelease.Name,
|
||||||
Namespace: helmRelease.Namespace,
|
Namespace: helmRelease.Namespace,
|
||||||
|
Labels: helmRelease.Labels,
|
||||||
|
Annotations: helmRelease.Annotations,
|
||||||
},
|
},
|
||||||
Spec: helmRelease.Spec,
|
Spec: helmRelease.Spec,
|
||||||
}
|
}
|
||||||
@@ -20,12 +20,13 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exportKsCmd = &cobra.Command{
|
var exportKsCmd = &cobra.Command{
|
||||||
@@ -34,10 +35,10 @@ var exportKsCmd = &cobra.Command{
|
|||||||
Short: "Export Kustomization resources in YAML format",
|
Short: "Export Kustomization resources in YAML format",
|
||||||
Long: "The export kustomization command exports one or all Kustomization resources in YAML format.",
|
Long: "The export kustomization command exports one or all Kustomization resources in YAML format.",
|
||||||
Example: ` # Export all Kustomization resources
|
Example: ` # Export all Kustomization resources
|
||||||
tk export kustomization --all > kustomizations.yaml
|
gotk export kustomization --all > kustomizations.yaml
|
||||||
|
|
||||||
# Export a Kustomization
|
# Export a Kustomization
|
||||||
tk export kustomization my-app > kustomization.yaml
|
gotk export kustomization my-app > kustomization.yaml
|
||||||
`,
|
`,
|
||||||
RunE: exportKsCmdRun,
|
RunE: exportKsCmdRun,
|
||||||
}
|
}
|
||||||
@@ -100,8 +101,10 @@ func exportKs(kustomization kustomizev1.Kustomization) error {
|
|||||||
APIVersion: gvk.GroupVersion().String(),
|
APIVersion: gvk.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: kustomization.Name,
|
Name: kustomization.Name,
|
||||||
Namespace: kustomization.Namespace,
|
Namespace: kustomization.Namespace,
|
||||||
|
Labels: kustomization.Labels,
|
||||||
|
Annotations: kustomization.Annotations,
|
||||||
},
|
},
|
||||||
Spec: kustomization.Spec,
|
Spec: kustomization.Spec,
|
||||||
}
|
}
|
||||||
@@ -20,13 +20,14 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exportSourceGitCmd = &cobra.Command{
|
var exportSourceGitCmd = &cobra.Command{
|
||||||
@@ -34,10 +35,10 @@ var exportSourceGitCmd = &cobra.Command{
|
|||||||
Short: "Export GitRepository sources in YAML format",
|
Short: "Export GitRepository sources in YAML format",
|
||||||
Long: "The export source git command exports on or all GitRepository sources in YAML format.",
|
Long: "The export source git command exports on or all GitRepository sources in YAML format.",
|
||||||
Example: ` # Export all GitRepository sources
|
Example: ` # Export all GitRepository sources
|
||||||
tk export source git --all > sources.yaml
|
gotk export source git --all > sources.yaml
|
||||||
|
|
||||||
# Export a GitRepository source including the SSH key pair or basic auth credentials
|
# Export a GitRepository source including the SSH key pair or basic auth credentials
|
||||||
tk export source git my-private-repo --with-credentials > source.yaml
|
gotk export source git my-private-repo --with-credentials > source.yaml
|
||||||
`,
|
`,
|
||||||
RunE: exportSourceGitCmdRun,
|
RunE: exportSourceGitCmdRun,
|
||||||
}
|
}
|
||||||
@@ -110,8 +111,10 @@ func exportGit(source sourcev1.GitRepository) error {
|
|||||||
APIVersion: gvk.GroupVersion().String(),
|
APIVersion: gvk.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: source.Name,
|
Name: source.Name,
|
||||||
Namespace: source.Namespace,
|
Namespace: source.Namespace,
|
||||||
|
Labels: source.Labels,
|
||||||
|
Annotations: source.Annotations,
|
||||||
},
|
},
|
||||||
Spec: source.Spec,
|
Spec: source.Spec,
|
||||||
}
|
}
|
||||||
@@ -20,13 +20,14 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exportSourceHelmCmd = &cobra.Command{
|
var exportSourceHelmCmd = &cobra.Command{
|
||||||
@@ -34,10 +35,10 @@ var exportSourceHelmCmd = &cobra.Command{
|
|||||||
Short: "Export HelmRepository sources in YAML format",
|
Short: "Export HelmRepository sources in YAML format",
|
||||||
Long: "The export source git command exports on or all HelmRepository sources in YAML format.",
|
Long: "The export source git command exports on or all HelmRepository sources in YAML format.",
|
||||||
Example: ` # Export all HelmRepository sources
|
Example: ` # Export all HelmRepository sources
|
||||||
tk export source helm --all > sources.yaml
|
gotk export source helm --all > sources.yaml
|
||||||
|
|
||||||
# Export a HelmRepository source including the basic auth credentials
|
# Export a HelmRepository source including the basic auth credentials
|
||||||
tk export source helm my-private-repo --with-credentials > source.yaml
|
gotk export source helm my-private-repo --with-credentials > source.yaml
|
||||||
`,
|
`,
|
||||||
RunE: exportSourceHelmCmdRun,
|
RunE: exportSourceHelmCmdRun,
|
||||||
}
|
}
|
||||||
@@ -102,6 +103,32 @@ func exportSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func exportHelmRepository(source sourcev1.HelmRepository) error {
|
||||||
|
gvk := sourcev1.GroupVersion.WithKind(sourcev1.HelmRepositoryKind)
|
||||||
|
export := sourcev1.HelmRepository{
|
||||||
|
TypeMeta: metav1.TypeMeta{
|
||||||
|
Kind: gvk.Kind,
|
||||||
|
APIVersion: gvk.GroupVersion().String(),
|
||||||
|
},
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: source.Name,
|
||||||
|
Namespace: source.Namespace,
|
||||||
|
Labels: source.Labels,
|
||||||
|
Annotations: source.Annotations,
|
||||||
|
},
|
||||||
|
Spec: source.Spec,
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := yaml.Marshal(export)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("---")
|
||||||
|
fmt.Println(string(data))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func exportHelmCredentials(ctx context.Context, kubeClient client.Client, source sourcev1.HelmRepository) error {
|
func exportHelmCredentials(ctx context.Context, kubeClient client.Client, source sourcev1.HelmRepository) error {
|
||||||
if source.Spec.SecretRef != nil {
|
if source.Spec.SecretRef != nil {
|
||||||
namespacedName := types.NamespacedName{
|
namespacedName := types.NamespacedName{
|
||||||
@@ -32,7 +32,7 @@ var getHelmReleaseCmd = &cobra.Command{
|
|||||||
Short: "Get HelmRelease statuses",
|
Short: "Get HelmRelease statuses",
|
||||||
Long: "The get helmreleases command prints the statuses of the resources.",
|
Long: "The get helmreleases command prints the statuses of the resources.",
|
||||||
Example: ` # List all Helm releases and their status
|
Example: ` # List all Helm releases and their status
|
||||||
tk get helmreleases
|
gotk get helmreleases
|
||||||
`,
|
`,
|
||||||
RunE: getHelmReleaseCmdRun,
|
RunE: getHelmReleaseCmdRun,
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ var getKsCmd = &cobra.Command{
|
|||||||
Short: "Get Kustomization statuses",
|
Short: "Get Kustomization statuses",
|
||||||
Long: "The get kustomizations command prints the statuses of the resources.",
|
Long: "The get kustomizations command prints the statuses of the resources.",
|
||||||
Example: ` # List all kustomizations and their status
|
Example: ` # List all kustomizations and their status
|
||||||
tk get kustomizations
|
gotk get kustomizations
|
||||||
`,
|
`,
|
||||||
RunE: getKsCmdRun,
|
RunE: getKsCmdRun,
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ var getSourceGitCmd = &cobra.Command{
|
|||||||
Short: "Get GitRepository source statuses",
|
Short: "Get GitRepository source statuses",
|
||||||
Long: "The get sources git command prints the status of the GitRepository sources.",
|
Long: "The get sources git command prints the status of the GitRepository sources.",
|
||||||
Example: ` # List all Git repositories and their status
|
Example: ` # List all Git repositories and their status
|
||||||
tk get sources git
|
gotk get sources git
|
||||||
`,
|
`,
|
||||||
RunE: getSourceGitCmdRun,
|
RunE: getSourceGitCmdRun,
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ var getSourceHelmCmd = &cobra.Command{
|
|||||||
Short: "Get HelmRepository source statuses",
|
Short: "Get HelmRepository source statuses",
|
||||||
Long: "The get sources helm command prints the status of the HelmRepository sources.",
|
Long: "The get sources helm command prints the status of the HelmRepository sources.",
|
||||||
Example: ` # List all Helm repositories and their status
|
Example: ` # List all Helm repositories and their status
|
||||||
tk get sources helm
|
gotk get sources helm
|
||||||
`,
|
`,
|
||||||
RunE: getSourceHelmCmdRun,
|
RunE: getSourceHelmCmdRun,
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/fluxcd/pkg/untar"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@@ -31,6 +30,8 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/krusty"
|
"sigs.k8s.io/kustomize/api/krusty"
|
||||||
|
|
||||||
|
"github.com/fluxcd/pkg/untar"
|
||||||
)
|
)
|
||||||
|
|
||||||
var installCmd = &cobra.Command{
|
var installCmd = &cobra.Command{
|
||||||
@@ -39,16 +40,16 @@ var installCmd = &cobra.Command{
|
|||||||
Long: `The install command deploys the toolkit components in the specified namespace.
|
Long: `The install command deploys the toolkit components in the specified namespace.
|
||||||
If a previous version is installed, then an in-place upgrade will be performed.`,
|
If a previous version is installed, then an in-place upgrade will be performed.`,
|
||||||
Example: ` # Install the latest version in the gitops-systems namespace
|
Example: ` # Install the latest version in the gitops-systems namespace
|
||||||
tk install --version=latest --namespace=gitops-systems
|
gotk install --version=latest --namespace=gitops-systems
|
||||||
|
|
||||||
# Dry-run install for a specific version and a series of components
|
# Dry-run install for a specific version and a series of components
|
||||||
tk install --dry-run --version=v0.0.7 --components="source-controller,kustomize-controller"
|
gotk install --dry-run --version=v0.0.7 --components="source-controller,kustomize-controller"
|
||||||
|
|
||||||
# Dry-run install with manifests preview
|
# Dry-run install with manifests preview
|
||||||
tk install --dry-run --verbose
|
gotk install --dry-run --verbose
|
||||||
|
|
||||||
# Write install manifests to file
|
# Write install manifests to file
|
||||||
tk install --export > gitops-system.yaml
|
gotk install --export > gitops-system.yaml
|
||||||
`,
|
`,
|
||||||
RunE: installCmdRun,
|
RunE: installCmdRun,
|
||||||
}
|
}
|
||||||
@@ -61,6 +62,7 @@ var (
|
|||||||
installComponents []string
|
installComponents []string
|
||||||
installRegistry string
|
installRegistry string
|
||||||
installImagePullSecret string
|
installImagePullSecret string
|
||||||
|
installArch string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -74,14 +76,20 @@ func init() {
|
|||||||
"list of components, accepts comma-separated values")
|
"list of components, accepts comma-separated values")
|
||||||
installCmd.Flags().StringVar(&installManifestsPath, "manifests", "",
|
installCmd.Flags().StringVar(&installManifestsPath, "manifests", "",
|
||||||
"path to the manifest directory, dev only")
|
"path to the manifest directory, dev only")
|
||||||
installCmd.Flags().StringVar(&installRegistry, "registry", "docker.io/fluxcd",
|
installCmd.Flags().StringVar(&installRegistry, "registry", "ghcr.io/fluxcd",
|
||||||
"container registry where the toolkit images are published")
|
"container registry where the toolkit images are published")
|
||||||
installCmd.Flags().StringVar(&installImagePullSecret, "image-pull-secret", "",
|
installCmd.Flags().StringVar(&installImagePullSecret, "image-pull-secret", "",
|
||||||
"Kubernetes secret name used for pulling the toolkit images from a private registry")
|
"Kubernetes secret name used for pulling the toolkit images from a private registry")
|
||||||
|
installCmd.Flags().StringVar(&installArch, "arch", "amd64",
|
||||||
|
"arch can be amd64 or arm64")
|
||||||
rootCmd.AddCommand(installCmd)
|
rootCmd.AddCommand(installCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func installCmdRun(cmd *cobra.Command, args []string) error {
|
func installCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if !utils.containsItemString(supportedArch, installArch) {
|
||||||
|
return fmt.Errorf("arch %s is not supported, can be %v", installArch, supportedArch)
|
||||||
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
@@ -103,7 +111,7 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
logger.Generatef("generating manifests")
|
logger.Generatef("generating manifests")
|
||||||
}
|
}
|
||||||
if kustomizePath == "" {
|
if kustomizePath == "" {
|
||||||
err = genInstallManifests(installVersion, namespace, installComponents, installRegistry, installImagePullSecret, tmpDir)
|
err = genInstallManifests(installVersion, namespace, installComponents, installRegistry, installImagePullSecret, installArch, tmpDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("install failed: %w", err)
|
return fmt.Errorf("install failed: %w", err)
|
||||||
}
|
}
|
||||||
@@ -192,6 +200,7 @@ fieldSpecs:
|
|||||||
var kustomizationTmpl = `---
|
var kustomizationTmpl = `---
|
||||||
{{- $eventsAddr := .EventsAddr }}
|
{{- $eventsAddr := .EventsAddr }}
|
||||||
{{- $registry := .Registry }}
|
{{- $registry := .Registry }}
|
||||||
|
{{- $arch := .Arch }}
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: {{.Namespace}}
|
namespace: {{.Namespace}}
|
||||||
@@ -231,7 +240,11 @@ patchesJson6902:
|
|||||||
images:
|
images:
|
||||||
{{- range $i, $component := .Components }}
|
{{- range $i, $component := .Components }}
|
||||||
- name: fluxcd/{{$component}}
|
- name: fluxcd/{{$component}}
|
||||||
|
{{- if eq $arch "amd64" }}
|
||||||
newName: {{$registry}}/{{$component}}
|
newName: {{$registry}}/{{$component}}
|
||||||
|
{{- else }}
|
||||||
|
newName: {{$registry}}/{{$component}}-{{$arch}}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
`
|
`
|
||||||
@@ -253,7 +266,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
kubernetes.io/arch: amd64
|
kubernetes.io/arch: {{.Arch}}
|
||||||
kubernetes.io/os: linux
|
kubernetes.io/os: linux
|
||||||
{{- if .ImagePullSecret }}
|
{{- if .ImagePullSecret }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -295,7 +308,7 @@ func downloadManifests(version string, tmpDir string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func genInstallManifests(version string, namespace string, components []string, registry, imagePullSecret, tmpDir string) error {
|
func genInstallManifests(version string, namespace string, components []string, registry, imagePullSecret, arch, tmpDir string) error {
|
||||||
eventsAddr := ""
|
eventsAddr := ""
|
||||||
if utils.containsItemString(components, defaultNotification) {
|
if utils.containsItemString(components, defaultNotification) {
|
||||||
eventsAddr = fmt.Sprintf("http://%s/", defaultNotification)
|
eventsAddr = fmt.Sprintf("http://%s/", defaultNotification)
|
||||||
@@ -308,6 +321,7 @@ func genInstallManifests(version string, namespace string, components []string,
|
|||||||
EventsAddr string
|
EventsAddr string
|
||||||
Registry string
|
Registry string
|
||||||
ImagePullSecret string
|
ImagePullSecret string
|
||||||
|
Arch string
|
||||||
}{
|
}{
|
||||||
Version: version,
|
Version: version,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
@@ -315,6 +329,7 @@ func genInstallManifests(version string, namespace string, components []string,
|
|||||||
EventsAddr: eventsAddr,
|
EventsAddr: eventsAddr,
|
||||||
Registry: registry,
|
Registry: registry,
|
||||||
ImagePullSecret: imagePullSecret,
|
ImagePullSecret: imagePullSecret,
|
||||||
|
Arch: arch,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := downloadManifests(version, tmpDir); err != nil {
|
if err := downloadManifests(version, tmpDir); err != nil {
|
||||||
@@ -26,41 +26,43 @@ import (
|
|||||||
"github.com/spf13/cobra/doc"
|
"github.com/spf13/cobra/doc"
|
||||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||||
|
|
||||||
tklog "github.com/fluxcd/toolkit/pkg/log"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||||
|
|
||||||
|
gotklog "github.com/fluxcd/toolkit/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var VERSION = "0.0.0-dev.0"
|
var VERSION = "0.0.0-dev.0"
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "tk",
|
Use: "gotk",
|
||||||
Version: VERSION,
|
Version: VERSION,
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
SilenceErrors: true,
|
SilenceErrors: true,
|
||||||
Short: "Command line utility for assembling Kubernetes CD pipelines",
|
Short: "Command line utility for assembling Kubernetes CD pipelines",
|
||||||
Long: `Command line utility for assembling Kubernetes CD pipelines the GitOps way.`,
|
Long: `Command line utility for assembling Kubernetes CD pipelines the GitOps way.`,
|
||||||
Example: ` # Check prerequisites
|
Example: ` # Check prerequisites
|
||||||
tk check --pre
|
gotk check --pre
|
||||||
|
|
||||||
# Install the latest version of the toolkit
|
# Install the latest version of the toolkit
|
||||||
tk install --version=master
|
gotk install --version=master
|
||||||
|
|
||||||
# Create a source from a public Git repository
|
# Create a source from a public Git repository
|
||||||
tk create source git webapp-latest \
|
gotk create source git webapp-latest \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--branch=master \
|
--branch=master \
|
||||||
--interval=3m
|
--interval=3m
|
||||||
|
|
||||||
# List GitRepository sources and their status
|
# List GitRepository sources and their status
|
||||||
tk get sources git
|
gotk get sources git
|
||||||
|
|
||||||
# Trigger a GitRepository source sync
|
# Trigger a GitRepository source reconciliation
|
||||||
tk sync source git webapp-latest
|
gotk reconcile source git gitops-system
|
||||||
|
|
||||||
# Export GitRepository sources in YAML format
|
# Export GitRepository sources in YAML format
|
||||||
tk export source git --all > sources.yaml
|
gotk export source git --all > sources.yaml
|
||||||
|
|
||||||
# Create a Kustomization for deploying a series of microservices
|
# Create a Kustomization for deploying a series of microservices
|
||||||
tk create kustomization webapp-dev \
|
gotk create kustomization webapp-dev \
|
||||||
--source=webapp-latest \
|
--source=webapp-latest \
|
||||||
--path="./deploy/webapp/" \
|
--path="./deploy/webapp/" \
|
||||||
--prune=true \
|
--prune=true \
|
||||||
@@ -71,25 +73,25 @@ var rootCmd = &cobra.Command{
|
|||||||
--health-check-timeout=2m
|
--health-check-timeout=2m
|
||||||
|
|
||||||
# Trigger a git sync of the Kustomization's source and apply changes
|
# Trigger a git sync of the Kustomization's source and apply changes
|
||||||
tk reconcile kustomization webapp-dev --with-source
|
gotk reconcile kustomization webapp-dev --with-source
|
||||||
|
|
||||||
# Suspend a Kustomization reconciliation
|
# Suspend a Kustomization reconciliation
|
||||||
tk suspend kustomization webapp-dev
|
gotk suspend kustomization webapp-dev
|
||||||
|
|
||||||
# Export Kustomizations in YAML format
|
# Export Kustomizations in YAML format
|
||||||
tk export kustomization --all > kustomizations.yaml
|
gotk export kustomization --all > kustomizations.yaml
|
||||||
|
|
||||||
# Resume a Kustomization reconciliation
|
# Resume a Kustomization reconciliation
|
||||||
tk resume kustomization webapp-dev
|
gotk resume kustomization webapp-dev
|
||||||
|
|
||||||
# Delete a Kustomization
|
# Delete a Kustomization
|
||||||
tk delete kustomization webapp-dev
|
gotk delete kustomization webapp-dev
|
||||||
|
|
||||||
# Delete a GitRepository source
|
# Delete a GitRepository source
|
||||||
tk delete source git webapp-latest
|
gotk delete source git webapp-latest
|
||||||
|
|
||||||
# Uninstall the toolkit and delete CRDs
|
# Uninstall the toolkit and delete CRDs
|
||||||
tk uninstall --crds
|
gotk uninstall --crds
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,15 +101,18 @@ var (
|
|||||||
timeout time.Duration
|
timeout time.Duration
|
||||||
verbose bool
|
verbose bool
|
||||||
utils Utils
|
utils Utils
|
||||||
pollInterval = 2 * time.Second
|
pollInterval = 2 * time.Second
|
||||||
logger tklog.Logger = printLogger{}
|
logger gotklog.Logger = printLogger{}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
defaultComponents = []string{"source-controller", "kustomize-controller", "helm-controller", "notification-controller"}
|
defaultComponents = []string{"source-controller", "kustomize-controller", "helm-controller", "notification-controller"}
|
||||||
defaultVersion = "latest"
|
defaultVersion = "latest"
|
||||||
defaultNamespace = "gitops-system"
|
defaultNamespace = "gitops-system"
|
||||||
defaultNotification = "notification-controller"
|
defaultNotification = "notification-controller"
|
||||||
|
supportedArch = []string{"arm64", "amd64"}
|
||||||
|
supportedDecryptionProviders = []string{"sops"}
|
||||||
|
supportedHelmChartSourceKinds = []string{sourcev1.HelmRepositoryKind, sourcev1.GitRepositoryKind}
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -21,6 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
@@ -37,10 +38,10 @@ var reconcileHrCmd = &cobra.Command{
|
|||||||
Long: `
|
Long: `
|
||||||
The reconcile kustomization command triggers a reconciliation of a HelmRelease resource and waits for it to finish.`,
|
The reconcile kustomization command triggers a reconciliation of a HelmRelease resource and waits for it to finish.`,
|
||||||
Example: ` # Trigger a HelmRelease apply outside of the reconciliation interval
|
Example: ` # Trigger a HelmRelease apply outside of the reconciliation interval
|
||||||
tk reconcile hr podinfo
|
gotk reconcile hr podinfo
|
||||||
|
|
||||||
# Trigger a reconciliation of the HelmRelease's source and apply changes
|
# Trigger a reconciliation of the HelmRelease's source and apply changes
|
||||||
tk reconcile hr podinfo --with-source
|
gotk reconcile hr podinfo --with-source
|
||||||
`,
|
`,
|
||||||
RunE: reconcileHrCmdRun,
|
RunE: reconcileHrCmdRun,
|
||||||
}
|
}
|
||||||
@@ -81,7 +82,12 @@ func reconcileHrCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if syncHrWithSource {
|
if syncHrWithSource {
|
||||||
err := syncSourceHelmCmdRun(nil, []string{helmRelease.Spec.Chart.SourceRef.Name})
|
switch helmRelease.Spec.Chart.Spec.SourceRef.Kind {
|
||||||
|
case sourcev1.HelmRepositoryKind:
|
||||||
|
err = syncSourceHelmCmdRun(nil, []string{helmRelease.Spec.Chart.Spec.SourceRef.Name})
|
||||||
|
case sourcev1.GitRepositoryKind:
|
||||||
|
err = syncSourceGitCmdRun(nil, []string{helmRelease.Spec.Chart.Spec.SourceRef.Name})
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -138,7 +144,7 @@ func isHelmReleaseReady(ctx context.Context, kubeClient client.Client, name, nam
|
|||||||
if condition.Type == helmv2.ReadyCondition {
|
if condition.Type == helmv2.ReadyCondition {
|
||||||
if condition.Status == corev1.ConditionTrue {
|
if condition.Status == corev1.ConditionTrue {
|
||||||
return true, nil
|
return true, nil
|
||||||
} else if condition.Status == corev1.ConditionFalse {
|
} else if condition.Status == corev1.ConditionFalse && helmRelease.Status.LastAttemptedRevision != "" {
|
||||||
return false, fmt.Errorf(condition.Message)
|
return false, fmt.Errorf(condition.Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,10 +34,10 @@ var reconcileKsCmd = &cobra.Command{
|
|||||||
Long: `
|
Long: `
|
||||||
The reconcile kustomization command triggers a reconciliation of a Kustomization resource and waits for it to finish.`,
|
The reconcile kustomization command triggers a reconciliation of a Kustomization resource and waits for it to finish.`,
|
||||||
Example: ` # Trigger a Kustomization apply outside of the reconciliation interval
|
Example: ` # Trigger a Kustomization apply outside of the reconciliation interval
|
||||||
tk reconcile kustomization podinfo
|
gotk reconcile kustomization podinfo
|
||||||
|
|
||||||
# Trigger a sync of the Kustomization's source and apply changes
|
# Trigger a sync of the Kustomization's source and apply changes
|
||||||
tk reconcile kustomization podinfo --with-source
|
gotk reconcile kustomization podinfo --with-source
|
||||||
`,
|
`,
|
||||||
RunE: reconcileKsCmdRun,
|
RunE: reconcileKsCmdRun,
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ var reconcileSourceGitCmd = &cobra.Command{
|
|||||||
Short: "Reconcile a GitRepository source",
|
Short: "Reconcile a GitRepository source",
|
||||||
Long: `The reconcile source command triggers a reconciliation of a GitRepository resource and waits for it to finish.`,
|
Long: `The reconcile source command triggers a reconciliation of a GitRepository resource and waits for it to finish.`,
|
||||||
Example: ` # Trigger a git pull for an existing source
|
Example: ` # Trigger a git pull for an existing source
|
||||||
tk reconcile source git podinfo
|
gotk reconcile source git podinfo
|
||||||
`,
|
`,
|
||||||
RunE: syncSourceGitCmdRun,
|
RunE: syncSourceGitCmdRun,
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@ var reconcileSourceHelmCmd = &cobra.Command{
|
|||||||
Short: "Reconcile a HelmRepository source",
|
Short: "Reconcile a HelmRepository source",
|
||||||
Long: `The reconcile source command triggers a reconciliation of a HelmRepository resource and waits for it to finish.`,
|
Long: `The reconcile source command triggers a reconciliation of a HelmRepository resource and waits for it to finish.`,
|
||||||
Example: ` # Trigger a reconciliation for an existing source
|
Example: ` # Trigger a reconciliation for an existing source
|
||||||
tk reconcile source helm podinfo
|
gotk reconcile source helm podinfo
|
||||||
`,
|
`,
|
||||||
RunE: syncSourceHelmCmdRun,
|
RunE: syncSourceHelmCmdRun,
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ var resumeHrCmd = &cobra.Command{
|
|||||||
Long: `The resume command marks a previously suspended HelmRelease resource for reconciliation and waits for it to
|
Long: `The resume command marks a previously suspended HelmRelease resource for reconciliation and waits for it to
|
||||||
finish the apply.`,
|
finish the apply.`,
|
||||||
Example: ` # Resume reconciliation for an existing Helm release
|
Example: ` # Resume reconciliation for an existing Helm release
|
||||||
tk resume hr podinfo
|
gotk resume hr podinfo
|
||||||
`,
|
`,
|
||||||
RunE: resumeHrCmdRun,
|
RunE: resumeHrCmdRun,
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ var resumeKsCmd = &cobra.Command{
|
|||||||
Long: `The resume command marks a previously suspended Kustomization resource for reconciliation and waits for it to
|
Long: `The resume command marks a previously suspended Kustomization resource for reconciliation and waits for it to
|
||||||
finish the apply.`,
|
finish the apply.`,
|
||||||
Example: ` # Resume reconciliation for an existing Kustomization
|
Example: ` # Resume reconciliation for an existing Kustomization
|
||||||
tk resume ks podinfo
|
gotk resume ks podinfo
|
||||||
`,
|
`,
|
||||||
RunE: resumeKsCmdRun,
|
RunE: resumeKsCmdRun,
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ var suspendHrCmd = &cobra.Command{
|
|||||||
Short: "Suspend reconciliation of HelmRelease",
|
Short: "Suspend reconciliation of HelmRelease",
|
||||||
Long: "The suspend command disables the reconciliation of a HelmRelease resource.",
|
Long: "The suspend command disables the reconciliation of a HelmRelease resource.",
|
||||||
Example: ` # Suspend reconciliation for an existing Helm release
|
Example: ` # Suspend reconciliation for an existing Helm release
|
||||||
tk suspend hr podinfo
|
gotk suspend hr podinfo
|
||||||
`,
|
`,
|
||||||
RunE: suspendHrCmdRun,
|
RunE: suspendHrCmdRun,
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ var suspendKsCmd = &cobra.Command{
|
|||||||
Short: "Suspend reconciliation of Kustomization",
|
Short: "Suspend reconciliation of Kustomization",
|
||||||
Long: "The suspend command disables the reconciliation of a Kustomization resource.",
|
Long: "The suspend command disables the reconciliation of a Kustomization resource.",
|
||||||
Example: ` # Suspend reconciliation for an existing Kustomization
|
Example: ` # Suspend reconciliation for an existing Kustomization
|
||||||
tk suspend ks podinfo
|
gotk suspend ks podinfo
|
||||||
`,
|
`,
|
||||||
RunE: suspendKsCmdRun,
|
RunE: suspendKsCmdRun,
|
||||||
}
|
}
|
||||||
@@ -32,10 +32,10 @@ var uninstallCmd = &cobra.Command{
|
|||||||
Short: "Uninstall the toolkit components",
|
Short: "Uninstall the toolkit components",
|
||||||
Long: "The uninstall command removes the namespace, cluster roles, cluster role bindings and CRDs from the cluster.",
|
Long: "The uninstall command removes the namespace, cluster roles, cluster role bindings and CRDs from the cluster.",
|
||||||
Example: ` # Dry-run uninstall of all components
|
Example: ` # Dry-run uninstall of all components
|
||||||
tk uninstall --dry-run --namespace=gitops-system
|
gotk uninstall --dry-run --namespace=gitops-system
|
||||||
|
|
||||||
# Uninstall all components and delete custom resource definitions
|
# Uninstall all components and delete custom resource definitions
|
||||||
tk uninstall --resources --crds --namespace=gitops-system
|
gotk uninstall --resources --crds --namespace=gitops-system
|
||||||
`,
|
`,
|
||||||
RunE: uninstallCmdRun,
|
RunE: uninstallCmdRun,
|
||||||
}
|
}
|
||||||
BIN
docs/_files/cp-dashboard-p1.png
Normal file
BIN
docs/_files/cp-dashboard-p1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
BIN
docs/_files/cp-dashboard-p2.png
Normal file
BIN
docs/_files/cp-dashboard-p2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
73
docs/_static/custom.css
vendored
73
docs/_static/custom.css
vendored
@@ -22,3 +22,76 @@ body {
|
|||||||
.md-header-nav__title {
|
.md-header-nav__title {
|
||||||
font-size: .85rem;
|
font-size: .85rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.check-bullet {
|
||||||
|
color:#07bfa5;
|
||||||
|
background-color: white;
|
||||||
|
margin-left:-22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Progress bar styling */
|
||||||
|
|
||||||
|
.progress-label {
|
||||||
|
position: absolute;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 100%;
|
||||||
|
/* remove original styling for thin styling
|
||||||
|
margin: 0 ! important; */
|
||||||
|
margin-top: -0.4rem ! important;
|
||||||
|
line-height: 1.2rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar {
|
||||||
|
/*remove original styling for thin styling
|
||||||
|
height: 1.2rem; */
|
||||||
|
height: 0.4rem;
|
||||||
|
float: left;
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
45deg,
|
||||||
|
rgba(255, 255, 255, 0.2),
|
||||||
|
rgba(255, 255, 255, 0.2) 10px,
|
||||||
|
rgba(255, 255, 255, 0.3) 10px,
|
||||||
|
rgba(255, 255, 255, 0.3) 20px
|
||||||
|
) #2979ff;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
/* remove original styling for thin styling
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
height: 1.2rem; */
|
||||||
|
margin-top: 0.9rem;
|
||||||
|
height: 0.4rem;
|
||||||
|
background-color: #eeeeee;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-100plus .progress-bar {
|
||||||
|
background-color: #00c853;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-80plus .progress-bar {
|
||||||
|
background-color: #64dd17;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-60plus .progress-bar {
|
||||||
|
background-color: #fbc02d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-40plus .progress-bar {
|
||||||
|
background-color: #ff9100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-20plus .progress-bar {
|
||||||
|
background-color: #ff5252;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-0plus .progress-bar {
|
||||||
|
background-color: #ff1744;
|
||||||
|
}
|
||||||
91
docs/cmd/gotk.md
Normal file
91
docs/cmd/gotk.md
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
## gotk
|
||||||
|
|
||||||
|
Command line utility for assembling Kubernetes CD pipelines
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
Command line utility for assembling Kubernetes CD pipelines the GitOps way.
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Check prerequisites
|
||||||
|
gotk check --pre
|
||||||
|
|
||||||
|
# Install the latest version of the toolkit
|
||||||
|
gotk install --version=master
|
||||||
|
|
||||||
|
# Create a source from a public Git repository
|
||||||
|
gotk create source git webapp-latest \
|
||||||
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
|
--branch=master \
|
||||||
|
--interval=3m
|
||||||
|
|
||||||
|
# List GitRepository sources and their status
|
||||||
|
gotk get sources git
|
||||||
|
|
||||||
|
# Trigger a GitRepository source reconciliation
|
||||||
|
gotk reconcile source git gitops-system
|
||||||
|
|
||||||
|
# Export GitRepository sources in YAML format
|
||||||
|
gotk export source git --all > sources.yaml
|
||||||
|
|
||||||
|
# Create a Kustomization for deploying a series of microservices
|
||||||
|
gotk create kustomization webapp-dev \
|
||||||
|
--source=webapp-latest \
|
||||||
|
--path="./deploy/webapp/" \
|
||||||
|
--prune=true \
|
||||||
|
--interval=5m \
|
||||||
|
--validation=client \
|
||||||
|
--health-check="Deployment/backend.webapp" \
|
||||||
|
--health-check="Deployment/frontend.webapp" \
|
||||||
|
--health-check-timeout=2m
|
||||||
|
|
||||||
|
# Trigger a git sync of the Kustomization's source and apply changes
|
||||||
|
gotk reconcile kustomization webapp-dev --with-source
|
||||||
|
|
||||||
|
# Suspend a Kustomization reconciliation
|
||||||
|
gotk suspend kustomization webapp-dev
|
||||||
|
|
||||||
|
# Export Kustomizations in YAML format
|
||||||
|
gotk export kustomization --all > kustomizations.yaml
|
||||||
|
|
||||||
|
# Resume a Kustomization reconciliation
|
||||||
|
gotk resume kustomization webapp-dev
|
||||||
|
|
||||||
|
# Delete a Kustomization
|
||||||
|
gotk delete kustomization webapp-dev
|
||||||
|
|
||||||
|
# Delete a GitRepository source
|
||||||
|
gotk delete source git webapp-latest
|
||||||
|
|
||||||
|
# Uninstall the toolkit and delete CRDs
|
||||||
|
gotk uninstall --crds
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for gotk
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
|
--verbose print generated objects
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [gotk bootstrap](gotk_bootstrap.md) - Bootstrap toolkit components
|
||||||
|
* [gotk check](gotk_check.md) - Check requirements and installation
|
||||||
|
* [gotk completion](gotk_completion.md) - Generates bash completion scripts
|
||||||
|
* [gotk create](gotk_create.md) - Create or update sources and resources
|
||||||
|
* [gotk delete](gotk_delete.md) - Delete sources and resources
|
||||||
|
* [gotk export](gotk_export.md) - Export resources in YAML format
|
||||||
|
* [gotk get](gotk_get.md) - Get sources and resources
|
||||||
|
* [gotk install](gotk_install.md) - Install the toolkit components
|
||||||
|
* [gotk reconcile](gotk_reconcile.md) - Reconcile sources and resources
|
||||||
|
* [gotk resume](gotk_resume.md) - Resume suspended resources
|
||||||
|
* [gotk suspend](gotk_suspend.md) - Suspend resources
|
||||||
|
* [gotk uninstall](gotk_uninstall.md) - Uninstall the toolkit components
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk bootstrap
|
## gotk bootstrap
|
||||||
|
|
||||||
Bootstrap toolkit components
|
Bootstrap toolkit components
|
||||||
|
|
||||||
@@ -9,10 +9,12 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--arch string arch can be amd64 or arm64 (default "amd64")
|
||||||
|
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "master")
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
||||||
-h, --help help for bootstrap
|
-h, --help help for bootstrap
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
||||||
--registry string container registry where the toolkit images are published (default "docker.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
-v, --version string toolkit version (default "latest")
|
-v, --version string toolkit version (default "latest")
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -27,7 +29,7 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk bootstrap github](tk_bootstrap_github.md) - Bootstrap toolkit components in a GitHub repository
|
* [gotk bootstrap github](gotk_bootstrap_github.md) - Bootstrap toolkit components in a GitHub repository
|
||||||
* [tk bootstrap gitlab](tk_bootstrap_gitlab.md) - Bootstrap toolkit components in a GitLab repository
|
* [gotk bootstrap gitlab](gotk_bootstrap_gitlab.md) - Bootstrap toolkit components in a GitLab repository
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk bootstrap github
|
## gotk bootstrap github
|
||||||
|
|
||||||
Bootstrap toolkit components in a GitHub repository
|
Bootstrap toolkit components in a GitHub repository
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ If the toolkit components are present on the cluster,
|
|||||||
the bootstrap command will perform an upgrade if needed.
|
the bootstrap command will perform an upgrade if needed.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk bootstrap github [flags]
|
gotk bootstrap github [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@@ -21,19 +21,22 @@ tk bootstrap github [flags]
|
|||||||
export GITHUB_TOKEN=<my-token>
|
export GITHUB_TOKEN=<my-token>
|
||||||
|
|
||||||
# Run bootstrap for a private repo owned by a GitHub organization
|
# Run bootstrap for a private repo owned by a GitHub organization
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name>
|
gotk bootstrap github --owner=<organization> --repository=<repo name>
|
||||||
|
|
||||||
# Run bootstrap for a private repo and assign organization teams to it
|
# Run bootstrap for a private repo and assign organization teams to it
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
|
||||||
|
|
||||||
# Run bootstrap for a repository path
|
# Run bootstrap for a repository path
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
|
||||||
|
|
||||||
# Run bootstrap for a public repository on a personal account
|
# Run bootstrap for a public repository on a personal account
|
||||||
tk bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
|
gotk bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
|
||||||
|
|
||||||
# Run bootstrap for a private repo hosted on GitHub Enterprise
|
# Run bootstrap for a private repo hosted on GitHub Enterprise
|
||||||
tk bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain>
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain>
|
||||||
|
|
||||||
|
# Run bootstrap for a an existing repository with a branch named main
|
||||||
|
gotk bootstrap github --owner=<organization> --repository=<repo name> --branch=main
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -54,11 +57,13 @@ tk bootstrap github [flags]
|
|||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--arch string arch can be amd64 or arm64 (default "amd64")
|
||||||
|
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "master")
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
||||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
--registry string container registry where the toolkit images are published (default "docker.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
--verbose print generated objects
|
--verbose print generated objects
|
||||||
-v, --version string toolkit version (default "latest")
|
-v, --version string toolkit version (default "latest")
|
||||||
@@ -66,5 +71,5 @@ tk bootstrap github [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk bootstrap](tk_bootstrap.md) - Bootstrap toolkit components
|
* [gotk bootstrap](gotk_bootstrap.md) - Bootstrap toolkit components
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk bootstrap gitlab
|
## gotk bootstrap gitlab
|
||||||
|
|
||||||
Bootstrap toolkit components in a GitLab repository
|
Bootstrap toolkit components in a GitLab repository
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ If the toolkit components are present on the cluster,
|
|||||||
the bootstrap command will perform an upgrade if needed.
|
the bootstrap command will perform an upgrade if needed.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk bootstrap gitlab [flags]
|
gotk bootstrap gitlab [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@@ -21,40 +21,46 @@ tk bootstrap gitlab [flags]
|
|||||||
export GITLAB_TOKEN=<my-token>
|
export GITLAB_TOKEN=<my-token>
|
||||||
|
|
||||||
# Run bootstrap for a private repo owned by a GitLab group
|
# Run bootstrap for a private repo owned by a GitLab group
|
||||||
tk bootstrap gitlab --owner=<group> --repository=<repo name>
|
gotk bootstrap gitlab --owner=<group> --repository=<repo name>
|
||||||
|
|
||||||
# Run bootstrap for a repository path
|
# Run bootstrap for a repository path
|
||||||
tk bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
|
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
|
||||||
|
|
||||||
# Run bootstrap for a public repository on a personal account
|
# Run bootstrap for a public repository on a personal account
|
||||||
tk bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true
|
gotk bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true
|
||||||
|
|
||||||
# Run bootstrap for a private repo hosted on a GitLab server
|
# Run bootstrap for a private repo hosted on a GitLab server
|
||||||
tk bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain>
|
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain>
|
||||||
|
|
||||||
|
# Run bootstrap for a an existing repository with a branch named main
|
||||||
|
gotk bootstrap gitlab --owner=<organization> --repository=<repo name> --branch=main
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
-h, --help help for gitlab
|
-h, --help help for gitlab
|
||||||
--hostname string GitLab hostname (default "gitlab.com")
|
--hostname string GitLab hostname (default "gitlab.com")
|
||||||
--interval duration sync interval (default 1m0s)
|
--interval duration sync interval (default 1m0s)
|
||||||
--owner string GitLab user or group name
|
--owner string GitLab user or group name
|
||||||
--path string repository path, when specified the cluster sync will be scoped to this path
|
--path string repository path, when specified the cluster sync will be scoped to this path
|
||||||
--personal is personal repository
|
--personal is personal repository
|
||||||
--private is private repository (default true)
|
--private is private repository (default true)
|
||||||
--repository string GitLab repository name
|
--repository string GitLab repository name
|
||||||
|
--ssh-hostname string GitLab SSH hostname, defaults to hostname if not specified
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--arch string arch can be amd64 or arm64 (default "amd64")
|
||||||
|
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "master")
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
||||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
--registry string container registry where the toolkit images are published (default "docker.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
--verbose print generated objects
|
--verbose print generated objects
|
||||||
-v, --version string toolkit version (default "latest")
|
-v, --version string toolkit version (default "latest")
|
||||||
@@ -62,5 +68,5 @@ tk bootstrap gitlab [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk bootstrap](tk_bootstrap.md) - Bootstrap toolkit components
|
* [gotk bootstrap](gotk_bootstrap.md) - Bootstrap toolkit components
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk check
|
## gotk check
|
||||||
|
|
||||||
Check requirements and installation
|
Check requirements and installation
|
||||||
|
|
||||||
@@ -8,17 +8,17 @@ The check command will perform a series of checks to validate that
|
|||||||
the local environment is configured correctly and if the installed components are healthy.
|
the local environment is configured correctly and if the installed components are healthy.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk check [flags]
|
gotk check [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Run pre-installation checks
|
# Run pre-installation checks
|
||||||
tk check --pre
|
gotk check --pre
|
||||||
|
|
||||||
# Run installation checks
|
# Run installation checks
|
||||||
tk check
|
gotk check
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -41,5 +41,5 @@ tk check [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk completion
|
## gotk completion
|
||||||
|
|
||||||
Generates bash completion scripts
|
Generates bash completion scripts
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ Generates bash completion scripts
|
|||||||
Generates bash completion scripts
|
Generates bash completion scripts
|
||||||
|
|
||||||
```
|
```
|
||||||
tk completion [flags]
|
gotk completion [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@@ -15,12 +15,12 @@ tk completion [flags]
|
|||||||
```
|
```
|
||||||
To load completion run
|
To load completion run
|
||||||
|
|
||||||
. <(tk completion)
|
. <(gotk completion)
|
||||||
|
|
||||||
To configure your bash shell to load completions for each session add to your bashrc
|
To configure your bash shell to load completions for each session add to your bashrc
|
||||||
|
|
||||||
# ~/.bashrc or ~/.profile
|
# ~/.bashrc or ~/.profile
|
||||||
. <(tk completion)
|
. <(gotk completion)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -41,5 +41,5 @@ To configure your bash shell to load completions for each session add to your ba
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk create
|
## gotk create
|
||||||
|
|
||||||
Create or update sources and resources
|
Create or update sources and resources
|
||||||
|
|
||||||
@@ -12,6 +12,7 @@ The create sub-commands generate sources and resources.
|
|||||||
--export export in YAML format to stdout
|
--export export in YAML format to stdout
|
||||||
-h, --help help for create
|
-h, --help help for create
|
||||||
--interval duration source sync interval (default 1m0s)
|
--interval duration source sync interval (default 1m0s)
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
@@ -25,8 +26,8 @@ The create sub-commands generate sources and resources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk create helmrelease](tk_create_helmrelease.md) - Create or update a HelmRelease resource
|
* [gotk create helmrelease](gotk_create_helmrelease.md) - Create or update a HelmRelease resource
|
||||||
* [tk create kustomization](tk_create_kustomization.md) - Create or update a Kustomization resource
|
* [gotk create kustomization](gotk_create_kustomization.md) - Create or update a Kustomization resource
|
||||||
* [tk create source](tk_create_source.md) - Create or update sources
|
* [gotk create source](gotk_create_source.md) - Create or update sources
|
||||||
|
|
||||||
84
docs/cmd/gotk_create_helmrelease.md
Normal file
84
docs/cmd/gotk_create_helmrelease.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
## gotk create helmrelease
|
||||||
|
|
||||||
|
Create or update a HelmRelease resource
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.
|
||||||
|
|
||||||
|
```
|
||||||
|
gotk create helmrelease [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Create a HelmRelease with a chart from a HelmRepository source
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--interval=10m \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
--chart-version=">4.0.0"
|
||||||
|
|
||||||
|
# Create a HelmRelease with a chart from a GitRepository source
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--interval=10m \
|
||||||
|
--source=GitRepository/podinfo \
|
||||||
|
--chart=./charts/podinfo
|
||||||
|
|
||||||
|
# Create a HelmRelease with values from a local YAML file
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
--values=./my-values.yaml
|
||||||
|
|
||||||
|
# Create a HelmRelease with a custom release name
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--release-name=podinfo-dev
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
|
||||||
|
# Create a HelmRelease targeting another namespace than the resource
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--target-namespace=default \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo
|
||||||
|
|
||||||
|
# Create a HelmRelease definition on disk without applying it on the cluster
|
||||||
|
gotk create hr podinfo \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
--values=./values.yaml \
|
||||||
|
--export > podinfo-release.yaml
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
--chart string Helm chart name or path
|
||||||
|
--chart-version string Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)
|
||||||
|
--depends-on stringArray HelmReleases that must be ready before this release can be installed
|
||||||
|
-h, --help help for helmrelease
|
||||||
|
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<hr-name>'
|
||||||
|
--source string source that contains the chart (<kind>/<name>)
|
||||||
|
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
|
||||||
|
--values string local path to the values.yaml file
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--export export in YAML format to stdout
|
||||||
|
--interval duration source sync interval (default 1m0s)
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
|
--verbose print generated objects
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [gotk create](gotk_create.md) - Create or update sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk create kustomization
|
## gotk create kustomization
|
||||||
|
|
||||||
Create or update a Kustomization resource
|
Create or update a Kustomization resource
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Create or update a Kustomization resource
|
|||||||
The kustomization source create command generates a Kustomize resource for a given GitRepository source.
|
The kustomization source create command generates a Kustomize resource for a given GitRepository source.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk create kustomization [name] [flags]
|
gotk create kustomization [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Create a Kustomization resource from a source at a given path
|
# Create a Kustomization resource from a source at a given path
|
||||||
tk create kustomization contour \
|
gotk create kustomization contour \
|
||||||
--source=contour \
|
--source=contour \
|
||||||
--path="./examples/contour/" \
|
--path="./examples/contour/" \
|
||||||
--prune=true \
|
--prune=true \
|
||||||
@@ -25,7 +25,7 @@ tk create kustomization [name] [flags]
|
|||||||
--health-check-timeout=3m
|
--health-check-timeout=3m
|
||||||
|
|
||||||
# Create a Kustomization resource that depends on the previous one
|
# Create a Kustomization resource that depends on the previous one
|
||||||
tk create kustomization webapp \
|
gotk create kustomization webapp \
|
||||||
--depends-on=contour \
|
--depends-on=contour \
|
||||||
--source=webapp \
|
--source=webapp \
|
||||||
--path="./deploy/overlays/dev" \
|
--path="./deploy/overlays/dev" \
|
||||||
@@ -34,7 +34,7 @@ tk create kustomization [name] [flags]
|
|||||||
--validation=client
|
--validation=client
|
||||||
|
|
||||||
# Create a Kustomization resource that runs under a service account
|
# Create a Kustomization resource that runs under a service account
|
||||||
tk create kustomization webapp \
|
gotk create kustomization webapp \
|
||||||
--source=webapp \
|
--source=webapp \
|
||||||
--path="./deploy/overlays/staging" \
|
--path="./deploy/overlays/staging" \
|
||||||
--prune=true \
|
--prune=true \
|
||||||
@@ -48,6 +48,8 @@ tk create kustomization [name] [flags]
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--decryption-provider string enables secrets decryption, provider can be 'sops'
|
||||||
|
--decryption-secret string set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption
|
||||||
--depends-on stringArray Kustomization that must be ready before this Kustomization can be applied
|
--depends-on stringArray Kustomization that must be ready before this Kustomization can be applied
|
||||||
--health-check stringArray workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'
|
--health-check stringArray workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'
|
||||||
--health-check-timeout duration timeout of health checking operations (default 2m0s)
|
--health-check-timeout duration timeout of health checking operations (default 2m0s)
|
||||||
@@ -66,6 +68,7 @@ tk create kustomization [name] [flags]
|
|||||||
--export export in YAML format to stdout
|
--export export in YAML format to stdout
|
||||||
--interval duration source sync interval (default 1m0s)
|
--interval duration source sync interval (default 1m0s)
|
||||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
--verbose print generated objects
|
--verbose print generated objects
|
||||||
@@ -73,5 +76,5 @@ tk create kustomization [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk create](tk_create.md) - Create or update sources and resources
|
* [gotk create](gotk_create.md) - Create or update sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk create source
|
## gotk create source
|
||||||
|
|
||||||
Create or update sources
|
Create or update sources
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ The create source sub-commands generate sources.
|
|||||||
--export export in YAML format to stdout
|
--export export in YAML format to stdout
|
||||||
--interval duration source sync interval (default 1m0s)
|
--interval duration source sync interval (default 1m0s)
|
||||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
--verbose print generated objects
|
--verbose print generated objects
|
||||||
@@ -25,7 +26,7 @@ The create source sub-commands generate sources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk create](tk_create.md) - Create or update sources and resources
|
* [gotk create](gotk_create.md) - Create or update sources and resources
|
||||||
* [tk create source git](tk_create_source_git.md) - Create or update a GitRepository source
|
* [gotk create source git](gotk_create_source_git.md) - Create or update a GitRepository source
|
||||||
* [tk create source helm](tk_create_source_helm.md) - Create or update a HelmRepository source
|
* [gotk create source helm](gotk_create_source_helm.md) - Create or update a HelmRepository source
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk create source git
|
## gotk create source git
|
||||||
|
|
||||||
Create or update a GitRepository source
|
Create or update a GitRepository source
|
||||||
|
|
||||||
@@ -10,42 +10,42 @@ For Git over SSH, host and SSH keys are automatically generated and stored in a
|
|||||||
For private Git repositories, the basic authentication credentials are stored in a Kubernetes secret.
|
For private Git repositories, the basic authentication credentials are stored in a Kubernetes secret.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk create source git [name] [flags]
|
gotk create source git [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Create a source from a public Git repository master branch
|
# Create a source from a public Git repository master branch
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--branch=master
|
--branch=master
|
||||||
|
|
||||||
# Create a source from a Git repository pinned to specific git tag
|
# Create a source from a Git repository pinned to specific git tag
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--tag="3.2.3"
|
--tag="3.2.3"
|
||||||
|
|
||||||
# Create a source from a public Git repository tag that matches a semver range
|
# Create a source from a public Git repository tag that matches a semver range
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--tag-semver=">=3.2.0 <3.3.0"
|
--tag-semver=">=3.2.0 <3.3.0"
|
||||||
|
|
||||||
# Create a source from a Git repository using SSH authentication
|
# Create a source from a Git repository using SSH authentication
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
--branch=master
|
--branch=master
|
||||||
|
|
||||||
# Create a source from a Git repository using SSH authentication and an
|
# Create a source from a Git repository using SSH authentication and an
|
||||||
# ECDSA P-521 curve public key
|
# ECDSA P-521 curve public key
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
--branch=master \
|
--branch=master \
|
||||||
--ssh-key-algorithm=ecdsa \
|
--ssh-key-algorithm=ecdsa \
|
||||||
--ssh-ecdsa-curve=p521
|
--ssh-ecdsa-curve=p521
|
||||||
|
|
||||||
# Create a source from a Git repository using basic authentication
|
# Create a source from a Git repository using basic authentication
|
||||||
tk create source git podinfo \
|
gotk create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--username=username \
|
--username=username \
|
||||||
--password=password
|
--password=password
|
||||||
@@ -73,6 +73,7 @@ tk create source git [name] [flags]
|
|||||||
--export export in YAML format to stdout
|
--export export in YAML format to stdout
|
||||||
--interval duration source sync interval (default 1m0s)
|
--interval duration source sync interval (default 1m0s)
|
||||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
--verbose print generated objects
|
--verbose print generated objects
|
||||||
@@ -80,5 +81,5 @@ tk create source git [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk create source](tk_create_source.md) - Create or update sources
|
* [gotk create source](gotk_create_source.md) - Create or update sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk create source helm
|
## gotk create source helm
|
||||||
|
|
||||||
Create or update a HelmRepository source
|
Create or update a HelmRepository source
|
||||||
|
|
||||||
@@ -9,32 +9,42 @@ The create source helm command generates a HelmRepository resource and waits for
|
|||||||
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.
|
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk create source helm [name] [flags]
|
gotk create source helm [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Create a source from a public Helm repository
|
# Create a source from a public Helm repository
|
||||||
tk create source helm podinfo \
|
gotk create source helm podinfo \
|
||||||
--url=https://stefanprodan.github.io/podinfo \
|
--url=https://stefanprodan.github.io/podinfo \
|
||||||
--interval=10m
|
--interval=10m
|
||||||
|
|
||||||
# Create a source from a Helm repository using basic authentication
|
# Create a source from a Helm repository using basic authentication
|
||||||
tk create source helm podinfo \
|
gotk create source helm podinfo \
|
||||||
--url=https://stefanprodan.github.io/podinfo \
|
--url=https://stefanprodan.github.io/podinfo \
|
||||||
--username=username \
|
--username=username \
|
||||||
--password=password
|
--password=password
|
||||||
|
|
||||||
|
# Create a source from a Helm repository using TLS authentication
|
||||||
|
gotk create source helm podinfo \
|
||||||
|
--url=https://stefanprodan.github.io/podinfo \
|
||||||
|
--cert-file=./cert.crt \
|
||||||
|
--key-file=./key.crt \
|
||||||
|
--ca-file=./ca.crt
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
-h, --help help for helm
|
--ca-file string TLS authentication CA file path
|
||||||
-p, --password string basic authentication password
|
--cert-file string TLS authentication cert file path
|
||||||
--url string Helm repository address
|
-h, --help help for helm
|
||||||
-u, --username string basic authentication username
|
--key-file string TLS authentication key file path
|
||||||
|
-p, --password string basic authentication password
|
||||||
|
--url string Helm repository address
|
||||||
|
-u, --username string basic authentication username
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
@@ -43,6 +53,7 @@ tk create source helm [name] [flags]
|
|||||||
--export export in YAML format to stdout
|
--export export in YAML format to stdout
|
||||||
--interval duration source sync interval (default 1m0s)
|
--interval duration source sync interval (default 1m0s)
|
||||||
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
--namespace string the namespace scope for this operation (default "gitops-system")
|
--namespace string the namespace scope for this operation (default "gitops-system")
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
--timeout duration timeout for this operation (default 5m0s)
|
||||||
--verbose print generated objects
|
--verbose print generated objects
|
||||||
@@ -50,5 +61,5 @@ tk create source helm [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk create source](tk_create_source.md) - Create or update sources
|
* [gotk create source](gotk_create_source.md) - Create or update sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk delete
|
## gotk delete
|
||||||
|
|
||||||
Delete sources and resources
|
Delete sources and resources
|
||||||
|
|
||||||
@@ -24,8 +24,8 @@ The delete sub-commands delete sources and resources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk delete helmrelease](tk_delete_helmrelease.md) - Delete a HelmRelease resource
|
* [gotk delete helmrelease](gotk_delete_helmrelease.md) - Delete a HelmRelease resource
|
||||||
* [tk delete kustomization](tk_delete_kustomization.md) - Delete a Kustomization resource
|
* [gotk delete kustomization](gotk_delete_kustomization.md) - Delete a Kustomization resource
|
||||||
* [tk delete source](tk_delete_source.md) - Delete sources
|
* [gotk delete source](gotk_delete_source.md) - Delete sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk delete helmrelease
|
## gotk delete helmrelease
|
||||||
|
|
||||||
Delete a HelmRelease resource
|
Delete a HelmRelease resource
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Delete a HelmRelease resource
|
|||||||
The delete helmrelease command removes the given HelmRelease from the cluster.
|
The delete helmrelease command removes the given HelmRelease from the cluster.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk delete helmrelease [name] [flags]
|
gotk delete helmrelease [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Delete a Helm release and the Kubernetes resources created by it
|
# Delete a Helm release and the Kubernetes resources created by it
|
||||||
tk delete hr podinfo
|
gotk delete hr podinfo
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,5 +36,5 @@ tk delete helmrelease [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk delete](tk_delete.md) - Delete sources and resources
|
* [gotk delete](gotk_delete.md) - Delete sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk delete kustomization
|
## gotk delete kustomization
|
||||||
|
|
||||||
Delete a Kustomization resource
|
Delete a Kustomization resource
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Delete a Kustomization resource
|
|||||||
The delete kustomization command deletes the given Kustomization from the cluster.
|
The delete kustomization command deletes the given Kustomization from the cluster.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk delete kustomization [name] [flags]
|
gotk delete kustomization [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Delete a kustomization and the Kubernetes resources created by it
|
# Delete a kustomization and the Kubernetes resources created by it
|
||||||
tk delete kustomization podinfo
|
gotk delete kustomization podinfo
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,5 +36,5 @@ tk delete kustomization [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk delete](tk_delete.md) - Delete sources and resources
|
* [gotk delete](gotk_delete.md) - Delete sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk delete source
|
## gotk delete source
|
||||||
|
|
||||||
Delete sources
|
Delete sources
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ The delete source sub-commands delete sources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk delete](tk_delete.md) - Delete sources and resources
|
* [gotk delete](gotk_delete.md) - Delete sources and resources
|
||||||
* [tk delete source git](tk_delete_source_git.md) - Delete a GitRepository source
|
* [gotk delete source git](gotk_delete_source_git.md) - Delete a GitRepository source
|
||||||
* [tk delete source helm](tk_delete_source_helm.md) - Delete a HelmRepository source
|
* [gotk delete source helm](gotk_delete_source_helm.md) - Delete a HelmRepository source
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk delete source git
|
## gotk delete source git
|
||||||
|
|
||||||
Delete a GitRepository source
|
Delete a GitRepository source
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Delete a GitRepository source
|
|||||||
The delete source git command deletes the given GitRepository from the cluster.
|
The delete source git command deletes the given GitRepository from the cluster.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk delete source git [name] [flags]
|
gotk delete source git [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Delete a Git repository
|
# Delete a Git repository
|
||||||
tk delete source git podinfo
|
gotk delete source git podinfo
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,5 +36,5 @@ tk delete source git [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk delete source](tk_delete_source.md) - Delete sources
|
* [gotk delete source](gotk_delete_source.md) - Delete sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk delete source helm
|
## gotk delete source helm
|
||||||
|
|
||||||
Delete a HelmRepository source
|
Delete a HelmRepository source
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Delete a HelmRepository source
|
|||||||
The delete source helm command deletes the given HelmRepository from the cluster.
|
The delete source helm command deletes the given HelmRepository from the cluster.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk delete source helm [name] [flags]
|
gotk delete source helm [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Delete a Helm repository
|
# Delete a Helm repository
|
||||||
tk delete source helm podinfo
|
gotk delete source helm podinfo
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,5 +36,5 @@ tk delete source helm [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk delete source](tk_delete_source.md) - Delete sources
|
* [gotk delete source](gotk_delete_source.md) - Delete sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk export
|
## gotk export
|
||||||
|
|
||||||
Export resources in YAML format
|
Export resources in YAML format
|
||||||
|
|
||||||
@@ -24,8 +24,8 @@ The export sub-commands export resources in YAML format.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk export helmrelease](tk_export_helmrelease.md) - Export HelmRelease resources in YAML format
|
* [gotk export helmrelease](gotk_export_helmrelease.md) - Export HelmRelease resources in YAML format
|
||||||
* [tk export kustomization](tk_export_kustomization.md) - Export Kustomization resources in YAML format
|
* [gotk export kustomization](gotk_export_kustomization.md) - Export Kustomization resources in YAML format
|
||||||
* [tk export source](tk_export_source.md) - Export sources
|
* [gotk export source](gotk_export_source.md) - Export sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk export helmrelease
|
## gotk export helmrelease
|
||||||
|
|
||||||
Export HelmRelease resources in YAML format
|
Export HelmRelease resources in YAML format
|
||||||
|
|
||||||
@@ -7,17 +7,17 @@ Export HelmRelease resources in YAML format
|
|||||||
The export helmrelease command exports one or all HelmRelease resources in YAML format.
|
The export helmrelease command exports one or all HelmRelease resources in YAML format.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk export helmrelease [name] [flags]
|
gotk export helmrelease [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Export all HelmRelease resources
|
# Export all HelmRelease resources
|
||||||
tk export helmrelease --all > kustomizations.yaml
|
gotk export helmrelease --all > kustomizations.yaml
|
||||||
|
|
||||||
# Export a HelmRelease
|
# Export a HelmRelease
|
||||||
tk export hr my-app > app-release.yaml
|
gotk export hr my-app > app-release.yaml
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -39,5 +39,5 @@ tk export helmrelease [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk export](tk_export.md) - Export resources in YAML format
|
* [gotk export](gotk_export.md) - Export resources in YAML format
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk export kustomization
|
## gotk export kustomization
|
||||||
|
|
||||||
Export Kustomization resources in YAML format
|
Export Kustomization resources in YAML format
|
||||||
|
|
||||||
@@ -7,17 +7,17 @@ Export Kustomization resources in YAML format
|
|||||||
The export kustomization command exports one or all Kustomization resources in YAML format.
|
The export kustomization command exports one or all Kustomization resources in YAML format.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk export kustomization [name] [flags]
|
gotk export kustomization [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Export all Kustomization resources
|
# Export all Kustomization resources
|
||||||
tk export kustomization --all > kustomizations.yaml
|
gotk export kustomization --all > kustomizations.yaml
|
||||||
|
|
||||||
# Export a Kustomization
|
# Export a Kustomization
|
||||||
tk export kustomization my-app > kustomization.yaml
|
gotk export kustomization my-app > kustomization.yaml
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -39,5 +39,5 @@ tk export kustomization [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk export](tk_export.md) - Export resources in YAML format
|
* [gotk export](gotk_export.md) - Export resources in YAML format
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk export source
|
## gotk export source
|
||||||
|
|
||||||
Export sources
|
Export sources
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ The export source sub-commands export sources in YAML format.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk export](tk_export.md) - Export resources in YAML format
|
* [gotk export](gotk_export.md) - Export resources in YAML format
|
||||||
* [tk export source git](tk_export_source_git.md) - Export GitRepository sources in YAML format
|
* [gotk export source git](gotk_export_source_git.md) - Export GitRepository sources in YAML format
|
||||||
* [tk export source helm](tk_export_source_helm.md) - Export HelmRepository sources in YAML format
|
* [gotk export source helm](gotk_export_source_helm.md) - Export HelmRepository sources in YAML format
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk export source git
|
## gotk export source git
|
||||||
|
|
||||||
Export GitRepository sources in YAML format
|
Export GitRepository sources in YAML format
|
||||||
|
|
||||||
@@ -7,17 +7,17 @@ Export GitRepository sources in YAML format
|
|||||||
The export source git command exports on or all GitRepository sources in YAML format.
|
The export source git command exports on or all GitRepository sources in YAML format.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk export source git [name] [flags]
|
gotk export source git [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Export all GitRepository sources
|
# Export all GitRepository sources
|
||||||
tk export source git --all > sources.yaml
|
gotk export source git --all > sources.yaml
|
||||||
|
|
||||||
# Export a GitRepository source including the SSH key pair or basic auth credentials
|
# Export a GitRepository source including the SSH key pair or basic auth credentials
|
||||||
tk export source git my-private-repo --with-credentials > source.yaml
|
gotk export source git my-private-repo --with-credentials > source.yaml
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,5 +40,5 @@ tk export source git [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk export source](tk_export_source.md) - Export sources
|
* [gotk export source](gotk_export_source.md) - Export sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk export source helm
|
## gotk export source helm
|
||||||
|
|
||||||
Export HelmRepository sources in YAML format
|
Export HelmRepository sources in YAML format
|
||||||
|
|
||||||
@@ -7,17 +7,17 @@ Export HelmRepository sources in YAML format
|
|||||||
The export source git command exports on or all HelmRepository sources in YAML format.
|
The export source git command exports on or all HelmRepository sources in YAML format.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk export source helm [name] [flags]
|
gotk export source helm [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Export all HelmRepository sources
|
# Export all HelmRepository sources
|
||||||
tk export source helm --all > sources.yaml
|
gotk export source helm --all > sources.yaml
|
||||||
|
|
||||||
# Export a HelmRepository source including the basic auth credentials
|
# Export a HelmRepository source including the basic auth credentials
|
||||||
tk export source helm my-private-repo --with-credentials > source.yaml
|
gotk export source helm my-private-repo --with-credentials > source.yaml
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,5 +40,5 @@ tk export source helm [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk export source](tk_export_source.md) - Export sources
|
* [gotk export source](gotk_export_source.md) - Export sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk get
|
## gotk get
|
||||||
|
|
||||||
Get sources and resources
|
Get sources and resources
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ The get sub-commands print the statuses of sources and resources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk get helmreleases](tk_get_helmreleases.md) - Get HelmRelease statuses
|
* [gotk get helmreleases](gotk_get_helmreleases.md) - Get HelmRelease statuses
|
||||||
* [tk get kustomizations](tk_get_kustomizations.md) - Get Kustomization statuses
|
* [gotk get kustomizations](gotk_get_kustomizations.md) - Get Kustomization statuses
|
||||||
* [tk get sources](tk_get_sources.md) - Get source statuses
|
* [gotk get sources](gotk_get_sources.md) - Get source statuses
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk get helmreleases
|
## gotk get helmreleases
|
||||||
|
|
||||||
Get HelmRelease statuses
|
Get HelmRelease statuses
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Get HelmRelease statuses
|
|||||||
The get helmreleases command prints the statuses of the resources.
|
The get helmreleases command prints the statuses of the resources.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk get helmreleases [flags]
|
gotk get helmreleases [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# List all Helm releases and their status
|
# List all Helm releases and their status
|
||||||
tk get helmreleases
|
gotk get helmreleases
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ tk get helmreleases [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk get](tk_get.md) - Get sources and resources
|
* [gotk get](gotk_get.md) - Get sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk get kustomizations
|
## gotk get kustomizations
|
||||||
|
|
||||||
Get Kustomization statuses
|
Get Kustomization statuses
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Get Kustomization statuses
|
|||||||
The get kustomizations command prints the statuses of the resources.
|
The get kustomizations command prints the statuses of the resources.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk get kustomizations [flags]
|
gotk get kustomizations [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# List all kustomizations and their status
|
# List all kustomizations and their status
|
||||||
tk get kustomizations
|
gotk get kustomizations
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ tk get kustomizations [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk get](tk_get.md) - Get sources and resources
|
* [gotk get](gotk_get.md) - Get sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk get sources
|
## gotk get sources
|
||||||
|
|
||||||
Get source statuses
|
Get source statuses
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ The get source sub-commands print the statuses of the sources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk get](tk_get.md) - Get sources and resources
|
* [gotk get](gotk_get.md) - Get sources and resources
|
||||||
* [tk get sources git](tk_get_sources_git.md) - Get GitRepository source statuses
|
* [gotk get sources git](gotk_get_sources_git.md) - Get GitRepository source statuses
|
||||||
* [tk get sources helm](tk_get_sources_helm.md) - Get HelmRepository source statuses
|
* [gotk get sources helm](gotk_get_sources_helm.md) - Get HelmRepository source statuses
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk get sources git
|
## gotk get sources git
|
||||||
|
|
||||||
Get GitRepository source statuses
|
Get GitRepository source statuses
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Get GitRepository source statuses
|
|||||||
The get sources git command prints the status of the GitRepository sources.
|
The get sources git command prints the status of the GitRepository sources.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk get sources git [flags]
|
gotk get sources git [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# List all Git repositories and their status
|
# List all Git repositories and their status
|
||||||
tk get sources git
|
gotk get sources git
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ tk get sources git [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk get sources](tk_get_sources.md) - Get source statuses
|
* [gotk get sources](gotk_get_sources.md) - Get source statuses
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk get sources helm
|
## gotk get sources helm
|
||||||
|
|
||||||
Get HelmRepository source statuses
|
Get HelmRepository source statuses
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Get HelmRepository source statuses
|
|||||||
The get sources helm command prints the status of the HelmRepository sources.
|
The get sources helm command prints the status of the HelmRepository sources.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk get sources helm [flags]
|
gotk get sources helm [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# List all Helm repositories and their status
|
# List all Helm repositories and their status
|
||||||
tk get sources helm
|
gotk get sources helm
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ tk get sources helm [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk get sources](tk_get_sources.md) - Get source statuses
|
* [gotk get sources](gotk_get_sources.md) - Get source statuses
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk install
|
## gotk install
|
||||||
|
|
||||||
Install the toolkit components
|
Install the toolkit components
|
||||||
|
|
||||||
@@ -8,36 +8,37 @@ The install command deploys the toolkit components in the specified namespace.
|
|||||||
If a previous version is installed, then an in-place upgrade will be performed.
|
If a previous version is installed, then an in-place upgrade will be performed.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk install [flags]
|
gotk install [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install the latest version in the gitops-systems namespace
|
# Install the latest version in the gitops-systems namespace
|
||||||
tk install --version=latest --namespace=gitops-systems
|
gotk install --version=latest --namespace=gitops-systems
|
||||||
|
|
||||||
# Dry-run install for a specific version and a series of components
|
# Dry-run install for a specific version and a series of components
|
||||||
tk install --dry-run --version=v0.0.7 --components="source-controller,kustomize-controller"
|
gotk install --dry-run --version=v0.0.7 --components="source-controller,kustomize-controller"
|
||||||
|
|
||||||
# Dry-run install with manifests preview
|
# Dry-run install with manifests preview
|
||||||
tk install --dry-run --verbose
|
gotk install --dry-run --verbose
|
||||||
|
|
||||||
# Write install manifests to file
|
# Write install manifests to file
|
||||||
tk install --export > gitops-system.yaml
|
gotk install --export > gitops-system.yaml
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--arch string arch can be amd64 or arm64 (default "amd64")
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
||||||
--dry-run only print the object that would be applied
|
--dry-run only print the object that would be applied
|
||||||
--export write the install manifests to stdout and exit
|
--export write the install manifests to stdout and exit
|
||||||
-h, --help help for install
|
-h, --help help for install
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
||||||
--manifests string path to the manifest directory, dev only
|
--manifests string path to the manifest directory, dev only
|
||||||
--registry string container registry where the toolkit images are published (default "docker.io/fluxcd")
|
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
||||||
-v, --version string toolkit version (default "latest")
|
-v, --version string toolkit version (default "latest")
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -52,5 +53,5 @@ tk install [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk reconcile
|
## gotk reconcile
|
||||||
|
|
||||||
Reconcile sources and resources
|
Reconcile sources and resources
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ The reconcile sub-commands trigger a reconciliation of sources and resources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk reconcile helmrelease](tk_reconcile_helmrelease.md) - Reconcile a HelmRelease resource
|
* [gotk reconcile helmrelease](gotk_reconcile_helmrelease.md) - Reconcile a HelmRelease resource
|
||||||
* [tk reconcile kustomization](tk_reconcile_kustomization.md) - Reconcile a Kustomization resource
|
* [gotk reconcile kustomization](gotk_reconcile_kustomization.md) - Reconcile a Kustomization resource
|
||||||
* [tk reconcile source](tk_reconcile_source.md) - Reconcile sources
|
* [gotk reconcile source](gotk_reconcile_source.md) - Reconcile sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk reconcile helmrelease
|
## gotk reconcile helmrelease
|
||||||
|
|
||||||
Reconcile a HelmRelease resource
|
Reconcile a HelmRelease resource
|
||||||
|
|
||||||
@@ -8,17 +8,17 @@ Reconcile a HelmRelease resource
|
|||||||
The reconcile kustomization command triggers a reconciliation of a HelmRelease resource and waits for it to finish.
|
The reconcile kustomization command triggers a reconciliation of a HelmRelease resource and waits for it to finish.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk reconcile helmrelease [name] [flags]
|
gotk reconcile helmrelease [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Trigger a HelmRelease apply outside of the reconciliation interval
|
# Trigger a HelmRelease apply outside of the reconciliation interval
|
||||||
tk reconcile hr podinfo
|
gotk reconcile hr podinfo
|
||||||
|
|
||||||
# Trigger a reconciliation of the HelmRelease's source and apply changes
|
# Trigger a reconciliation of the HelmRelease's source and apply changes
|
||||||
tk reconcile hr podinfo --with-source
|
gotk reconcile hr podinfo --with-source
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,5 +40,5 @@ tk reconcile helmrelease [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk reconcile](tk_reconcile.md) - Reconcile sources and resources
|
* [gotk reconcile](gotk_reconcile.md) - Reconcile sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk reconcile kustomization
|
## gotk reconcile kustomization
|
||||||
|
|
||||||
Reconcile a Kustomization resource
|
Reconcile a Kustomization resource
|
||||||
|
|
||||||
@@ -8,17 +8,17 @@ Reconcile a Kustomization resource
|
|||||||
The reconcile kustomization command triggers a reconciliation of a Kustomization resource and waits for it to finish.
|
The reconcile kustomization command triggers a reconciliation of a Kustomization resource and waits for it to finish.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk reconcile kustomization [name] [flags]
|
gotk reconcile kustomization [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Trigger a Kustomization apply outside of the reconciliation interval
|
# Trigger a Kustomization apply outside of the reconciliation interval
|
||||||
tk reconcile kustomization podinfo
|
gotk reconcile kustomization podinfo
|
||||||
|
|
||||||
# Trigger a sync of the Kustomization's source and apply changes
|
# Trigger a sync of the Kustomization's source and apply changes
|
||||||
tk reconcile kustomization podinfo --with-source
|
gotk reconcile kustomization podinfo --with-source
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,5 +40,5 @@ tk reconcile kustomization [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk reconcile](tk_reconcile.md) - Reconcile sources and resources
|
* [gotk reconcile](gotk_reconcile.md) - Reconcile sources and resources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk reconcile source
|
## gotk reconcile source
|
||||||
|
|
||||||
Reconcile sources
|
Reconcile sources
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ The reconcile source sub-commands trigger a reconciliation of sources.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk reconcile](tk_reconcile.md) - Reconcile sources and resources
|
* [gotk reconcile](gotk_reconcile.md) - Reconcile sources and resources
|
||||||
* [tk reconcile source git](tk_reconcile_source_git.md) - Reconcile a GitRepository source
|
* [gotk reconcile source git](gotk_reconcile_source_git.md) - Reconcile a GitRepository source
|
||||||
* [tk reconcile source helm](tk_reconcile_source_helm.md) - Reconcile a HelmRepository source
|
* [gotk reconcile source helm](gotk_reconcile_source_helm.md) - Reconcile a HelmRepository source
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk reconcile source git
|
## gotk reconcile source git
|
||||||
|
|
||||||
Reconcile a GitRepository source
|
Reconcile a GitRepository source
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Reconcile a GitRepository source
|
|||||||
The reconcile source command triggers a reconciliation of a GitRepository resource and waits for it to finish.
|
The reconcile source command triggers a reconciliation of a GitRepository resource and waits for it to finish.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk reconcile source git [name] [flags]
|
gotk reconcile source git [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Trigger a git pull for an existing source
|
# Trigger a git pull for an existing source
|
||||||
tk reconcile source git podinfo
|
gotk reconcile source git podinfo
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ tk reconcile source git [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk reconcile source](tk_reconcile_source.md) - Reconcile sources
|
* [gotk reconcile source](gotk_reconcile_source.md) - Reconcile sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk reconcile source helm
|
## gotk reconcile source helm
|
||||||
|
|
||||||
Reconcile a HelmRepository source
|
Reconcile a HelmRepository source
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ Reconcile a HelmRepository source
|
|||||||
The reconcile source command triggers a reconciliation of a HelmRepository resource and waits for it to finish.
|
The reconcile source command triggers a reconciliation of a HelmRepository resource and waits for it to finish.
|
||||||
|
|
||||||
```
|
```
|
||||||
tk reconcile source helm [name] [flags]
|
gotk reconcile source helm [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
# Trigger a reconciliation for an existing source
|
# Trigger a reconciliation for an existing source
|
||||||
tk reconcile source helm podinfo
|
gotk reconcile source helm podinfo
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ tk reconcile source helm [name] [flags]
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk reconcile source](tk_reconcile_source.md) - Reconcile sources
|
* [gotk reconcile source](gotk_reconcile_source.md) - Reconcile sources
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## tk resume
|
## gotk resume
|
||||||
|
|
||||||
Resume suspended resources
|
Resume suspended resources
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ The resume sub-commands resume a suspended resource.
|
|||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines
|
* [gotk](gotk.md) - Command line utility for assembling Kubernetes CD pipelines
|
||||||
* [tk resume helmrelease](tk_resume_helmrelease.md) - Resume a suspended HelmRelease
|
* [gotk resume helmrelease](gotk_resume_helmrelease.md) - Resume a suspended HelmRelease
|
||||||
* [tk resume kustomization](tk_resume_kustomization.md) - Resume a suspended Kustomization
|
* [gotk resume kustomization](gotk_resume_kustomization.md) - Resume a suspended Kustomization
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user