Compare commits
170 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9efc4986f9 | ||
|
|
fdc366ec1c | ||
|
|
d455db444c | ||
|
|
17418c9858 | ||
|
|
5da7eb7d0d | ||
|
|
9da977ee7a | ||
|
|
8e4b2ead9b | ||
|
|
fd364828a1 | ||
|
|
afa58d8c08 | ||
|
|
179062876e | ||
|
|
a796f3609f | ||
|
|
b7c6db74d2 | ||
|
|
4f7b040405 | ||
|
|
34ca29830e | ||
|
|
78f1b634fa | ||
|
|
044bc64ad9 | ||
|
|
091f439498 | ||
|
|
a17b0a1ce0 | ||
|
|
354cd5e177 | ||
|
|
4e8f1221f7 | ||
|
|
6b179aa7d9 | ||
|
|
f748114dfa | ||
|
|
5de83f015a | ||
|
|
a6620e478a | ||
|
|
c7fcffdd8e | ||
|
|
160f59a984 | ||
|
|
d38d487c2a | ||
|
|
db28907543 | ||
|
|
c4261399b5 | ||
|
|
b4edb46269 | ||
|
|
a20ed0e630 | ||
|
|
cea869e285 | ||
|
|
e12db14d1e | ||
|
|
296bf3cc6c | ||
|
|
1789aa180d | ||
|
|
bd255800db | ||
|
|
1355962b3c | ||
|
|
bb0114e379 | ||
|
|
f9622a5b9e | ||
|
|
3a74fcd75c | ||
|
|
7265276cc2 | ||
|
|
b98027b528 | ||
|
|
b6ae7d2cdd | ||
|
|
aa887c61c3 | ||
|
|
700cef0989 | ||
|
|
3ed3e553e7 | ||
|
|
d68158ddc9 | ||
|
|
9f83a69242 | ||
|
|
bf69dbd43d | ||
|
|
465ea5ccfd | ||
|
|
92ef39e2ad | ||
|
|
0404790df9 | ||
|
|
f880e93df4 | ||
|
|
4697b1101d | ||
|
|
50ff2accd2 | ||
|
|
c7d876eb8f | ||
|
|
eda392dfcd | ||
|
|
3b91e14f6d | ||
|
|
17e3c57d7e | ||
|
|
1c744a0f97 | ||
|
|
99bdb20aeb | ||
|
|
fbe7050cb8 | ||
|
|
12ea028aa9 | ||
|
|
ea62cb5fc9 | ||
|
|
d27c2164b2 | ||
|
|
ef8f5cb87d | ||
|
|
378a2c2a0e | ||
|
|
2597ad0f73 | ||
|
|
0df34bed59 | ||
|
|
be65cf8052 | ||
|
|
8922753591 | ||
|
|
87e11ed653 | ||
|
|
ab34771b3d | ||
|
|
e733c4f55a | ||
|
|
37b60666c4 | ||
|
|
734d736bdf | ||
|
|
8ca65059f7 | ||
|
|
086f174463 | ||
|
|
48fd70fc09 | ||
|
|
606266e976 | ||
|
|
f7006a8172 | ||
|
|
653dcc8d78 | ||
|
|
8df140c713 | ||
|
|
089af9cc90 | ||
|
|
695fb55b13 | ||
|
|
ec21eedd56 | ||
|
|
5ba3774fd5 | ||
|
|
12a2100fcf | ||
|
|
68074d3543 | ||
|
|
18849e36c7 | ||
|
|
671fe274da | ||
|
|
af1d9102b9 | ||
|
|
9dc10ef7d1 | ||
|
|
86a3cf20e7 | ||
|
|
27a42ecd8e | ||
|
|
ae7a59fbb4 | ||
|
|
598dfc32e8 | ||
|
|
a40d124e23 | ||
|
|
9df3fcab18 | ||
|
|
b6ce969d1b | ||
|
|
6a37649ee6 | ||
|
|
8926095660 | ||
|
|
bd34870334 | ||
|
|
a56ce1f867 | ||
|
|
dab5bbd393 | ||
|
|
15ebfd7eb6 | ||
|
|
5ab8dd2557 | ||
|
|
9164914d16 | ||
|
|
c9e0bc0807 | ||
|
|
61439adf9b | ||
|
|
e4d7450643 | ||
|
|
0fbcfded57 | ||
|
|
fb3a434f95 | ||
|
|
4f66da84d6 | ||
|
|
b67e8aafab | ||
|
|
0b4f1d30a6 | ||
|
|
c494e6bf7e | ||
|
|
b8c57c7901 | ||
|
|
6aed4631e7 | ||
|
|
5df9118365 | ||
|
|
4a4af94d6c | ||
|
|
baa54fb84a | ||
|
|
cb6470f817 | ||
|
|
1a904e138f | ||
|
|
3b482529ff | ||
|
|
67997437db | ||
|
|
a5541eddca | ||
|
|
203157e525 | ||
|
|
655c2261ba | ||
|
|
45e446eb00 | ||
|
|
68abe37648 | ||
|
|
df6a0a3762 | ||
|
|
c35bae577f | ||
|
|
3567941eda | ||
|
|
3c95fe6380 | ||
|
|
d07f0d003c | ||
|
|
86774309db | ||
|
|
427f23e32d | ||
|
|
70cddde16c | ||
|
|
e86789b643 | ||
|
|
f52fec66bd | ||
|
|
f4926d1e45 | ||
|
|
2774c1a5cd | ||
|
|
8274bc0ea3 | ||
|
|
e9531e4d57 | ||
|
|
3a8aad7e5c | ||
|
|
ef079c5b58 | ||
|
|
50332aa2ee | ||
|
|
b47f3a57dc | ||
|
|
9a928744cc | ||
|
|
328d403507 | ||
|
|
76ffd76bd3 | ||
|
|
951589e652 | ||
|
|
7bb0704401 | ||
|
|
3aa45e72e7 | ||
|
|
67691e92e3 | ||
|
|
43388ec67b | ||
|
|
2fe3934491 | ||
|
|
f60ba95b4c | ||
|
|
4ecf541748 | ||
|
|
7994829765 | ||
|
|
ce14951436 | ||
|
|
a5ce8221a3 | ||
|
|
e6344ef18e | ||
|
|
99e60634ad | ||
|
|
6c656b7366 | ||
|
|
fc3a09b5ad | ||
|
|
b1484f2f24 | ||
|
|
7dcf884e38 | ||
|
|
b6d349da8c |
42
.github/runners/README.md
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Flux GitHub runners
|
||||||
|
|
||||||
|
How to provision GitHub Actions self-hosted runners for Flux conformance testing.
|
||||||
|
|
||||||
|
## ARM64 Instance specs
|
||||||
|
|
||||||
|
In order to add a new runner to the GitHub Actions pool,
|
||||||
|
first create an instance on Oracle Cloud with the following configuration:
|
||||||
|
- OS: Canonical Ubuntu 20.04
|
||||||
|
- Shape: VM.Standard.A1.Flex
|
||||||
|
- OCPU Count: 2
|
||||||
|
- Memory (GB): 12
|
||||||
|
- Network Bandwidth (Gbps): 2
|
||||||
|
- Local Disk: Block Storage Only
|
||||||
|
|
||||||
|
Note that the instance image source must be **Canonical Ubuntu** instead of the default Oracle Linux.
|
||||||
|
|
||||||
|
## ARM64 Instance setup
|
||||||
|
|
||||||
|
- SSH into a newly created instance
|
||||||
|
```shell
|
||||||
|
ssh ubuntu@<instance-public-IP>
|
||||||
|
```
|
||||||
|
- Create the action runner dir
|
||||||
|
```shell
|
||||||
|
mkdir -p actions-runner && cd actions-runner
|
||||||
|
```
|
||||||
|
- Download the provisioning script
|
||||||
|
```shell
|
||||||
|
curl -sL https://raw.githubusercontent.com/fluxcd/flux2/main/.github/runners/arm64.sh > arm64.sh \
|
||||||
|
&& chmod +x ./arm64.sh
|
||||||
|
```
|
||||||
|
- Retrieve the GitHub runner token from the repository [settings page](https://github.com/fluxcd/flux2/settings/actions/runners/new?arch=arm64&os=linux)
|
||||||
|
- Run the provisioning script passing the token as the first argument
|
||||||
|
```shell
|
||||||
|
sudo ./arm64.sh <TOKEN>
|
||||||
|
```
|
||||||
|
- Reboot the instance
|
||||||
|
```shell
|
||||||
|
sudo reboot
|
||||||
|
```
|
||||||
|
- Navigate to the GitHub repository [runners page](https://github.com/fluxcd/flux2/settings/actions/runners) and check the runner status
|
||||||
73
.github/runners/arm64.sh
vendored
Executable file
@@ -0,0 +1,73 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright 2021 The Flux authors. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# This script is meant to be run locally and in CI to validate the Kubernetes
|
||||||
|
# manifests (including Flux custom resources) before changes are merged into
|
||||||
|
# the branch synced by Flux in-cluster.
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
REPOSITORY_TOKEN=$1
|
||||||
|
REPOSITORY_URL=${2:-https://github.com/fluxcd/flux2}
|
||||||
|
|
||||||
|
KIND_VERSION=0.11.1
|
||||||
|
KUBECTL_VERSION=1.21.2
|
||||||
|
KUSTOMIZE_VERSION=4.1.3
|
||||||
|
GITHUB_RUNNER_VERSION=2.278.0
|
||||||
|
PACKAGES="apt-transport-https ca-certificates software-properties-common build-essential libssl-dev gnupg lsb-release jq"
|
||||||
|
|
||||||
|
# install prerequisites
|
||||||
|
apt-get update \
|
||||||
|
&& apt-get install -y -q ${PACKAGES} \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# install docker
|
||||||
|
curl -fsSL https://get.docker.com -o get-docker.sh \
|
||||||
|
&& chmod +x get-docker.sh
|
||||||
|
./get-docker.sh
|
||||||
|
systemctl enable docker.service
|
||||||
|
systemctl enable containerd.service
|
||||||
|
usermod -aG docker ubuntu
|
||||||
|
|
||||||
|
# install kind
|
||||||
|
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-arm64
|
||||||
|
install -o root -g root -m 0755 kind /usr/local/bin/kind
|
||||||
|
|
||||||
|
# install kubectl
|
||||||
|
curl -LO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl"
|
||||||
|
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
||||||
|
|
||||||
|
# install kustomize
|
||||||
|
curl -Lo ./kustomize.tar.gz https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_arm64.tar.gz \
|
||||||
|
&& tar -zxvf kustomize.tar.gz \
|
||||||
|
&& rm kustomize.tar.gz
|
||||||
|
install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize
|
||||||
|
|
||||||
|
# download runner
|
||||||
|
curl -o actions-runner-linux-arm64.tar.gz -L https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/actions-runner-linux-arm64-${GITHUB_RUNNER_VERSION}.tar.gz \
|
||||||
|
&& tar xzf actions-runner-linux-arm64.tar.gz \
|
||||||
|
&& rm actions-runner-linux-arm64.tar.gz
|
||||||
|
|
||||||
|
# install runner dependencies
|
||||||
|
./bin/installdependencies.sh
|
||||||
|
|
||||||
|
# register runner with GitHub
|
||||||
|
sudo -u ubuntu ./config.sh --unattended --url ${REPOSITORY_URL} --token ${REPOSITORY_TOKEN}
|
||||||
|
|
||||||
|
# start runner
|
||||||
|
./svc.sh install
|
||||||
|
./svc.sh start
|
||||||
7
.github/workflows/bootstrap.yaml
vendored
@@ -61,6 +61,13 @@ jobs:
|
|||||||
--team=team-z
|
--team=team-z
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||||
|
- name: libgit2
|
||||||
|
run: |
|
||||||
|
/tmp/flux create source git test-libgit2 \
|
||||||
|
--url=ssh://git@github.com/fluxcd-testing/${{ steps.vars.outputs.test_repo_name }} \
|
||||||
|
--git-implementation=libgit2 \
|
||||||
|
--secret-ref=flux-system \
|
||||||
|
--branch=main
|
||||||
- name: uninstall
|
- name: uninstall
|
||||||
run: |
|
run: |
|
||||||
/tmp/flux uninstall -s --keep-namespace
|
/tmp/flux uninstall -s --keep-namespace
|
||||||
|
|||||||
76
.github/workflows/docs.yaml
vendored
@@ -1,76 +0,0 @@
|
|||||||
name: Publish docs via GitHub Pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ 'docs*', main ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Deploy docs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout master
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Copy assets
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
controller_version() {
|
|
||||||
sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# source-controller CRDs
|
|
||||||
SOURCE_VER=$(controller_version source-controller)
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/gitrepositories.md" > docs/components/source/gitrepositories.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmrepositories.md" > docs/components/source/helmrepositories.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmcharts.md" > docs/components/source/helmcharts.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/buckets.md" > docs/components/source/buckets.md
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# kustomize-controller CRDs
|
|
||||||
KUSTOMIZE_VER=$(controller_version kustomize-controller)
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/api/kustomize.md" > docs/components/kustomize/api.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/spec/v1beta1/kustomization.md" > docs/components/kustomize/kustomization.md
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# helm-controller CRDs
|
|
||||||
HELM_VER=$(controller_version helm-controller)
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/api/helmrelease.md" > docs/components/helm/api.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/spec/v2beta1/helmreleases.md" > docs/components/helm/helmreleases.md
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# notification-controller CRDs
|
|
||||||
NOTIFICATION_VER=$(controller_version notification-controller)
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/api/notification.md" > docs/components/notification/api.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/event.md" > docs/components/notification/event.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/alert.md" > docs/components/notification/alert.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/provider.md" > docs/components/notification/provider.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/receiver.md" > docs/components/notification/receiver.md
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# image-*-controller CRDs; these use the same API group
|
|
||||||
IMG_REFL_VER=$(controller_version image-reflector-controller)
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-reflector-controller/$IMG_REFL_VER/docs/api/image-reflector.md" > docs/components/image/reflector-api.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-reflector-controller/$IMG_REFL_VER/docs/spec/v1alpha1/imagerepositories.md" > docs/components/image/imagerepositories.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-reflector-controller/$IMG_REFL_VER/docs/spec/v1alpha1/imagepolicies.md" > docs/components/image/imagepolicies.md
|
|
||||||
|
|
||||||
IMG_AUTO_VER=$(controller_version image-automation-controller)
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-automation-controller/$IMG_AUTO_VER/docs/api/image-automation.md" > docs/components/image/automation-api.md
|
|
||||||
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-automation-controller/$IMG_AUTO_VER/docs/spec/v1alpha1/imageupdateautomations.md" > docs/components/image/imageupdateautomations.md
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
# install script
|
|
||||||
cp install/flux.sh docs/install.sh
|
|
||||||
}
|
|
||||||
- name: Deploy docs
|
|
||||||
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CUSTOM_DOMAIN: toolkit.fluxcd.io
|
|
||||||
107
.github/workflows/e2e-arm64.yaml
vendored
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
name: e2e-arm64
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches: [ main, update-components ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ampere:
|
||||||
|
# Runner info
|
||||||
|
# Owner: Stefan Prodan
|
||||||
|
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
|
||||||
|
runs-on: [self-hosted, Linux, ARM64]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16.x
|
||||||
|
- name: Prepare
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
|
||||||
|
echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
|
||||||
|
- name: Run unit tests
|
||||||
|
run: make test
|
||||||
|
- name: Check if working tree is dirty
|
||||||
|
run: |
|
||||||
|
if [[ $(git diff --stat) != '' ]]; then
|
||||||
|
git diff
|
||||||
|
echo 'run make test and commit changes'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
go build -o /tmp/flux ./cmd/flux
|
||||||
|
- name: Setup Kubernetes Kind
|
||||||
|
run: |
|
||||||
|
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }}
|
||||||
|
- name: flux check --pre
|
||||||
|
run: |
|
||||||
|
/tmp/flux check --pre \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux install
|
||||||
|
run: |
|
||||||
|
/tmp/flux install \
|
||||||
|
--components-extra=image-reflector-controller,image-automation-controller \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux create source git
|
||||||
|
run: |
|
||||||
|
/tmp/flux create source git podinfo-gogit \
|
||||||
|
--git-implementation=go-git \
|
||||||
|
--url https://github.com/stefanprodan/podinfo \
|
||||||
|
--tag-semver=">1.0.0" \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
/tmp/flux create source git podinfo-libgit2 \
|
||||||
|
--git-implementation=libgit2 \
|
||||||
|
--url https://github.com/stefanprodan/podinfo \
|
||||||
|
--branch="master" \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux create kustomization
|
||||||
|
run: |
|
||||||
|
/tmp/flux create kustomization podinfo \
|
||||||
|
--source=podinfo-gogit \
|
||||||
|
--path="./deploy/overlays/dev" \
|
||||||
|
--prune=true \
|
||||||
|
--interval=5m \
|
||||||
|
--validation=client \
|
||||||
|
--health-check="Deployment/frontend.dev" \
|
||||||
|
--health-check="Deployment/backend.dev" \
|
||||||
|
--health-check-timeout=3m \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux create tenant
|
||||||
|
run: |
|
||||||
|
/tmp/flux create tenant dev-team \
|
||||||
|
--with-namespace=apps \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux create helmrelease
|
||||||
|
run: |
|
||||||
|
/tmp/flux -n apps create source helm podinfo \
|
||||||
|
--url https://stefanprodan.github.io/podinfo \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
|
||||||
|
/tmp/flux -n apps create hr podinfo-helm \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
--chart-version="6.0.x" \
|
||||||
|
--service-account=dev-team \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux get all
|
||||||
|
run: |
|
||||||
|
/tmp/flux get all --all-namespaces \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: flux uninstall
|
||||||
|
run: |
|
||||||
|
/tmp/flux uninstall -s \
|
||||||
|
--context ${{ steps.prep.outputs.CONTEXT }}
|
||||||
|
- name: Debug failure
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
kubectl --context ${{ steps.prep.outputs.CONTEXT }} -n flux-system get all
|
||||||
|
/tmp/flux logs --all-namespaces
|
||||||
|
- name: Cleanup
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
|
||||||
2
.github/workflows/e2e.yaml
vendored
@@ -193,7 +193,7 @@ jobs:
|
|||||||
/tmp/flux create kustomization flux-system \
|
/tmp/flux create kustomization flux-system \
|
||||||
--source=flux-system \
|
--source=flux-system \
|
||||||
--path=./clusters/staging
|
--path=./clusters/staging
|
||||||
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=2m
|
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m
|
||||||
- name: flux check
|
- name: flux check
|
||||||
run: |
|
run: |
|
||||||
/tmp/flux check
|
/tmp/flux check
|
||||||
|
|||||||
65
.github/workflows/update.yaml
vendored
@@ -23,20 +23,32 @@ jobs:
|
|||||||
PR_BODY=""
|
PR_BODY=""
|
||||||
|
|
||||||
bump_version() {
|
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 LATEST_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\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml)
|
local CTRL_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml)
|
||||||
|
local CRD_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p" manifests/crds/kustomization.yaml)
|
||||||
|
local MOD_VERSION=$(go list -m -f '{{ .Version }}' "github.com/fluxcd/$1/api")
|
||||||
|
|
||||||
if [[ "${RELEASE_VERSION}" != "${CURRENT_VERSION}" ]]; then
|
local changed=false
|
||||||
# bump kustomize
|
|
||||||
sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${RELEASE_VERSION}\2/g" "manifests/bases/$1/kustomization.yaml"
|
|
||||||
|
|
||||||
if [[ ! -z $(grep "github.com/fluxcd/$1/api" go.mod | awk '{print $2}') ]]; then
|
if [[ "${CTRL_VERSION}" != "${LATEST_VERSION}" ]]; then
|
||||||
# bump go mod
|
sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${LATEST_VERSION}\2/g" "manifests/bases/$1/kustomization.yaml"
|
||||||
go mod edit -require="github.com/fluxcd/$1/api@${RELEASE_VERSION}"
|
changed=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NB: special URL encoded formatting required for newlines
|
if [[ "${CRD_VERSION}" != "${LATEST_VERSION}" ]]; then
|
||||||
PR_BODY="$PR_BODY- $1 to ${RELEASE_VERSION}%0A https://github.com/fluxcd/$1/blob/${RELEASE_VERSION}/CHANGELOG.md%0A"
|
sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${LATEST_VERSION}\2/g" "manifests/crds/kustomization.yaml"
|
||||||
|
changed=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${MOD_VERSION}" != "${LATEST_VERSION}" ]]; then
|
||||||
|
go mod edit -require="github.com/fluxcd/$1/api@${LATEST_VERSION}"
|
||||||
|
rm go.sum
|
||||||
|
go mod tidy
|
||||||
|
changed=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$changed" == true ]]; then
|
||||||
|
PR_BODY="$PR_BODY- $1 to ${LATEST_VERSION}%0A https://github.com/fluxcd/$1/blob/${LATEST_VERSION}/CHANGELOG.md%0A"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,9 +61,6 @@ jobs:
|
|||||||
bump_version image-reflector-controller
|
bump_version image-reflector-controller
|
||||||
bump_version image-automation-controller
|
bump_version image-automation-controller
|
||||||
|
|
||||||
# add missing and remove unused modules
|
|
||||||
go mod tidy
|
|
||||||
|
|
||||||
# diff change
|
# diff change
|
||||||
git diff
|
git diff
|
||||||
|
|
||||||
@@ -63,21 +72,21 @@ jobs:
|
|||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v3
|
uses: peter-evans/create-pull-request@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
commit-message: |
|
commit-message: |
|
||||||
Update toolkit components
|
Update toolkit components
|
||||||
|
|
||||||
${{ steps.update.outputs.pr_body }}
|
${{ steps.update.outputs.pr_body }}
|
||||||
committer: GitHub <noreply@github.com>
|
committer: GitHub <noreply@github.com>
|
||||||
author: fluxcdbot <fluxcdbot@users.noreply.github.com>
|
author: fluxcdbot <fluxcdbot@users.noreply.github.com>
|
||||||
signoff: true
|
signoff: true
|
||||||
branch: update-components
|
branch: update-components
|
||||||
title: Update toolkit components
|
title: Update toolkit components
|
||||||
body: |
|
body: |
|
||||||
${{ steps.update.outputs.pr_body }}
|
${{ steps.update.outputs.pr_body }}
|
||||||
labels: |
|
labels: |
|
||||||
area/build
|
area/build
|
||||||
reviewers: ${{ secrets.ASSIGNEES }}
|
reviewers: ${{ secrets.ASSIGNEES }}
|
||||||
|
|
||||||
- name: Check output
|
- name: Check output
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
3
.gitignore
vendored
@@ -19,3 +19,6 @@ dist/
|
|||||||
bin/
|
bin/
|
||||||
output/
|
output/
|
||||||
cmd/flux/manifests/
|
cmd/flux/manifests/
|
||||||
|
|
||||||
|
# Docs
|
||||||
|
site/
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ brews:
|
|||||||
name: homebrew-tap
|
name: homebrew-tap
|
||||||
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
||||||
folder: Formula
|
folder: Formula
|
||||||
homepage: "https://toolkit.fluxcd.io/"
|
homepage: "https://fluxcd.io/"
|
||||||
description: "Flux CLI"
|
description: "Flux CLI"
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: kubectl
|
- name: kubectl
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ This project is composed of:
|
|||||||
### Understanding the code
|
### Understanding the code
|
||||||
|
|
||||||
To get started with developing controllers, you might want to review
|
To get started with developing controllers, you might want to review
|
||||||
[our guide](https://toolkit.fluxcd.io/dev-guides/source-watcher/) which
|
[our guide](https://fluxcd.io/docs/gitops-toolkit/source-watcher/) which
|
||||||
walks you through writing a short and concise controller that watches out
|
walks you through writing a short and concise controller that watches out
|
||||||
for source changes.
|
for source changes.
|
||||||
|
|
||||||
|
|||||||
7
Makefile
@@ -14,7 +14,7 @@ fmt:
|
|||||||
vet:
|
vet:
|
||||||
go vet ./...
|
go vet ./...
|
||||||
|
|
||||||
test: $(EMBEDDED_MANIFESTS_TARGET) tidy fmt vet docs
|
test: $(EMBEDDED_MANIFESTS_TARGET) tidy fmt vet
|
||||||
go test ./... -coverprofile cover.out
|
go test ./... -coverprofile cover.out
|
||||||
|
|
||||||
$(EMBEDDED_MANIFESTS_TARGET): $(call rwildcard,manifests/,*.yaml *.json)
|
$(EMBEDDED_MANIFESTS_TARGET): $(call rwildcard,manifests/,*.yaml *.json)
|
||||||
@@ -26,10 +26,5 @@ build: $(EMBEDDED_MANIFESTS_TARGET)
|
|||||||
install:
|
install:
|
||||||
go install cmd/flux
|
go install cmd/flux
|
||||||
|
|
||||||
.PHONY: docs
|
|
||||||
docs:
|
|
||||||
rm -rf docs/cmd/*
|
|
||||||
mkdir -p ./docs/cmd && go run ./cmd/flux/ docgen
|
|
||||||
|
|
||||||
install-dev:
|
install-dev:
|
||||||
CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/flux
|
CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/flux
|
||||||
|
|||||||
66
README.md
@@ -22,16 +22,22 @@ Delivery on top of Kubernetes.
|
|||||||
|
|
||||||
## Flux installation
|
## Flux installation
|
||||||
|
|
||||||
With Homebrew:
|
With [Homebrew](https://brew.sh) for macOS and Linux:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
brew install fluxcd/tap/flux
|
brew install fluxcd/tap/flux
|
||||||
```
|
```
|
||||||
|
|
||||||
With Bash:
|
With [GoFish](https://gofi.sh) for Windows, macOS and Linux:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -s https://toolkit.fluxcd.io/install.sh | sudo bash
|
gofish install flux
|
||||||
|
```
|
||||||
|
|
||||||
|
With Bash for macOS and Linux:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -s https://fluxcd.io/install.sh | sudo bash
|
||||||
|
|
||||||
# enable completions in ~/.bash_profile
|
# enable completions in ~/.bash_profile
|
||||||
. <(flux completion bash)
|
. <(flux completion bash)
|
||||||
@@ -46,10 +52,10 @@ Arch Linux (AUR) packages:
|
|||||||
- [flux-scm](https://aur.archlinux.org/packages/flux-scm): build the latest
|
- [flux-scm](https://aur.archlinux.org/packages/flux-scm): build the latest
|
||||||
(unstable) version from source code from our git `main` branch
|
(unstable) version from source code from our git `main` branch
|
||||||
|
|
||||||
Binaries for macOS, Windows and Linux AMD64/ARM are available to download on the
|
Binaries for macOS AMD64/ARM64, Linux AMD64/ARM/ARM64 and Windows are available to
|
||||||
[release page](https://github.com/fluxcd/flux2/releases).
|
download on the [release page](https://github.com/fluxcd/flux2/releases).
|
||||||
|
|
||||||
A container image with `kubectl` and `flux` is available on Docker Hub and GitHub:
|
A multi-arch container image with `kubectl` and `flux` is available on Docker Hub and GitHub:
|
||||||
|
|
||||||
* `docker.io/fluxcd/flux-cli:<version>`
|
* `docker.io/fluxcd/flux-cli:<version>`
|
||||||
* `ghcr.io/fluxcd/flux-cli:<version>`
|
* `ghcr.io/fluxcd/flux-cli:<version>`
|
||||||
@@ -63,13 +69,13 @@ flux check --pre
|
|||||||
## Get started
|
## Get started
|
||||||
|
|
||||||
To get started with Flux, start [browsing the
|
To get started with Flux, start [browsing the
|
||||||
documentation](https://toolkit.fluxcd.io) or get started with one of
|
documentation](https://fluxcd.io/docs/) or get started with one of
|
||||||
the following guides:
|
the following guides:
|
||||||
|
|
||||||
- [Get started with Flux](https://toolkit.fluxcd.io/get-started/)
|
- [Get started with Flux](https://fluxcd.io/docs/get-started/)
|
||||||
- [Manage Helm Releases](https://toolkit.fluxcd.io/guides/helmreleases/)
|
- [Manage Helm Releases](https://fluxcd.io/docs/guides/helmreleases/)
|
||||||
- [Automate image updates to Git](https://toolkit.fluxcd.io/guides/image-update/)
|
- [Automate image updates to Git](https://fluxcd.io/docs/guides/image-update/)
|
||||||
- [Manage Kubernetes secrets with Mozilla SOPS](https://toolkit.fluxcd.io/guides/mozilla-sops/)
|
- [Manage Kubernetes secrets with Mozilla SOPS](https://fluxcd.io/docs/guides/mozilla-sops/)
|
||||||
|
|
||||||
If you need help, please refer to our **[Support page](https://fluxcd.io/support/)**.
|
If you need help, please refer to our **[Support page](https://fluxcd.io/support/)**.
|
||||||
|
|
||||||
@@ -84,27 +90,27 @@ automation tooling.
|
|||||||
|
|
||||||
You can use the toolkit to extend Flux, or to build your own systems
|
You can use the toolkit to extend Flux, or to build your own systems
|
||||||
for continuous delivery -- see [the developer
|
for continuous delivery -- see [the developer
|
||||||
guides](https://toolkit.fluxcd.io/dev-guides/source-watcher/).
|
guides](https://fluxcd.io/docs/gitops-toolkit/source-watcher/).
|
||||||
|
|
||||||
### Components
|
### Components
|
||||||
|
|
||||||
- [Source Controller](https://toolkit.fluxcd.io/components/source/controller/)
|
- [Source Controller](https://fluxcd.io/docs/components/source/)
|
||||||
- [GitRepository CRD](https://toolkit.fluxcd.io/components/source/gitrepositories/)
|
- [GitRepository CRD](https://fluxcd.io/docs/components/source/gitrepositories/)
|
||||||
- [HelmRepository CRD](https://toolkit.fluxcd.io/components/source/helmrepositories/)
|
- [HelmRepository CRD](https://fluxcd.io/docs/components/source/helmrepositories/)
|
||||||
- [HelmChart CRD](https://toolkit.fluxcd.io/components/source/helmcharts/)
|
- [HelmChart CRD](https://fluxcd.io/docs/components/source/helmcharts/)
|
||||||
- [Bucket CRD](https://toolkit.fluxcd.io/components/source/buckets/)
|
- [Bucket CRD](https://fluxcd.io/docs/components/source/buckets/)
|
||||||
- [Kustomize Controller](https://toolkit.fluxcd.io/components/kustomize/controller/)
|
- [Kustomize Controller](https://fluxcd.io/docs/components/kustomize/)
|
||||||
- [Kustomization CRD](https://toolkit.fluxcd.io/components/kustomize/kustomization/)
|
- [Kustomization CRD](https://fluxcd.io/docs/components/kustomize/kustomization/)
|
||||||
- [Helm Controller](https://toolkit.fluxcd.io/components/helm/controller/)
|
- [Helm Controller](https://fluxcd.io/docs/components/helm/)
|
||||||
- [HelmRelease CRD](https://toolkit.fluxcd.io/components/helm/helmreleases/)
|
- [HelmRelease CRD](https://fluxcd.io/docs/components/helm/helmreleases/)
|
||||||
- [Notification Controller](https://toolkit.fluxcd.io/components/notification/controller/)
|
- [Notification Controller](https://fluxcd.io/docs/components/notification/)
|
||||||
- [Provider CRD](https://toolkit.fluxcd.io/components/notification/provider/)
|
- [Provider CRD](https://fluxcd.io/docs/components/notification/provider/)
|
||||||
- [Alert CRD](https://toolkit.fluxcd.io/components/notification/alert/)
|
- [Alert CRD](https://fluxcd.io/docs/components/notification/alert/)
|
||||||
- [Receiver CRD](https://toolkit.fluxcd.io/components/notification/receiver/)
|
- [Receiver CRD](https://fluxcd.io/docs/components/notification/receiver/)
|
||||||
- [Image Automation Controllers](https://toolkit.fluxcd.io/components/image/controller/)
|
- [Image Automation Controllers](https://fluxcd.io/docs/components/image/)
|
||||||
- [ImageRepository CRD](https://toolkit.fluxcd.io/components/image/imagerepositories/)
|
- [ImageRepository CRD](https://fluxcd.io/docs/components/image/imagerepositories/)
|
||||||
- [ImagePolicy CRD](https://toolkit.fluxcd.io/components/image/imagepolicies/)
|
- [ImagePolicy CRD](https://fluxcd.io/docs/components/image/imagepolicies/)
|
||||||
- [ImageUpdateAutomation CRD](https://toolkit.fluxcd.io/components/image/imageupdateautomations/)
|
- [ImageUpdateAutomation CRD](https://fluxcd.io/docs/components/image/imageupdateautomations/)
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
@@ -112,7 +118,7 @@ Need help or want to contribute? Please see the links below. The Flux project is
|
|||||||
new contributors and there are a multitude of ways to get involved.
|
new contributors and there are a multitude of ways to get involved.
|
||||||
|
|
||||||
- Getting Started?
|
- Getting Started?
|
||||||
- Look at our [Get Started guide](https://toolkit.fluxcd.io/get-started/) and give us feedback
|
- Look at our [Get Started guide](https://fluxcd.io/docs/get-started/) and give us feedback
|
||||||
- Need help?
|
- Need help?
|
||||||
- First: Ask questions on our [GH Discussions page](https://github.com/fluxcd/flux2/discussions)
|
- First: Ask questions on our [GH Discussions page](https://github.com/fluxcd/flux2/discussions)
|
||||||
- Second: Talk to us in the #flux channel on [CNCF Slack](https://slack.cncf.io/)
|
- Second: Talk to us in the #flux channel on [CNCF Slack](https://slack.cncf.io/)
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ command will perform an upgrade if needed.`,
|
|||||||
|
|
||||||
# Run bootstrap for a Git repository with a passwordless private key
|
# Run bootstrap for a Git repository with a passwordless private key
|
||||||
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key>
|
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key>
|
||||||
|
|
||||||
|
# Run bootstrap for a Git repository with a private key and password
|
||||||
|
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key> --password=<password>
|
||||||
`,
|
`,
|
||||||
RunE: bootstrapGitCmdRun,
|
RunE: bootstrapGitCmdRun,
|
||||||
}
|
}
|
||||||
@@ -66,6 +69,7 @@ type gitFlags struct {
|
|||||||
path flags.SafeRelativePath
|
path flags.SafeRelativePath
|
||||||
username string
|
username string
|
||||||
password string
|
password string
|
||||||
|
silent bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var gitArgs gitFlags
|
var gitArgs gitFlags
|
||||||
@@ -76,6 +80,7 @@ func init() {
|
|||||||
bootstrapGitCmd.Flags().Var(&gitArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
|
bootstrapGitCmd.Flags().Var(&gitArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
|
||||||
bootstrapGitCmd.Flags().StringVarP(&gitArgs.username, "username", "u", "git", "basic authentication username")
|
bootstrapGitCmd.Flags().StringVarP(&gitArgs.username, "username", "u", "git", "basic authentication username")
|
||||||
bootstrapGitCmd.Flags().StringVarP(&gitArgs.password, "password", "p", "", "basic authentication password")
|
bootstrapGitCmd.Flags().StringVarP(&gitArgs.password, "password", "p", "", "basic authentication password")
|
||||||
|
bootstrapGitCmd.Flags().BoolVarP(&gitArgs.silent, "silent", "s", false, "assumes the deploy key is already setup, skips confirmation")
|
||||||
|
|
||||||
bootstrapCmd.AddCommand(bootstrapGitCmd)
|
bootstrapCmd.AddCommand(bootstrapGitCmd)
|
||||||
}
|
}
|
||||||
@@ -163,13 +168,13 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
repositoryURL.Host = repositoryURL.Hostname()
|
repositoryURL.Host = repositoryURL.Hostname()
|
||||||
} else {
|
} else {
|
||||||
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
|
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
|
||||||
|
secretOpts.Password = gitArgs.password
|
||||||
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
|
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
|
||||||
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
|
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
|
||||||
|
|
||||||
// Configure repository URL to match auth config for sync.
|
// Configure repository URL to match auth config for sync.
|
||||||
repositoryURL.User = url.User(gitArgs.username)
|
repositoryURL.User = url.User(gitArgs.username)
|
||||||
repositoryURL.Scheme = "ssh"
|
repositoryURL.Scheme = "ssh"
|
||||||
repositoryURL.Host = repositoryURL.Hostname()
|
|
||||||
if bootstrapArgs.sshHostname != "" {
|
if bootstrapArgs.sshHostname != "" {
|
||||||
repositoryURL.Host = bootstrapArgs.sshHostname
|
repositoryURL.Host = bootstrapArgs.sshHostname
|
||||||
}
|
}
|
||||||
@@ -189,7 +194,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
URL: repositoryURL.String(),
|
URL: repositoryURL.String(),
|
||||||
Branch: bootstrapArgs.branch,
|
Branch: bootstrapArgs.branch,
|
||||||
Secret: bootstrapArgs.secretName,
|
Secret: bootstrapArgs.secretName,
|
||||||
TargetPath: gitArgs.path.String(),
|
TargetPath: gitArgs.path.ToSlash(),
|
||||||
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
|
||||||
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
GitImplementation: sourceGitArgs.gitImplementation.String(),
|
||||||
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
|
||||||
@@ -229,7 +234,7 @@ func transportForURL(u *url.URL) (transport.AuthMethod, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
case "ssh":
|
case "ssh":
|
||||||
if bootstrapArgs.privateKeyFile != "" {
|
if bootstrapArgs.privateKeyFile != "" {
|
||||||
return ssh.NewPublicKeysFromFile(u.User.Username(), bootstrapArgs.privateKeyFile, "")
|
return ssh.NewPublicKeysFromFile(u.User.Username(), bootstrapArgs.privateKeyFile, gitArgs.password)
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
default:
|
default:
|
||||||
@@ -244,13 +249,16 @@ func promptPublicKey(ctx context.Context, secret corev1.Secret, _ sourcesecret.O
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.Successf("public key: %s", strings.TrimSpace(ppk))
|
logger.Successf("public key: %s", strings.TrimSpace(ppk))
|
||||||
prompt := promptui.Prompt{
|
|
||||||
Label: "Please give the key access to your repository",
|
if !gitArgs.silent {
|
||||||
IsConfirm: true,
|
prompt := promptui.Prompt{
|
||||||
}
|
Label: "Please give the key access to your repository",
|
||||||
_, err := prompt.Run()
|
IsConfirm: true,
|
||||||
if err != nil {
|
}
|
||||||
return fmt.Errorf("aborting")
|
_, err := prompt.Run()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("aborting")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ type githubFlags struct {
|
|||||||
path flags.SafeRelativePath
|
path flags.SafeRelativePath
|
||||||
teams []string
|
teams []string
|
||||||
readWriteKey bool
|
readWriteKey bool
|
||||||
|
reconcile bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -93,13 +94,14 @@ var githubArgs githubFlags
|
|||||||
func init() {
|
func init() {
|
||||||
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.owner, "owner", "", "GitHub user or organization name")
|
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.owner, "owner", "", "GitHub user or organization name")
|
||||||
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.repository, "repository", "", "GitHub repository name")
|
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.repository, "repository", "", "GitHub repository name")
|
||||||
bootstrapGitHubCmd.Flags().StringArrayVar(&githubArgs.teams, "team", []string{}, "GitHub team to be given maintainer access")
|
bootstrapGitHubCmd.Flags().StringSliceVar(&githubArgs.teams, "team", []string{}, "GitHub team to be given maintainer access (also accepts comma-separated values)")
|
||||||
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.personal, "personal", false, "if true, the owner is assumed to be a GitHub user; otherwise an org")
|
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.personal, "personal", false, "if true, the owner is assumed to be a GitHub user; otherwise an org")
|
||||||
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.private, "private", true, "if true, the repository is setup or configured as private")
|
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.private, "private", true, "if true, the repository is setup or configured as private")
|
||||||
bootstrapGitHubCmd.Flags().DurationVar(&githubArgs.interval, "interval", time.Minute, "sync interval")
|
bootstrapGitHubCmd.Flags().DurationVar(&githubArgs.interval, "interval", time.Minute, "sync interval")
|
||||||
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.hostname, "hostname", ghDefaultDomain, "GitHub hostname")
|
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.hostname, "hostname", ghDefaultDomain, "GitHub hostname")
|
||||||
bootstrapGitHubCmd.Flags().Var(&githubArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
|
bootstrapGitHubCmd.Flags().Var(&githubArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
|
||||||
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
|
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
|
||||||
|
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
|
||||||
|
|
||||||
bootstrapCmd.AddCommand(bootstrapGitHubCmd)
|
bootstrapCmd.AddCommand(bootstrapGitHubCmd)
|
||||||
}
|
}
|
||||||
@@ -235,6 +237,9 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if !githubArgs.private {
|
if !githubArgs.private {
|
||||||
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
|
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
|
||||||
}
|
}
|
||||||
|
if githubArgs.reconcile {
|
||||||
|
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
|
||||||
|
}
|
||||||
|
|
||||||
// Setup bootstrapper with constructed configs
|
// Setup bootstrapper with constructed configs
|
||||||
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
|
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ type gitlabFlags struct {
|
|||||||
path flags.SafeRelativePath
|
path flags.SafeRelativePath
|
||||||
teams []string
|
teams []string
|
||||||
readWriteKey bool
|
readWriteKey bool
|
||||||
|
reconcile bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var gitlabArgs gitlabFlags
|
var gitlabArgs gitlabFlags
|
||||||
@@ -93,13 +94,14 @@ var gitlabArgs gitlabFlags
|
|||||||
func init() {
|
func init() {
|
||||||
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.owner, "owner", "", "GitLab user or group name")
|
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.owner, "owner", "", "GitLab user or group name")
|
||||||
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.repository, "repository", "", "GitLab repository name")
|
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.repository, "repository", "", "GitLab repository name")
|
||||||
bootstrapGitLabCmd.Flags().StringArrayVar(&gitlabArgs.teams, "team", []string{}, "GitLab teams to be given maintainer access")
|
bootstrapGitLabCmd.Flags().StringSliceVar(&gitlabArgs.teams, "team", []string{}, "GitLab teams to be given maintainer access (also accepts comma-separated values)")
|
||||||
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.personal, "personal", false, "if true, the owner is assumed to be a GitLab user; otherwise a group")
|
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.personal, "personal", false, "if true, the owner is assumed to be a GitLab user; otherwise a group")
|
||||||
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.private, "private", true, "if true, the repository is setup or configured as private")
|
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.private, "private", true, "if true, the repository is setup or configured as private")
|
||||||
bootstrapGitLabCmd.Flags().DurationVar(&gitlabArgs.interval, "interval", time.Minute, "sync interval")
|
bootstrapGitLabCmd.Flags().DurationVar(&gitlabArgs.interval, "interval", time.Minute, "sync interval")
|
||||||
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.hostname, "hostname", glDefaultDomain, "GitLab hostname")
|
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.hostname, "hostname", glDefaultDomain, "GitLab hostname")
|
||||||
bootstrapGitLabCmd.Flags().Var(&gitlabArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
|
bootstrapGitLabCmd.Flags().Var(&gitlabArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
|
||||||
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
|
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
|
||||||
|
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
|
||||||
|
|
||||||
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
|
||||||
}
|
}
|
||||||
@@ -251,6 +253,9 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if !gitlabArgs.private {
|
if !gitlabArgs.private {
|
||||||
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
|
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
|
||||||
}
|
}
|
||||||
|
if gitlabArgs.reconcile {
|
||||||
|
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
|
||||||
|
}
|
||||||
|
|
||||||
// Setup bootstrapper with constructed configs
|
// Setup bootstrapper with constructed configs
|
||||||
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
|
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ var alertArgs alertFlags
|
|||||||
func init() {
|
func init() {
|
||||||
createAlertCmd.Flags().StringVar(&alertArgs.providerRef, "provider-ref", "", "reference to provider")
|
createAlertCmd.Flags().StringVar(&alertArgs.providerRef, "provider-ref", "", "reference to provider")
|
||||||
createAlertCmd.Flags().StringVar(&alertArgs.eventSeverity, "event-severity", "", "severity of events to send alerts for")
|
createAlertCmd.Flags().StringVar(&alertArgs.eventSeverity, "event-severity", "", "severity of events to send alerts for")
|
||||||
createAlertCmd.Flags().StringArrayVar(&alertArgs.eventSources, "event-source", []string{}, "sources that should generate alerts (<kind>/<name>)")
|
createAlertCmd.Flags().StringSliceVar(&alertArgs.eventSources, "event-source", []string{}, "sources that should generate alerts (<kind>/<name>), also accepts comma-separated values")
|
||||||
createCmd.AddCommand(createAlertCmd)
|
createCmd.AddCommand(createAlertCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,14 +74,15 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
eventSources := []notificationv1.CrossNamespaceObjectReference{}
|
eventSources := []notificationv1.CrossNamespaceObjectReference{}
|
||||||
for _, eventSource := range alertArgs.eventSources {
|
for _, eventSource := range alertArgs.eventSources {
|
||||||
kind, name := utils.ParseObjectKindName(eventSource)
|
kind, name, namespace := utils.ParseObjectKindNameNamespace(eventSource)
|
||||||
if kind == "" {
|
if kind == "" {
|
||||||
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", eventSource)
|
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", eventSource)
|
||||||
}
|
}
|
||||||
|
|
||||||
eventSources = append(eventSources, notificationv1.CrossNamespaceObjectReference{
|
eventSources = append(eventSources, notificationv1.CrossNamespaceObjectReference{
|
||||||
Kind: kind,
|
Kind: kind,
|
||||||
Name: name,
|
Name: name,
|
||||||
|
Namespace: namespace,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ var createHelmReleaseCmd = &cobra.Command{
|
|||||||
|
|
||||||
# Create a HelmRelease targeting another namespace than the resource
|
# Create a HelmRelease targeting another namespace than the resource
|
||||||
flux create hr podinfo \
|
flux create hr podinfo \
|
||||||
--target-namespace=default \
|
--target-namespace=test \
|
||||||
|
--create-target-namespace=true \
|
||||||
--source=HelmRepository/podinfo \
|
--source=HelmRepository/podinfo \
|
||||||
--chart=podinfo
|
--chart=podinfo
|
||||||
|
|
||||||
@@ -113,9 +114,11 @@ type helmReleaseFlags struct {
|
|||||||
chart string
|
chart string
|
||||||
chartVersion string
|
chartVersion string
|
||||||
targetNamespace string
|
targetNamespace string
|
||||||
valuesFile []string
|
createNamespace bool
|
||||||
|
valuesFiles []string
|
||||||
valuesFrom flags.HelmReleaseValuesFrom
|
valuesFrom flags.HelmReleaseValuesFrom
|
||||||
saName string
|
saName string
|
||||||
|
crds flags.CRDsPolicy
|
||||||
}
|
}
|
||||||
|
|
||||||
var helmReleaseArgs helmReleaseFlags
|
var helmReleaseArgs helmReleaseFlags
|
||||||
@@ -125,11 +128,13 @@ func init() {
|
|||||||
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description())
|
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description())
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
||||||
createHelmReleaseCmd.Flags().StringArrayVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.targetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.targetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
||||||
|
createHelmReleaseCmd.Flags().BoolVar(&helmReleaseArgs.createNamespace, "create-target-namespace", false, "create the target namespace if it does not exist")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
|
||||||
createHelmReleaseCmd.Flags().StringArrayVar(&helmReleaseArgs.valuesFile, "values", nil, "local path to values.yaml files")
|
createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.valuesFiles, "values", nil, "local path to values.yaml files, also accepts comma-separated values")
|
||||||
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.valuesFrom, "values-from", helmReleaseArgs.valuesFrom.Description())
|
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.valuesFrom, "values-from", helmReleaseArgs.valuesFrom.Description())
|
||||||
|
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.crds, "crds", helmReleaseArgs.crds.Description())
|
||||||
createCmd.AddCommand(createHelmReleaseCmd)
|
createCmd.AddCommand(createHelmReleaseCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,6 +170,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
Duration: createArgs.interval,
|
Duration: createArgs.interval,
|
||||||
},
|
},
|
||||||
TargetNamespace: helmReleaseArgs.targetNamespace,
|
TargetNamespace: helmReleaseArgs.targetNamespace,
|
||||||
|
|
||||||
Chart: helmv2.HelmChartTemplate{
|
Chart: helmv2.HelmChartTemplate{
|
||||||
Spec: helmv2.HelmChartTemplateSpec{
|
Spec: helmv2.HelmChartTemplateSpec{
|
||||||
Chart: helmReleaseArgs.chart,
|
Chart: helmReleaseArgs.chart,
|
||||||
@@ -176,6 +182,9 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Install: &helmv2.Install{
|
||||||
|
CreateNamespace: helmReleaseArgs.createNamespace,
|
||||||
|
},
|
||||||
Suspend: false,
|
Suspend: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -184,9 +193,14 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
helmRelease.Spec.ServiceAccountName = helmReleaseArgs.saName
|
helmRelease.Spec.ServiceAccountName = helmReleaseArgs.saName
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(helmReleaseArgs.valuesFile) > 0 {
|
if helmReleaseArgs.crds != "" {
|
||||||
var valuesMap map[string]interface{}
|
helmRelease.Spec.Install.CRDs = helmv2.Create
|
||||||
for _, v := range helmReleaseArgs.valuesFile {
|
helmRelease.Spec.Upgrade = &helmv2.Upgrade{CRDs: helmv2.CRDsPolicy(helmReleaseArgs.crds.String())}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(helmReleaseArgs.valuesFiles) > 0 {
|
||||||
|
valuesMap := make(map[string]interface{})
|
||||||
|
for _, v := range helmReleaseArgs.valuesFiles {
|
||||||
data, err := ioutil.ReadFile(v)
|
data, err := ioutil.ReadFile(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("reading values from %s failed: %w", v, err)
|
return fmt.Errorf("reading values from %s failed: %w", v, err)
|
||||||
@@ -202,11 +216,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("unmarshaling values from %s failed: %w", v, err)
|
return fmt.Errorf("unmarshaling values from %s failed: %w", v, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if valuesMap == nil {
|
valuesMap = transform.MergeMaps(valuesMap, jsonMap)
|
||||||
valuesMap = jsonMap
|
|
||||||
} else {
|
|
||||||
valuesMap = transform.MergeMaps(valuesMap, jsonMap)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonRaw, err := json.Marshal(valuesMap)
|
jsonRaw, err := json.Marshal(valuesMap)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import (
|
|||||||
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var createImagePolicyCmd = &cobra.Command{
|
var createImagePolicyCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import (
|
|||||||
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var createImageRepositoryCmd = &cobra.Command{
|
var createImageRepositoryCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -22,9 +22,8 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var createImageUpdateCmd = &cobra.Command{
|
var createImageUpdateCmd = &cobra.Command{
|
||||||
@@ -113,25 +112,33 @@ func createImageUpdateRun(cmd *cobra.Command, args []string) error {
|
|||||||
Labels: labels,
|
Labels: labels,
|
||||||
},
|
},
|
||||||
Spec: autov1.ImageUpdateAutomationSpec{
|
Spec: autov1.ImageUpdateAutomationSpec{
|
||||||
Checkout: autov1.GitCheckoutSpec{
|
SourceRef: autov1.SourceReference{
|
||||||
GitRepositoryRef: meta.LocalObjectReference{
|
Kind: sourcev1.GitRepositoryKind,
|
||||||
Name: imageUpdateArgs.gitRepoRef,
|
Name: imageUpdateArgs.gitRepoRef,
|
||||||
|
},
|
||||||
|
|
||||||
|
GitSpec: &autov1.GitSpec{
|
||||||
|
Checkout: &autov1.GitCheckoutSpec{
|
||||||
|
Reference: sourcev1.GitRepositoryRef{
|
||||||
|
Branch: imageUpdateArgs.checkoutBranch,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Commit: autov1.CommitSpec{
|
||||||
|
Author: autov1.CommitUser{
|
||||||
|
Name: imageUpdateArgs.authorName,
|
||||||
|
Email: imageUpdateArgs.authorEmail,
|
||||||
|
},
|
||||||
|
MessageTemplate: imageUpdateArgs.commitTemplate,
|
||||||
},
|
},
|
||||||
Branch: imageUpdateArgs.checkoutBranch,
|
|
||||||
},
|
},
|
||||||
Interval: metav1.Duration{
|
Interval: metav1.Duration{
|
||||||
Duration: createArgs.interval,
|
Duration: createArgs.interval,
|
||||||
},
|
},
|
||||||
Commit: autov1.CommitSpec{
|
|
||||||
AuthorName: imageUpdateArgs.authorName,
|
|
||||||
AuthorEmail: imageUpdateArgs.authorEmail,
|
|
||||||
MessageTemplate: imageUpdateArgs.commitTemplate,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if imageUpdateArgs.pushBranch != "" {
|
if imageUpdateArgs.pushBranch != "" {
|
||||||
update.Spec.Push = &autov1.PushSpec{
|
update.Spec.GitSpec.Push = &autov1.PushSpec{
|
||||||
Branch: imageUpdateArgs.pushBranch,
|
Branch: imageUpdateArgs.pushBranch,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,10 +100,10 @@ func init() {
|
|||||||
createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description())
|
createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description())
|
||||||
createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file")
|
createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file")
|
||||||
createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection")
|
createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection")
|
||||||
createKsCmd.Flags().StringArrayVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
|
createKsCmd.Flags().StringSliceVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
|
||||||
createKsCmd.Flags().DurationVar(&kustomizationArgs.healthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations")
|
createKsCmd.Flags().DurationVar(&kustomizationArgs.healthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations")
|
||||||
createKsCmd.Flags().StringVar(&kustomizationArgs.validation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
|
createKsCmd.Flags().StringVar(&kustomizationArgs.validation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
|
||||||
createKsCmd.Flags().StringArrayVar(&kustomizationArgs.dependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>'")
|
createKsCmd.Flags().StringSliceVar(&kustomizationArgs.dependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>', also accepts comma-separated values")
|
||||||
createKsCmd.Flags().StringVar(&kustomizationArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this Kustomization")
|
createKsCmd.Flags().StringVar(&kustomizationArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this Kustomization")
|
||||||
createKsCmd.Flags().Var(&kustomizationArgs.decryptionProvider, "decryption-provider", kustomizationArgs.decryptionProvider.Description())
|
createKsCmd.Flags().Var(&kustomizationArgs.decryptionProvider, "decryption-provider", kustomizationArgs.decryptionProvider.Description())
|
||||||
createKsCmd.Flags().StringVar(&kustomizationArgs.decryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
|
createKsCmd.Flags().StringVar(&kustomizationArgs.decryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ var receiverArgs receiverFlags
|
|||||||
func init() {
|
func init() {
|
||||||
createReceiverCmd.Flags().StringVar(&receiverArgs.receiverType, "type", "", "")
|
createReceiverCmd.Flags().StringVar(&receiverArgs.receiverType, "type", "", "")
|
||||||
createReceiverCmd.Flags().StringVar(&receiverArgs.secretRef, "secret-ref", "", "")
|
createReceiverCmd.Flags().StringVar(&receiverArgs.secretRef, "secret-ref", "", "")
|
||||||
createReceiverCmd.Flags().StringArrayVar(&receiverArgs.events, "event", []string{}, "")
|
createReceiverCmd.Flags().StringSliceVar(&receiverArgs.events, "event", []string{}, "also accepts comma-separated values")
|
||||||
createReceiverCmd.Flags().StringArrayVar(&receiverArgs.resources, "resource", []string{}, "")
|
createReceiverCmd.Flags().StringSliceVar(&receiverArgs.resources, "resource", []string{}, "also accepts comma-separated values")
|
||||||
createCmd.AddCommand(createReceiverCmd)
|
createCmd.AddCommand(createReceiverCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,25 +50,28 @@ For Git over HTTP/S, the provided basic authentication credentials are stored in
|
|||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
--private-key-file=./private.key
|
--private-key-file=./private.key
|
||||||
|
|
||||||
|
# Create a Git SSH authentication secret with a passworded private key from file
|
||||||
|
# The public SSH host key will still be gathered from the host
|
||||||
|
flux create secret git podinfo-auth \
|
||||||
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
|
--private-key-file=./private.key \
|
||||||
|
--password=<password>
|
||||||
|
|
||||||
# Create a secret for a Git repository using basic authentication
|
# Create a secret for a Git repository using basic authentication
|
||||||
flux create secret git podinfo-auth \
|
flux create secret git podinfo-auth \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
--username=username \
|
--username=username \
|
||||||
--password=password
|
--password=password
|
||||||
|
|
||||||
# Create a Git SSH secret on disk and print the deploy key
|
# Create a Git SSH secret on disk
|
||||||
flux create secret git podinfo-auth \
|
flux create secret git podinfo-auth \
|
||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
--export > podinfo-auth.yaml
|
--export > podinfo-auth.yaml
|
||||||
|
|
||||||
yq read podinfo-auth.yaml 'data."identity.pub"' | base64 --decode
|
# Print the deploy key
|
||||||
|
yq eval '.stringData."identity.pub"' podinfo-auth.yaml
|
||||||
# Create a Git SSH secret on disk and encrypt it with Mozilla SOPS
|
|
||||||
flux create secret git podinfo-auth \
|
|
||||||
--namespace=apps \
|
|
||||||
--url=ssh://git@github.com/stefanprodan/podinfo \
|
|
||||||
--export > podinfo-auth.yaml
|
|
||||||
|
|
||||||
|
# Encrypt the secret on disk with Mozilla SOPS
|
||||||
sops --encrypt --encrypted-regex '^(data|stringData)$' \
|
sops --encrypt --encrypted-regex '^(data|stringData)$' \
|
||||||
--in-place podinfo-auth.yaml`,
|
--in-place podinfo-auth.yaml`,
|
||||||
RunE: createSecretGitCmdRun,
|
RunE: createSecretGitCmdRun,
|
||||||
@@ -140,6 +143,7 @@ func createSecretGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
opts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(secretGitArgs.keyAlgorithm)
|
opts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(secretGitArgs.keyAlgorithm)
|
||||||
opts.RSAKeyBits = int(secretGitArgs.rsaBits)
|
opts.RSAKeyBits = int(secretGitArgs.rsaBits)
|
||||||
opts.ECDSACurve = secretGitArgs.ecdsaCurve.Curve
|
opts.ECDSACurve = secretGitArgs.ecdsaCurve.Curve
|
||||||
|
opts.Password = secretGitArgs.password
|
||||||
case "http", "https":
|
case "http", "https":
|
||||||
if secretGitArgs.username == "" || secretGitArgs.password == "" {
|
if secretGitArgs.username == "" || secretGitArgs.password == "" {
|
||||||
return fmt.Errorf("for Git over HTTP/S the username and password are required")
|
return fmt.Errorf("for Git over HTTP/S the username and password are required")
|
||||||
|
|||||||
@@ -101,6 +101,15 @@ For private Git repositories, the basic authentication credentials are stored in
|
|||||||
--branch=master \
|
--branch=master \
|
||||||
--private-key-file=./private.key
|
--private-key-file=./private.key
|
||||||
|
|
||||||
|
# Create a source for a Git repository using SSH authentication and a
|
||||||
|
# private key with a password from file
|
||||||
|
# The public SSH host key will still be gathered from the host
|
||||||
|
flux create source git podinfo \
|
||||||
|
--url=ssh://git@github.com/stefanprodan/podinfo \
|
||||||
|
--branch=master \
|
||||||
|
--private-key-file=./private.key \
|
||||||
|
--password=<password>
|
||||||
|
|
||||||
# Create a source for a Git repository using basic authentication
|
# Create a source for a Git repository using basic authentication
|
||||||
flux create source git podinfo \
|
flux create source git podinfo \
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
--url=https://github.com/stefanprodan/podinfo \
|
||||||
@@ -113,7 +122,7 @@ var sourceGitArgs = newSourceGitFlags()
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.url, "url", "", "git address, e.g. ssh://git@host/org/repository")
|
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.url, "url", "", "git address, e.g. ssh://git@host/org/repository")
|
||||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.branch, "branch", "master", "git branch")
|
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.branch, "branch", "", "git branch")
|
||||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.tag, "tag", "", "git tag")
|
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.tag, "tag", "", "git tag")
|
||||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.semver, "tag-semver", "", "git tag semver range")
|
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.semver, "tag-semver", "", "git tag semver range")
|
||||||
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.username, "username", "u", "", "basic authentication username")
|
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.username, "username", "u", "", "basic authentication username")
|
||||||
@@ -157,6 +166,10 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("git URL scheme '%s' not supported, can be: ssh, http and https", u.Scheme)
|
return fmt.Errorf("git URL scheme '%s' not supported, can be: ssh, http and https", u.Scheme)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sourceGitArgs.branch == "" && sourceGitArgs.tag == "" && sourceGitArgs.semver == "" {
|
||||||
|
return fmt.Errorf("a Git ref is required, use one of the following: --branch, --tag or --tag-semver")
|
||||||
|
}
|
||||||
|
|
||||||
if sourceGitArgs.caFile != "" && u.Scheme == "ssh" {
|
if sourceGitArgs.caFile != "" && u.Scheme == "ssh" {
|
||||||
return fmt.Errorf("specifing a CA file is not supported for Git over SSH")
|
return fmt.Errorf("specifing a CA file is not supported for Git over SSH")
|
||||||
}
|
}
|
||||||
@@ -236,6 +249,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(sourceGitArgs.keyAlgorithm)
|
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(sourceGitArgs.keyAlgorithm)
|
||||||
secretOpts.RSAKeyBits = int(sourceGitArgs.keyRSABits)
|
secretOpts.RSAKeyBits = int(sourceGitArgs.keyRSABits)
|
||||||
secretOpts.ECDSACurve = sourceGitArgs.keyECDSACurve.Curve
|
secretOpts.ECDSACurve = sourceGitArgs.keyECDSACurve.Curve
|
||||||
|
secretOpts.Password = sourceGitArgs.password
|
||||||
case "https":
|
case "https":
|
||||||
secretOpts.Username = sourceGitArgs.username
|
secretOpts.Username = sourceGitArgs.username
|
||||||
secretOpts.Password = sourceGitArgs.password
|
secretOpts.Password = sourceGitArgs.password
|
||||||
|
|||||||
@@ -66,13 +66,14 @@ For private Helm repositories, the basic authentication credentials are stored i
|
|||||||
}
|
}
|
||||||
|
|
||||||
type sourceHelmFlags struct {
|
type sourceHelmFlags struct {
|
||||||
url string
|
url string
|
||||||
username string
|
username string
|
||||||
password string
|
password string
|
||||||
certFile string
|
certFile string
|
||||||
keyFile string
|
keyFile string
|
||||||
caFile string
|
caFile string
|
||||||
secretRef string
|
secretRef string
|
||||||
|
passCredentials bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var sourceHelmArgs sourceHelmFlags
|
var sourceHelmArgs sourceHelmFlags
|
||||||
@@ -85,6 +86,7 @@ func init() {
|
|||||||
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.keyFile, "key-file", "", "TLS authentication key file path")
|
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.keyFile, "key-file", "", "TLS authentication key file path")
|
||||||
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.caFile, "ca-file", "", "TLS authentication CA file path")
|
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.caFile, "ca-file", "", "TLS authentication CA file path")
|
||||||
createSourceHelmCmd.Flags().StringVarP(&sourceHelmArgs.secretRef, "secret-ref", "", "", "the name of an existing secret containing TLS or basic auth credentials")
|
createSourceHelmCmd.Flags().StringVarP(&sourceHelmArgs.secretRef, "secret-ref", "", "", "the name of an existing secret containing TLS or basic auth credentials")
|
||||||
|
createSourceHelmCmd.Flags().BoolVarP(&sourceHelmArgs.passCredentials, "pass-credentials", "", false, "pass credentials to all domains")
|
||||||
|
|
||||||
createSourceCmd.AddCommand(createSourceHelmCmd)
|
createSourceCmd.AddCommand(createSourceHelmCmd)
|
||||||
}
|
}
|
||||||
@@ -132,6 +134,7 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
helmRepository.Spec.SecretRef = &meta.LocalObjectReference{
|
helmRepository.Spec.SecretRef = &meta.LocalObjectReference{
|
||||||
Name: sourceHelmArgs.secretRef,
|
Name: sourceHelmArgs.secretRef,
|
||||||
}
|
}
|
||||||
|
helmRepository.Spec.PassCredentials = sourceHelmArgs.passCredentials
|
||||||
}
|
}
|
||||||
|
|
||||||
if createArgs.export {
|
if createArgs.export {
|
||||||
@@ -175,6 +178,7 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
helmRepository.Spec.SecretRef = &meta.LocalObjectReference{
|
helmRepository.Spec.SecretRef = &meta.LocalObjectReference{
|
||||||
Name: secretName,
|
Name: secretName,
|
||||||
}
|
}
|
||||||
|
helmRepository.Spec.PassCredentials = sourceHelmArgs.passCredentials
|
||||||
logger.Successf("authentication configured")
|
logger.Successf("authentication configured")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var deleteImagePolicyCmd = &cobra.Command{
|
var deleteImagePolicyCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var deleteImageRepositoryCmd = &cobra.Command{
|
var deleteImageRepositoryCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var deleteImageUpdateCmd = &cobra.Command{
|
var deleteImageUpdateCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ func docgenCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
func frontmatterPrepender(filename string) string {
|
func frontmatterPrepender(filename string) string {
|
||||||
name := filepath.Base(filename)
|
name := filepath.Base(filename)
|
||||||
base := strings.TrimSuffix(name, path.Ext(name))
|
base := strings.TrimSuffix(name, path.Ext(name))
|
||||||
title := strings.Replace(base, "_", " ", -1) + " command"
|
title := strings.Replace(base, "_", " ", -1)
|
||||||
return fmt.Sprintf(fmTemplate, title)
|
return fmt.Sprintf(fmTemplate, title)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exportImagePolicyCmd = &cobra.Command{
|
var exportImagePolicyCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exportImageRepositoryCmd = &cobra.Command{
|
var exportImageRepositoryCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exportImageUpdateCmd = &cobra.Command{
|
var exportImageUpdateCmd = &cobra.Command{
|
||||||
|
|||||||
91
cmd/flux/get_all.go
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 The Flux authors
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
|
||||||
|
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var getAllCmd = &cobra.Command{
|
||||||
|
Use: "all",
|
||||||
|
Short: "Get all resources and statuses",
|
||||||
|
Long: "The get all command print the statuses of all resources.",
|
||||||
|
Example: ` # List all resources in a namespace
|
||||||
|
flux get all --namespace=flux-system
|
||||||
|
|
||||||
|
# List all resources in all namespaces
|
||||||
|
flux get all --all-namespaces`,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
err := getSourceAllCmd.RunE(cmd, args)
|
||||||
|
if err != nil {
|
||||||
|
logError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// all get command
|
||||||
|
var allCmd = []getCommand{
|
||||||
|
{
|
||||||
|
apiType: helmReleaseType,
|
||||||
|
list: &helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: kustomizationType,
|
||||||
|
list: &kustomizationListAdapter{&kustomizev1.KustomizationList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: receiverType,
|
||||||
|
list: receiverListAdapter{¬ificationv1.ReceiverList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: alertProviderType,
|
||||||
|
list: alertProviderListAdapter{¬ificationv1.ProviderList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: alertType,
|
||||||
|
list: &alertListAdapter{¬ificationv1.AlertList{}},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
err = getImageAllCmd.RunE(cmd, args)
|
||||||
|
if err != nil {
|
||||||
|
logError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range allCmd {
|
||||||
|
if err := c.run(cmd, args); err != nil {
|
||||||
|
logError(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func logError(err error) {
|
||||||
|
if !strings.Contains(err.Error(), "no matches for kind") {
|
||||||
|
logger.Failuref(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
getCmd.AddCommand(getAllCmd)
|
||||||
|
}
|
||||||
@@ -17,10 +17,12 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var getImageAllCmd = &cobra.Command{
|
var getImageAllCmd = &cobra.Command{
|
||||||
@@ -33,28 +35,27 @@ var getImageAllCmd = &cobra.Command{
|
|||||||
# List all image objects in all namespaces
|
# List all image objects in all namespaces
|
||||||
flux get images all --all-namespaces`,
|
flux get images all --all-namespaces`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
c := getCommand{
|
var allImageCmd = []getCommand{
|
||||||
apiType: imageRepositoryType,
|
{
|
||||||
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
|
apiType: imageRepositoryType,
|
||||||
}
|
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
|
||||||
if err := c.run(cmd, args); err != nil {
|
},
|
||||||
logger.Failuref(err.Error())
|
{
|
||||||
|
apiType: imagePolicyType,
|
||||||
|
list: &imagePolicyListAdapter{&imagev1.ImagePolicyList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: imageUpdateAutomationType,
|
||||||
|
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
c = getCommand{
|
for _, c := range allImageCmd {
|
||||||
apiType: imagePolicyType,
|
if err := c.run(cmd, args); err != nil {
|
||||||
list: &imagePolicyListAdapter{&imagev1.ImagePolicyList{}},
|
if !strings.Contains(err.Error(), "no matches for kind") {
|
||||||
}
|
logger.Failuref(err.Error())
|
||||||
if err := c.run(cmd, args); err != nil {
|
}
|
||||||
logger.Failuref(err.Error())
|
}
|
||||||
}
|
|
||||||
|
|
||||||
c = getCommand{
|
|
||||||
apiType: imageUpdateAutomationType,
|
|
||||||
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
|
|
||||||
}
|
|
||||||
if err := c.run(cmd, args); err != nil {
|
|
||||||
logger.Failuref(err.Error())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var getImagePolicyCmd = &cobra.Command{
|
var getImagePolicyCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var getImageRepositoryCmd = &cobra.Command{
|
var getImageRepositoryCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var getImageUpdateCmd = &cobra.Command{
|
var getImageUpdateCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
@@ -32,36 +34,31 @@ var getSourceAllCmd = &cobra.Command{
|
|||||||
# List all sources in all namespaces
|
# List all sources in all namespaces
|
||||||
flux get sources all --all-namespaces`,
|
flux get sources all --all-namespaces`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
c := getCommand{
|
var allSourceCmd = []getCommand{
|
||||||
apiType: bucketType,
|
{
|
||||||
list: &bucketListAdapter{&sourcev1.BucketList{}},
|
apiType: bucketType,
|
||||||
}
|
list: &bucketListAdapter{&sourcev1.BucketList{}},
|
||||||
if err := c.run(cmd, args); err != nil {
|
},
|
||||||
logger.Failuref(err.Error())
|
{
|
||||||
|
apiType: gitRepositoryType,
|
||||||
|
list: &gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: helmRepositoryType,
|
||||||
|
list: &helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
apiType: helmChartType,
|
||||||
|
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
c = getCommand{
|
for _, c := range allSourceCmd {
|
||||||
apiType: gitRepositoryType,
|
if err := c.run(cmd, args); err != nil {
|
||||||
list: &gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
|
if !strings.Contains(err.Error(), "no matches for kind") {
|
||||||
}
|
logger.Failuref(err.Error())
|
||||||
if err := c.run(cmd, args); err != nil {
|
}
|
||||||
logger.Failuref(err.Error())
|
}
|
||||||
}
|
|
||||||
|
|
||||||
c = getCommand{
|
|
||||||
apiType: helmRepositoryType,
|
|
||||||
list: &helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
|
|
||||||
}
|
|
||||||
if err := c.run(cmd, args); err != nil {
|
|
||||||
logger.Failuref(err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
c = getCommand{
|
|
||||||
apiType: helmChartType,
|
|
||||||
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
|
|
||||||
}
|
|
||||||
if err := c.run(cmd, args); err != nil {
|
|
||||||
logger.Failuref(err.Error())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These are general-purpose adapters for attaching methods to, for
|
// These are general-purpose adapters for attaching methods to, for
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
|
||||||
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
@@ -60,7 +61,7 @@ func (obj helmReleaseAdapter) reconcileSource() bool {
|
|||||||
return rhrArgs.syncHrWithSource
|
return rhrArgs.syncHrWithSource
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj helmReleaseAdapter) getSource() (reconcileCommand, string) {
|
func (obj helmReleaseAdapter) getSource() (reconcileCommand, types.NamespacedName) {
|
||||||
var cmd reconcileCommand
|
var cmd reconcileCommand
|
||||||
switch obj.Spec.Chart.Spec.SourceRef.Kind {
|
switch obj.Spec.Chart.Spec.SourceRef.Kind {
|
||||||
case sourcev1.HelmRepositoryKind:
|
case sourcev1.HelmRepositoryKind:
|
||||||
@@ -80,5 +81,8 @@ func (obj helmReleaseAdapter) getSource() (reconcileCommand, string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd, obj.Spec.Chart.Spec.SourceRef.Name
|
return cmd, types.NamespacedName{
|
||||||
|
Name: obj.Spec.Chart.Spec.SourceRef.Name,
|
||||||
|
Namespace: obj.Spec.Chart.Spec.SourceRef.Namespace,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var reconcileImageRepositoryCmd = &cobra.Command{
|
var reconcileImageRepositoryCmd = &cobra.Command{
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
meta "github.com/fluxcd/pkg/apis/meta"
|
meta "github.com/fluxcd/pkg/apis/meta"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
|
||||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
@@ -60,7 +61,7 @@ func (obj kustomizationAdapter) reconcileSource() bool {
|
|||||||
return rksArgs.syncKsWithSource
|
return rksArgs.syncKsWithSource
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj kustomizationAdapter) getSource() (reconcileCommand, string) {
|
func (obj kustomizationAdapter) getSource() (reconcileCommand, types.NamespacedName) {
|
||||||
var cmd reconcileCommand
|
var cmd reconcileCommand
|
||||||
switch obj.Spec.SourceRef.Kind {
|
switch obj.Spec.SourceRef.Kind {
|
||||||
case sourcev1.GitRepositoryKind:
|
case sourcev1.GitRepositoryKind:
|
||||||
@@ -75,5 +76,8 @@ func (obj kustomizationAdapter) getSource() (reconcileCommand, string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd, obj.Spec.SourceRef.Name
|
return cmd, types.NamespacedName{
|
||||||
|
Name: obj.Spec.SourceRef.Name,
|
||||||
|
Namespace: obj.Spec.SourceRef.Namespace,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type reconcileWithSource interface {
|
|||||||
adapter
|
adapter
|
||||||
reconcilable
|
reconcilable
|
||||||
reconcileSource() bool
|
reconcileSource() bool
|
||||||
getSource() (reconcileCommand, string)
|
getSource() (reconcileCommand, types.NamespacedName)
|
||||||
}
|
}
|
||||||
|
|
||||||
type reconcileWithSourceCommand struct {
|
type reconcileWithSourceCommand struct {
|
||||||
@@ -55,14 +55,13 @@ func (reconcile reconcileWithSourceCommand) run(cmd *cobra.Command, args []strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
if reconcile.object.reconcileSource() {
|
if reconcile.object.reconcileSource() {
|
||||||
|
reconcileCmd, nsName := reconcile.object.getSource()
|
||||||
nsCopy := rootArgs.namespace
|
nsCopy := rootArgs.namespace
|
||||||
objectNs := reconcile.object.asClientObject().GetNamespace()
|
if nsName.Namespace != "" {
|
||||||
if objectNs != "" {
|
rootArgs.namespace = nsName.Namespace
|
||||||
rootArgs.namespace = reconcile.object.asClientObject().GetNamespace()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reconcileCmd, sourceName := reconcile.object.getSource()
|
err := reconcileCmd.run(nil, []string{nsName.Name})
|
||||||
err := reconcileCmd.run(nil, []string{sourceName})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"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"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/internal/utils"
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
)
|
)
|
||||||
@@ -33,7 +34,15 @@ var resumeCmd = &cobra.Command{
|
|||||||
Long: "The resume sub-commands resume a suspended resource.",
|
Long: "The resume sub-commands resume a suspended resource.",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ResumeFlags struct {
|
||||||
|
all bool
|
||||||
|
}
|
||||||
|
|
||||||
|
var resumeArgs ResumeFlags
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
resumeCmd.PersistentFlags().BoolVarP(&resumeArgs.all, "all", "", false,
|
||||||
|
"suspend all resources in that namespace")
|
||||||
rootCmd.AddCommand(resumeCmd)
|
rootCmd.AddCommand(resumeCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,13 +56,18 @@ type resumable interface {
|
|||||||
type resumeCommand struct {
|
type resumeCommand struct {
|
||||||
apiType
|
apiType
|
||||||
object resumable
|
object resumable
|
||||||
|
list listResumable
|
||||||
|
}
|
||||||
|
|
||||||
|
type listResumable interface {
|
||||||
|
listAdapter
|
||||||
|
resumeItem(i int) resumable
|
||||||
}
|
}
|
||||||
|
|
||||||
func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
|
func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
|
||||||
if len(args) < 1 {
|
if len(args) < 1 && !resumeArgs.all {
|
||||||
return fmt.Errorf("%s name is required", resume.humanKind)
|
return fmt.Errorf("%s name is required", resume.humanKind)
|
||||||
}
|
}
|
||||||
name := args[0]
|
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -63,29 +77,46 @@ func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
namespacedName := types.NamespacedName{
|
var listOpts []client.ListOption
|
||||||
Namespace: rootArgs.namespace,
|
listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
|
||||||
Name: name,
|
if len(args) > 0 {
|
||||||
|
listOpts = append(listOpts, client.MatchingFields{
|
||||||
|
"metadata.name": args[0],
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
err = kubeClient.Get(ctx, namespacedName, resume.object.asClientObject())
|
err = kubeClient.List(ctx, resume.list.asClientList(), listOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Actionf("resuming %s %s in %s namespace", resume.humanKind, name, rootArgs.namespace)
|
if resume.list.len() == 0 {
|
||||||
resume.object.setUnsuspended()
|
logger.Failuref("no %s objects found in %s namespace", resume.kind, rootArgs.namespace)
|
||||||
if err := kubeClient.Update(ctx, resume.object.asClientObject()); err != nil {
|
return nil
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
logger.Successf("%s resumed", resume.humanKind)
|
|
||||||
|
|
||||||
logger.Waitingf("waiting for %s reconciliation", resume.kind)
|
for i := 0; i < resume.list.len(); i++ {
|
||||||
if err := wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout,
|
logger.Actionf("resuming %s %s in %s namespace", resume.humanKind, resume.list.resumeItem(i).asClientObject().GetName(), rootArgs.namespace)
|
||||||
isReady(ctx, kubeClient, namespacedName, resume.object)); err != nil {
|
resume.list.resumeItem(i).setUnsuspended()
|
||||||
return err
|
if err := kubeClient.Update(ctx, resume.list.resumeItem(i).asClientObject()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("%s resumed", resume.humanKind)
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Name: resume.list.resumeItem(i).asClientObject().GetName(),
|
||||||
|
Namespace: rootArgs.namespace,
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Waitingf("waiting for %s reconciliation", resume.kind)
|
||||||
|
if err := wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout,
|
||||||
|
isReady(ctx, kubeClient, namespacedName, resume.list.resumeItem(i))); err != nil {
|
||||||
|
logger.Failuref(err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
logger.Successf("%s reconciliation completed", resume.kind)
|
||||||
|
logger.Successf(resume.list.resumeItem(i).successMessage())
|
||||||
}
|
}
|
||||||
logger.Successf("%s reconciliation completed", resume.kind)
|
|
||||||
logger.Successf(resume.object.successMessage())
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ finish the apply.`,
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: alertType,
|
apiType: alertType,
|
||||||
object: alertAdapter{¬ificationv1.Alert{}},
|
object: alertAdapter{¬ificationv1.Alert{}},
|
||||||
|
list: &alertListAdapter{¬ificationv1.AlertList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,3 +51,7 @@ func (obj alertAdapter) setUnsuspended() {
|
|||||||
func (obj alertAdapter) successMessage() string {
|
func (obj alertAdapter) successMessage() string {
|
||||||
return "Alert reconciliation completed"
|
return "Alert reconciliation completed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a alertListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &alertAdapter{&a.AlertList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ finish the apply.`,
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: helmReleaseType,
|
apiType: helmReleaseType,
|
||||||
object: helmReleaseAdapter{&helmv2.HelmRelease{}},
|
object: helmReleaseAdapter{&helmv2.HelmRelease{}},
|
||||||
|
list: helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,3 +54,7 @@ func (obj helmReleaseAdapter) setUnsuspended() {
|
|||||||
func (obj helmReleaseAdapter) successMessage() string {
|
func (obj helmReleaseAdapter) successMessage() string {
|
||||||
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
|
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a helmReleaseListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &helmReleaseAdapter{&a.HelmReleaseList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var resumeImageRepositoryCmd = &cobra.Command{
|
var resumeImageRepositoryCmd = &cobra.Command{
|
||||||
@@ -31,6 +31,7 @@ var resumeImageRepositoryCmd = &cobra.Command{
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: imageRepositoryType,
|
apiType: imageRepositoryType,
|
||||||
object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
|
object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
|
||||||
|
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj imageRepositoryAdapter) getObservedGeneration() int64 {
|
|||||||
func (obj imageRepositoryAdapter) setUnsuspended() {
|
func (obj imageRepositoryAdapter) setUnsuspended() {
|
||||||
obj.ImageRepository.Spec.Suspend = false
|
obj.ImageRepository.Spec.Suspend = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a imageRepositoryListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &imageRepositoryAdapter{&a.ImageRepositoryList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var resumeImageUpdateCmd = &cobra.Command{
|
var resumeImageUpdateCmd = &cobra.Command{
|
||||||
@@ -31,6 +31,7 @@ var resumeImageUpdateCmd = &cobra.Command{
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: imageUpdateAutomationType,
|
apiType: imageUpdateAutomationType,
|
||||||
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
|
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
|
||||||
|
list: imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj imageUpdateAutomationAdapter) setUnsuspended() {
|
|||||||
func (obj imageUpdateAutomationAdapter) getObservedGeneration() int64 {
|
func (obj imageUpdateAutomationAdapter) getObservedGeneration() int64 {
|
||||||
return obj.ImageUpdateAutomation.Status.ObservedGeneration
|
return obj.ImageUpdateAutomation.Status.ObservedGeneration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a imageUpdateAutomationListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &imageUpdateAutomationAdapter{&a.ImageUpdateAutomationList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ finish the apply.`,
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: kustomizationType,
|
apiType: kustomizationType,
|
||||||
object: kustomizationAdapter{&kustomizev1.Kustomization{}},
|
object: kustomizationAdapter{&kustomizev1.Kustomization{}},
|
||||||
|
list: kustomizationListAdapter{&kustomizev1.KustomizationList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,3 +54,7 @@ func (obj kustomizationAdapter) setUnsuspended() {
|
|||||||
func (obj kustomizationAdapter) successMessage() string {
|
func (obj kustomizationAdapter) successMessage() string {
|
||||||
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
|
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a kustomizationListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &kustomizationAdapter{&a.KustomizationList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ finish the apply.`,
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: receiverType,
|
apiType: receiverType,
|
||||||
object: receiverAdapter{¬ificationv1.Receiver{}},
|
object: receiverAdapter{¬ificationv1.Receiver{}},
|
||||||
|
list: receiverListAdapter{¬ificationv1.ReceiverList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,3 +51,7 @@ func (obj receiverAdapter) setUnsuspended() {
|
|||||||
func (obj receiverAdapter) successMessage() string {
|
func (obj receiverAdapter) successMessage() string {
|
||||||
return "Receiver reconciliation completed"
|
return "Receiver reconciliation completed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a receiverListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &receiverAdapter{&a.ReceiverList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,3 +45,7 @@ func (obj bucketAdapter) getObservedGeneration() int64 {
|
|||||||
func (obj bucketAdapter) setUnsuspended() {
|
func (obj bucketAdapter) setUnsuspended() {
|
||||||
obj.Bucket.Spec.Suspend = false
|
obj.Bucket.Spec.Suspend = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a bucketListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &bucketAdapter{&a.BucketList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ var resumeSourceHelmChartCmd = &cobra.Command{
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: helmChartType,
|
apiType: helmChartType,
|
||||||
object: &helmChartAdapter{&sourcev1.HelmChart{}},
|
object: &helmChartAdapter{&sourcev1.HelmChart{}},
|
||||||
|
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,3 +52,7 @@ func (obj helmChartAdapter) setUnsuspended() {
|
|||||||
func (obj helmChartAdapter) successMessage() string {
|
func (obj helmChartAdapter) successMessage() string {
|
||||||
return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision)
|
return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a helmChartListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &helmChartAdapter{&a.HelmChartList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var resumeSourceGitCmd = &cobra.Command{
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: gitRepositoryType,
|
apiType: gitRepositoryType,
|
||||||
object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
|
object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
|
||||||
|
list: gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj gitRepositoryAdapter) getObservedGeneration() int64 {
|
|||||||
func (obj gitRepositoryAdapter) setUnsuspended() {
|
func (obj gitRepositoryAdapter) setUnsuspended() {
|
||||||
obj.GitRepository.Spec.Suspend = false
|
obj.GitRepository.Spec.Suspend = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a gitRepositoryListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &gitRepositoryAdapter{&a.GitRepositoryList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var resumeSourceHelmCmd = &cobra.Command{
|
|||||||
RunE: resumeCommand{
|
RunE: resumeCommand{
|
||||||
apiType: helmRepositoryType,
|
apiType: helmRepositoryType,
|
||||||
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
|
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
|
||||||
|
list: helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj helmRepositoryAdapter) getObservedGeneration() int64 {
|
|||||||
func (obj helmRepositoryAdapter) setUnsuspended() {
|
func (obj helmRepositoryAdapter) setUnsuspended() {
|
||||||
obj.HelmRepository.Spec.Suspend = false
|
obj.HelmRepository.Spec.Suspend = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a helmRepositoryListAdapter) resumeItem(i int) resumable {
|
||||||
|
return &helmRepositoryAdapter{&a.HelmRepositoryList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/internal/utils"
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
)
|
)
|
||||||
@@ -32,7 +32,15 @@ var suspendCmd = &cobra.Command{
|
|||||||
Long: "The suspend sub-commands suspend the reconciliation of a resource.",
|
Long: "The suspend sub-commands suspend the reconciliation of a resource.",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SuspendFlags struct {
|
||||||
|
all bool
|
||||||
|
}
|
||||||
|
|
||||||
|
var suspendArgs SuspendFlags
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
suspendCmd.PersistentFlags().BoolVarP(&suspendArgs.all, "all", "", false,
|
||||||
|
"suspend all resources in that namespace")
|
||||||
rootCmd.AddCommand(suspendCmd)
|
rootCmd.AddCommand(suspendCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,14 +52,19 @@ type suspendable interface {
|
|||||||
|
|
||||||
type suspendCommand struct {
|
type suspendCommand struct {
|
||||||
apiType
|
apiType
|
||||||
|
list listSuspendable
|
||||||
object suspendable
|
object suspendable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type listSuspendable interface {
|
||||||
|
listAdapter
|
||||||
|
item(i int) suspendable
|
||||||
|
}
|
||||||
|
|
||||||
func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
|
func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
|
||||||
if len(args) < 1 {
|
if len(args) < 1 && !suspendArgs.all {
|
||||||
return fmt.Errorf("%s name is required", suspend.humanKind)
|
return fmt.Errorf("%s name is required", suspend.humanKind)
|
||||||
}
|
}
|
||||||
name := args[0]
|
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -61,21 +74,33 @@ func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
namespacedName := types.NamespacedName{
|
var listOpts []client.ListOption
|
||||||
Namespace: rootArgs.namespace,
|
listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
|
||||||
Name: name,
|
if len(args) > 0 {
|
||||||
|
listOpts = append(listOpts, client.MatchingFields{
|
||||||
|
"metadata.name": args[0],
|
||||||
|
})
|
||||||
}
|
}
|
||||||
err = kubeClient.Get(ctx, namespacedName, suspend.object.asClientObject())
|
|
||||||
|
err = kubeClient.List(ctx, suspend.list.asClientList(), listOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Actionf("suspending %s %s in %s namespace", suspend.humanKind, name, rootArgs.namespace)
|
if suspend.list.len() == 0 {
|
||||||
suspend.object.setSuspended()
|
logger.Failuref("no %s objects found in %s namespace", suspend.kind, rootArgs.namespace)
|
||||||
if err := kubeClient.Update(ctx, suspend.object.asClientObject()); err != nil {
|
return nil
|
||||||
return err
|
}
|
||||||
|
|
||||||
|
for i := 0; i < suspend.list.len(); i++ {
|
||||||
|
logger.Actionf("suspending %s %s in %s namespace", suspend.humanKind, suspend.list.item(i).asClientObject().GetName(), rootArgs.namespace)
|
||||||
|
suspend.list.item(i).setSuspended()
|
||||||
|
if err := kubeClient.Update(ctx, suspend.list.item(i).asClientObject()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("%s suspended", suspend.humanKind)
|
||||||
|
|
||||||
}
|
}
|
||||||
logger.Successf("%s suspended", suspend.humanKind)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var suspendAlertCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: alertType,
|
apiType: alertType,
|
||||||
object: &alertAdapter{¬ificationv1.Alert{}},
|
object: &alertAdapter{¬ificationv1.Alert{}},
|
||||||
|
list: &alertListAdapter{¬ificationv1.AlertList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj alertAdapter) isSuspended() bool {
|
|||||||
func (obj alertAdapter) setSuspended() {
|
func (obj alertAdapter) setSuspended() {
|
||||||
obj.Alert.Spec.Suspend = true
|
obj.Alert.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a alertListAdapter) item(i int) suspendable {
|
||||||
|
return &alertAdapter{&a.AlertList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ var suspendHrCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: helmReleaseType,
|
apiType: helmReleaseType,
|
||||||
object: &helmReleaseAdapter{&helmv2.HelmRelease{}},
|
object: &helmReleaseAdapter{&helmv2.HelmRelease{}},
|
||||||
|
list: &helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,3 +47,7 @@ func (obj helmReleaseAdapter) isSuspended() bool {
|
|||||||
func (obj helmReleaseAdapter) setSuspended() {
|
func (obj helmReleaseAdapter) setSuspended() {
|
||||||
obj.HelmRelease.Spec.Suspend = true
|
obj.HelmRelease.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a helmReleaseListAdapter) item(i int) suspendable {
|
||||||
|
return &helmReleaseAdapter{&a.HelmReleaseList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var suspendImageRepositoryCmd = &cobra.Command{
|
var suspendImageRepositoryCmd = &cobra.Command{
|
||||||
@@ -31,6 +31,7 @@ var suspendImageRepositoryCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: imageRepositoryType,
|
apiType: imageRepositoryType,
|
||||||
object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
|
object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
|
||||||
|
list: &imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj imageRepositoryAdapter) isSuspended() bool {
|
|||||||
func (obj imageRepositoryAdapter) setSuspended() {
|
func (obj imageRepositoryAdapter) setSuspended() {
|
||||||
obj.ImageRepository.Spec.Suspend = true
|
obj.ImageRepository.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a imageRepositoryListAdapter) item(i int) suspendable {
|
||||||
|
return &imageRepositoryAdapter{&a.ImageRepositoryList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
|
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var suspendImageUpdateCmd = &cobra.Command{
|
var suspendImageUpdateCmd = &cobra.Command{
|
||||||
@@ -31,6 +31,7 @@ var suspendImageUpdateCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: imageUpdateAutomationType,
|
apiType: imageUpdateAutomationType,
|
||||||
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
|
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
|
||||||
|
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (update imageUpdateAutomationAdapter) isSuspended() bool {
|
|||||||
func (update imageUpdateAutomationAdapter) setSuspended() {
|
func (update imageUpdateAutomationAdapter) setSuspended() {
|
||||||
update.ImageUpdateAutomation.Spec.Suspend = true
|
update.ImageUpdateAutomation.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a imageUpdateAutomationListAdapter) item(i int) suspendable {
|
||||||
|
return &imageUpdateAutomationAdapter{&a.ImageUpdateAutomationList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ var suspendKsCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: kustomizationType,
|
apiType: kustomizationType,
|
||||||
object: kustomizationAdapter{&kustomizev1.Kustomization{}},
|
object: kustomizationAdapter{&kustomizev1.Kustomization{}},
|
||||||
|
list: &kustomizationListAdapter{&kustomizev1.KustomizationList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,3 +47,7 @@ func (obj kustomizationAdapter) isSuspended() bool {
|
|||||||
func (obj kustomizationAdapter) setSuspended() {
|
func (obj kustomizationAdapter) setSuspended() {
|
||||||
obj.Kustomization.Spec.Suspend = true
|
obj.Kustomization.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a kustomizationListAdapter) item(i int) suspendable {
|
||||||
|
return &kustomizationAdapter{&a.KustomizationList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var suspendReceiverCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: receiverType,
|
apiType: receiverType,
|
||||||
object: &receiverAdapter{¬ificationv1.Receiver{}},
|
object: &receiverAdapter{¬ificationv1.Receiver{}},
|
||||||
|
list: &receiverListAdapter{¬ificationv1.ReceiverList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj receiverAdapter) isSuspended() bool {
|
|||||||
func (obj receiverAdapter) setSuspended() {
|
func (obj receiverAdapter) setSuspended() {
|
||||||
obj.Receiver.Spec.Suspend = true
|
obj.Receiver.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a receiverListAdapter) item(i int) suspendable {
|
||||||
|
return &receiverAdapter{&a.ReceiverList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var suspendSourceBucketCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: bucketType,
|
apiType: bucketType,
|
||||||
object: bucketAdapter{&sourcev1.Bucket{}},
|
object: bucketAdapter{&sourcev1.Bucket{}},
|
||||||
|
list: bucketListAdapter{&sourcev1.BucketList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj bucketAdapter) isSuspended() bool {
|
|||||||
func (obj bucketAdapter) setSuspended() {
|
func (obj bucketAdapter) setSuspended() {
|
||||||
obj.Bucket.Spec.Suspend = true
|
obj.Bucket.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a bucketListAdapter) item(i int) suspendable {
|
||||||
|
return &bucketAdapter{&a.BucketList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var suspendSourceHelmChartCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: helmChartType,
|
apiType: helmChartType,
|
||||||
object: helmChartAdapter{&sourcev1.HelmChart{}},
|
object: helmChartAdapter{&sourcev1.HelmChart{}},
|
||||||
|
list: helmChartListAdapter{&sourcev1.HelmChartList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj helmChartAdapter) isSuspended() bool {
|
|||||||
func (obj helmChartAdapter) setSuspended() {
|
func (obj helmChartAdapter) setSuspended() {
|
||||||
obj.HelmChart.Spec.Suspend = true
|
obj.HelmChart.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a helmChartListAdapter) item(i int) suspendable {
|
||||||
|
return &helmChartAdapter{&a.HelmChartList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var suspendSourceGitCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: gitRepositoryType,
|
apiType: gitRepositoryType,
|
||||||
object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
|
object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
|
||||||
|
list: gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj gitRepositoryAdapter) isSuspended() bool {
|
|||||||
func (obj gitRepositoryAdapter) setSuspended() {
|
func (obj gitRepositoryAdapter) setSuspended() {
|
||||||
obj.GitRepository.Spec.Suspend = true
|
obj.GitRepository.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a gitRepositoryListAdapter) item(i int) suspendable {
|
||||||
|
return &gitRepositoryAdapter{&a.GitRepositoryList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var suspendSourceHelmCmd = &cobra.Command{
|
|||||||
RunE: suspendCommand{
|
RunE: suspendCommand{
|
||||||
apiType: helmRepositoryType,
|
apiType: helmRepositoryType,
|
||||||
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
|
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
|
||||||
|
list: helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
|
||||||
}.run,
|
}.run,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ func (obj helmRepositoryAdapter) isSuspended() bool {
|
|||||||
func (obj helmRepositoryAdapter) setSuspended() {
|
func (obj helmRepositoryAdapter) setSuspended() {
|
||||||
obj.HelmRepository.Spec.Suspend = true
|
obj.HelmRepository.Spec.Suspend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a helmRepositoryListAdapter) item(i int) suspendable {
|
||||||
|
return &helmRepositoryAdapter{&a.HelmRepositoryList.Items[i]}
|
||||||
|
}
|
||||||
|
|||||||
17
docs/README.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Flux v2 Documentation
|
||||||
|
|
||||||
|
The documentation for `flux2` has moved to this repository: <https://github.com/fluxcd/website>.
|
||||||
|
|
||||||
|
[The Website's README](https://github.com/fluxcd/website/#readme) has information on how to
|
||||||
|
|
||||||
|
- modify and extend documentation
|
||||||
|
- run the site <https://fluxcd.io> locally
|
||||||
|
- publish changes
|
||||||
|
|
||||||
|
and where all the individual pieces of content come from.
|
||||||
|
|
||||||
|
It will be easier for us to maintain a coherent web presences (and merge all of Flux documentation) in one central repository. This was partly discussed in <https://github.com/fluxcd/flux2/discussions/367>.
|
||||||
|
|
||||||
|
## toolkit.fluxcd.io
|
||||||
|
|
||||||
|
For historical reasons we are keeping a `_redirects` file in this directory. It defines how redirects from the old site `toolkit.fluxcd.io` to our new website <https://fluxcd.io> work. Changes to this file need to be merged and a manual build triggered in the Netlify App.
|
||||||
|
Before Width: | Height: | Size: 232 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 146 KiB |
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<!-- Generator: Sketch 56.3 (81716) - https://sketch.com -->
|
|
||||||
<title>flux-icon</title>
|
|
||||||
<desc>Created with Sketch.</desc>
|
|
||||||
<g id="flux-icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="Group" transform="translate(11.000000, 2.000000)">
|
|
||||||
<path d="M0.803134615,15.7791346 C-0.246288462,15.0966346 -0.246288462,13.5602885 0.803134615,12.8783654 L20.1819808,0.279519231 C20.7554423,-0.0931730769 21.4944808,-0.0931730769 22.0679423,0.279519231 L41.4473654,12.8783654 C42.4967885,13.5602885 42.4967885,15.0966346 41.4473654,15.7791346 L22.0679423,28.3779808 C21.4944808,28.7506731 20.7554423,28.7506731 20.1819808,28.3779808 L0.803134615,15.7791346 Z" id="Fill-1" fill="#326CE5"></path>
|
|
||||||
<path d="M24.1851346,18.0023077 L25.5293654,18.0023077 C26.3145577,18.0023077 26.8055192,17.1525 26.4126346,16.4728846 L22.0084038,8.84423077 C21.6160962,8.16461538 20.63475,8.16461538 20.2418654,8.84423077 L15.8376346,16.4728846 C15.4453269,17.1525 15.9357115,18.0023077 16.7209038,18.0023077 L18.0657115,18.0023077 C18.6287885,18.0023077 19.0851346,18.4592308 19.0851346,19.0223077 L19.0851346,27.7298077 L19.9874423,28.3165385 C20.6791731,28.7665385 21.5710962,28.7665385 22.2628269,28.3165385 L23.1651346,27.7298077 L23.1651346,19.0223077 C23.1651346,18.4592308 23.6214808,18.0023077 24.1851346,18.0023077" id="Fill-3" fill="#C1D2F7"></path>
|
|
||||||
<path d="M27.8390769,34.8375577 L23.1648462,31.7989038 L23.1648462,33.2389038 C24.6902308,33.8919808 26.2588846,34.4008269 27.8390769,34.8375577" id="Fill-5" fill="#326CE5"></path>
|
|
||||||
<path d="M23.1650769,35.8280192 L23.1650769,37.8495577 C24.7095,38.3209038 26.2723846,38.7080192 27.8191154,39.0893654 C32.8706538,40.3349423 37.6418077,41.5107115 41.4783462,45.3478269 C41.6733462,45.54225 41.8562308,45.7407115 42.0373846,45.93975 C42.4308462,45.1880192 42.2335385,44.1957115 41.4466154,43.6845577 L33.8560385,38.7489808 C32.0133462,38.1409038 30.1360385,37.6759038 28.2806538,37.2189808 C26.5308462,36.7874423 24.8196923,36.3570577 23.1650769,35.8280192" id="Fill-7" fill="#326CE5"></path>
|
|
||||||
<path d="M19.08525,34.1699423 C18.4304423,33.8318654 17.7854423,33.4689808 17.1629423,33.0489808 L15.4269808,34.1774423 C16.5975577,35.0382115 17.8235192,35.7362885 19.08525,36.3212885 L19.08525,34.1699423 Z" id="Fill-9" fill="#326CE5"></path>
|
|
||||||
<path d="M24.8941731,40.6051154 C24.3137885,40.4620385 23.7374423,40.3195385 23.1651346,40.1735769 L23.1651346,42.1605 C23.5885962,42.2666538 24.0114808,42.3722308 24.4326346,42.4760769 C29.4841731,43.7210769 34.2553269,44.8968462 38.0924423,48.7339615 C38.0987885,48.7408846 38.1045577,48.7472308 38.1114808,48.7541538 L39.75225,47.6868462 C39.6524423,47.5824231 39.5584038,47.4751154 39.4545577,47.3718462 C35.2384038,43.1551154 29.9791731,41.8587692 24.8941731,40.6051154" id="Fill-11" fill="#326CE5"></path>
|
|
||||||
<path d="M19.08525,38.9907115 C16.8900577,38.2389808 14.8096731,37.2714808 12.9115962,35.8124423 L11.2119808,36.9178269 C13.6287115,38.9110962 16.3194808,40.1203269 19.08525,41.0168654 L19.08525,38.9907115 Z" id="Fill-13" fill="#326CE5"></path>
|
|
||||||
<path d="M19.08525,43.3809808 C15.3069808,42.3909808 11.7537115,41.18175 8.71794231,38.5388654 L7.04717308,39.6252115 C10.6125577,42.9102115 14.8540962,44.2832885 19.08525,45.3707885 L19.08525,43.3809808 Z" id="Fill-15" fill="#326CE5"></path>
|
|
||||||
<path d="M23.1650769,46.3935 C27.1175769,47.4140769 30.8341154,48.6342692 33.9823846,51.4381154 L35.6439231,50.3581154 C31.9654615,46.9000385 27.5514231,45.5194615 23.1650769,44.4048462 L23.1650769,46.3935 Z" id="Fill-17" fill="#326CE5"></path>
|
|
||||||
<path d="M4.57875,41.2299231 L2.92990385,42.3018462 C2.98759615,42.3612692 3.04009615,42.423 3.09951923,42.4818462 C7.31625,46.6985769 12.5743269,47.9949231 17.6599038,49.2485769 C22.0641346,50.3337692 26.2543269,51.3687692 29.7989423,54.1581923 L31.4893269,53.0591538 C27.4958654,49.6968462 22.7385577,48.5158846 18.1214423,47.3781923 C13.1206731,46.1453077 8.39567308,44.9758846 4.57875,41.2299231" id="Fill-19" fill="#326CE5"></path>
|
|
||||||
<path d="M1.07555769,44.5060962 C0.883442308,44.3139808 0.702865385,44.1184038 0.524019231,43.9216731 C-0.227711538,44.6745577 -0.139442308,45.9726346 0.80325,46.5853269 L6.50959615,50.2955192 C9.03536538,51.3409038 11.6765192,51.9945577 14.2738269,52.6349423 C18.3284423,53.6341731 22.2019038,54.5924423 25.5578654,56.9157115 L27.2834423,55.7930192 C23.4676731,52.9245577 19.0403654,51.8255192 14.7347885,50.7639808 C9.68382692,49.5189808 4.91267308,48.3432115 1.07555769,44.5060962" id="Fill-21" fill="#326CE5"></path>
|
|
||||||
<path d="M19.6441154,58.8342692 C20.0243077,59.0188846 20.3998846,59.2133077 20.7691154,59.4221538 C21.2093077,59.5150385 21.6771923,59.4383077 22.0683462,59.1838846 L23.0260385,58.5613846 C19.9493077,56.5035 16.5287308,55.461 13.1196923,54.5927308 L19.6441154,58.8342692 Z" id="Fill-23" fill="#326CE5"></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 56 KiB |
18
docs/_redirects
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# individual rules
|
||||||
|
/core-concepts https://fluxcd.io/docs/concepts 301!
|
||||||
|
/contributing https://fluxcd.io/contributing 301!
|
||||||
|
/install.sh https://fluxcd.io/install.sh 301!
|
||||||
|
|
||||||
|
# refer to https://github.com/fluxcd/flux2/discussions/367
|
||||||
|
/dev-guides/* https://fluxcd.io/docs/gitops-toolkit/:splat 301!
|
||||||
|
|
||||||
|
|
||||||
|
# this is how things looked in the navbar anyway..?
|
||||||
|
/guides/faq-migration https://fluxcd.io/docs/migration/faq-migration 301!
|
||||||
|
/guides/flux-v1-automation-migration https://fluxcd.io/docs/migration/flux-v1-automation-migration 301!
|
||||||
|
/guides/flux-v1-migration https://fluxcd.io/docs/migration/flux-v1-migration 301!
|
||||||
|
/guides/helm-operator-migration https://fluxcd.io/docs/migration/helm-operator-migration 301!
|
||||||
|
|
||||||
|
|
||||||
|
# catch all
|
||||||
|
/* https://fluxcd.io/docs/:splat 301!
|
||||||
122
docs/_static/custom.css
vendored
@@ -1,122 +0,0 @@
|
|||||||
@import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap");
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: "Montserrat", sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.md-logo {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-top: 2px;
|
|
||||||
}
|
|
||||||
.md-logo img {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.md-header, .md-footer-nav {
|
|
||||||
background-image: linear-gradient(45deg, rgb(0, 150, 225) 0%, rgb(27, 141, 226) 24%, rgb(42, 125, 227) 53%, rgb(53, 112, 227) 78%, rgb(53, 112, 227) 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.md-header-nav__title {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Custom admonitions */
|
|
||||||
/* See https://squidfunk.github.io/mkdocs-material/reference/admonitions */
|
|
||||||
:root {
|
|
||||||
--md-admonition-icon--heart: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 20.408c-.492.308-.903.546-1.192.709-.153.086-.308.17-.463.252h-.002a.75.75 0 0 1-.686 0 16.709 16.709 0 0 1-.465-.252 31.147 31.147 0 0 1-4.803-3.34C3.8 15.572 1 12.331 1 8.513 1 5.052 3.829 2.5 6.736 2.5 9.03 2.5 10.881 3.726 12 5.605 13.12 3.726 14.97 2.5 17.264 2.5 20.17 2.5 23 5.052 23 8.514c0 3.818-2.801 7.06-5.389 9.262A31.146 31.146 0 0 1 14 20.408z"/></svg>')
|
|
||||||
}
|
|
||||||
.md-typeset .admonition.heart,
|
|
||||||
.md-typeset details.heart {
|
|
||||||
border-color: rgb(233, 30, 99);
|
|
||||||
}
|
|
||||||
.md-typeset .heart > .admonition-title,
|
|
||||||
.md-typeset .heart > summary {
|
|
||||||
background-color: rgba(233, 30, 99, 0.1);
|
|
||||||
}
|
|
||||||
.md-typeset .heart > .admonition-title::before,
|
|
||||||
.md-typeset .heart > summary::before {
|
|
||||||
background-color: rgb(233, 30, 99);
|
|
||||||
-webkit-mask-image: var(--md-admonition-icon--heart);
|
|
||||||
mask-image: var(--md-admonition-icon--heart);
|
|
||||||
}
|
|
||||||
|
|
||||||
.timetable-explicit-col-widths th:nth-child(1) { width: 4%; }
|
|
||||||
.timetable-explicit-col-widths th:nth-child(2) { width: 32%; }
|
|
||||||
.timetable-explicit-col-widths th:nth-child(3) { width: 32%; }
|
|
||||||
.timetable-explicit-col-widths th:nth-child(4) { width: 32%; }
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux command"
|
|
||||||
---
|
|
||||||
## flux
|
|
||||||
|
|
||||||
Command line utility for assembling Kubernetes CD pipelines
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
|
|
||||||
Command line utility for assembling Kubernetes CD pipelines the GitOps way.
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
# Check prerequisites
|
|
||||||
flux check --pre
|
|
||||||
|
|
||||||
# Install the latest version of Flux
|
|
||||||
flux install --version=master
|
|
||||||
|
|
||||||
# Create a source for a public Git repository
|
|
||||||
flux create source git webapp-latest \
|
|
||||||
--url=https://github.com/stefanprodan/podinfo \
|
|
||||||
--branch=master \
|
|
||||||
--interval=3m
|
|
||||||
|
|
||||||
# List GitRepository sources and their status
|
|
||||||
flux get sources git
|
|
||||||
|
|
||||||
# Trigger a GitRepository source reconciliation
|
|
||||||
flux reconcile source git flux-system
|
|
||||||
|
|
||||||
# Export GitRepository sources in YAML format
|
|
||||||
flux export source git --all > sources.yaml
|
|
||||||
|
|
||||||
# Create a Kustomization for deploying a series of microservices
|
|
||||||
flux 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
|
|
||||||
flux reconcile kustomization webapp-dev --with-source
|
|
||||||
|
|
||||||
# Suspend a Kustomization reconciliation
|
|
||||||
flux suspend kustomization webapp-dev
|
|
||||||
|
|
||||||
# Export Kustomizations in YAML format
|
|
||||||
flux export kustomization --all > kustomizations.yaml
|
|
||||||
|
|
||||||
# Resume a Kustomization reconciliation
|
|
||||||
flux resume kustomization webapp-dev
|
|
||||||
|
|
||||||
# Delete a Kustomization
|
|
||||||
flux delete kustomization webapp-dev
|
|
||||||
|
|
||||||
# Delete a GitRepository source
|
|
||||||
flux delete source git webapp-latest
|
|
||||||
|
|
||||||
# Uninstall Flux and delete CRDs
|
|
||||||
flux uninstall
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
-h, --help help for flux
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components
|
|
||||||
* [flux check](../flux_check/) - Check requirements and installation
|
|
||||||
* [flux completion](../flux_completion/) - Generates completion scripts for various shells
|
|
||||||
* [flux create](../flux_create/) - Create or update sources and resources
|
|
||||||
* [flux delete](../flux_delete/) - Delete sources and resources
|
|
||||||
* [flux export](../flux_export/) - Export resources in YAML format
|
|
||||||
* [flux get](../flux_get/) - Get the resources and their status
|
|
||||||
* [flux install](../flux_install/) - Install or upgrade Flux
|
|
||||||
* [flux logs](../flux_logs/) - Display formatted logs for Flux components
|
|
||||||
* [flux reconcile](../flux_reconcile/) - Reconcile sources and resources
|
|
||||||
* [flux resume](../flux_resume/) - Resume suspended resources
|
|
||||||
* [flux suspend](../flux_suspend/) - Suspend resources
|
|
||||||
* [flux uninstall](../flux_uninstall/) - Uninstall Flux and its custom resource definitions
|
|
||||||
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux bootstrap command"
|
|
||||||
---
|
|
||||||
## flux bootstrap
|
|
||||||
|
|
||||||
Bootstrap toolkit components
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
The bootstrap sub-commands bootstrap the toolkit components on the targeted Git provider.
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
--author-email string author email for Git commits
|
|
||||||
--author-name string author name for Git commits (default "Flux")
|
|
||||||
--branch string Git branch (default "main")
|
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
|
||||||
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
|
|
||||||
-h, --help help for bootstrap
|
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
|
||||||
--log-level logLevel log level, available options are: (debug, info, error) (default info)
|
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
|
||||||
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
|
||||||
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
|
|
||||||
--ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa)
|
|
||||||
--ssh-rsa-bits rsaKeyBits SSH RSA public key bit size (multiplies of 8) (default 2048)
|
|
||||||
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
|
|
||||||
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
|
|
||||||
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
|
|
||||||
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines
|
|
||||||
* [flux bootstrap git](../flux_bootstrap_git/) - Bootstrap toolkit components in a Git repository
|
|
||||||
* [flux bootstrap github](../flux_bootstrap_github/) - Bootstrap toolkit components in a GitHub repository
|
|
||||||
* [flux bootstrap gitlab](../flux_bootstrap_gitlab/) - Bootstrap toolkit components in a GitLab repository
|
|
||||||
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux bootstrap git command"
|
|
||||||
---
|
|
||||||
## flux bootstrap git
|
|
||||||
|
|
||||||
Bootstrap toolkit components in a Git repository
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
The bootstrap git command commits the toolkit components manifests to the
|
|
||||||
branch of a Git repository. It then configures the target cluster to synchronize with
|
|
||||||
the repository. If the toolkit components are present on the cluster, the bootstrap
|
|
||||||
command will perform an upgrade if needed.
|
|
||||||
|
|
||||||
```
|
|
||||||
flux bootstrap git [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
# Run bootstrap for a Git repository and authenticate with your SSH agent
|
|
||||||
flux bootstrap git --url=ssh://git@example.com/repository.git
|
|
||||||
|
|
||||||
# Run bootstrap for a Git repository and authenticate using a password
|
|
||||||
flux bootstrap git --url=https://example.com/repository.git --password=<password>
|
|
||||||
|
|
||||||
# Run bootstrap for a Git repository with a passwordless private key
|
|
||||||
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key>
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for git
|
|
||||||
--interval duration sync interval (default 1m0s)
|
|
||||||
-p, --password string basic authentication password
|
|
||||||
--path safeRelativePath path relative to the repository root, when specified the cluster sync will be scoped to this path
|
|
||||||
--url string Git repository URL
|
|
||||||
-u, --username string basic authentication username (default "git")
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--author-email string author email for Git commits
|
|
||||||
--author-name string author name for Git commits (default "Flux")
|
|
||||||
--branch string Git branch (default "main")
|
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
|
||||||
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
--log-level logLevel log level, available options are: (debug, info, error) (default info)
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
|
||||||
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
|
||||||
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
|
|
||||||
--ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa)
|
|
||||||
--ssh-rsa-bits rsaKeyBits SSH RSA public key bit size (multiplies of 8) (default 2048)
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
|
|
||||||
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
|
|
||||||
--verbose print generated objects
|
|
||||||
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
|
|
||||||
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components
|
|
||||||
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux bootstrap github command"
|
|
||||||
---
|
|
||||||
## flux bootstrap github
|
|
||||||
|
|
||||||
Bootstrap toolkit components in a GitHub repository
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
The bootstrap github command creates the GitHub repository if it doesn't exists and
|
|
||||||
commits the toolkit components manifests to the main branch.
|
|
||||||
Then it configures the target cluster to synchronize with the repository.
|
|
||||||
If the toolkit components are present on the cluster,
|
|
||||||
the bootstrap command will perform an upgrade if needed.
|
|
||||||
|
|
||||||
```
|
|
||||||
flux bootstrap github [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
# Create a GitHub personal access token and export it as an env var
|
|
||||||
export GITHUB_TOKEN=<my-token>
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository owned by a GitHub organization
|
|
||||||
flux bootstrap github --owner=<organization> --repository=<repository name>
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository and assign organization teams to it
|
|
||||||
flux bootstrap github --owner=<organization> --repository=<repository name> --team=<team1 slug> --team=<team2 slug>
|
|
||||||
|
|
||||||
# Run bootstrap for a repository path
|
|
||||||
flux bootstrap github --owner=<organization> --repository=<repository name> --path=dev-cluster
|
|
||||||
|
|
||||||
# Run bootstrap for a public repository on a personal account
|
|
||||||
flux bootstrap github --owner=<user> --repository=<repository name> --private=false --personal=true
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository hosted on GitHub Enterprise using SSH auth
|
|
||||||
flux bootstrap github --owner=<organization> --repository=<repository name> --hostname=<domain> --ssh-hostname=<domain>
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository hosted on GitHub Enterprise using HTTPS auth
|
|
||||||
flux bootstrap github --owner=<organization> --repository=<repository name> --hostname=<domain> --token-auth
|
|
||||||
|
|
||||||
# Run bootstrap for an existing repository with a branch named main
|
|
||||||
flux bootstrap github --owner=<organization> --repository=<repository name> --branch=main
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for github
|
|
||||||
--hostname string GitHub hostname (default "github.com")
|
|
||||||
--interval duration sync interval (default 1m0s)
|
|
||||||
--owner string GitHub user or organization name
|
|
||||||
--path safeRelativePath path relative to the repository root, when specified the cluster sync will be scoped to this path
|
|
||||||
--personal if true, the owner is assumed to be a GitHub user; otherwise an org
|
|
||||||
--private if true, the repository is setup or configured as private (default true)
|
|
||||||
--read-write-key if true, the deploy key is configured with read/write permissions
|
|
||||||
--repository string GitHub repository name
|
|
||||||
--team stringArray GitHub team to be given maintainer access
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--author-email string author email for Git commits
|
|
||||||
--author-name string author name for Git commits (default "Flux")
|
|
||||||
--branch string Git branch (default "main")
|
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
|
||||||
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
--log-level logLevel log level, available options are: (debug, info, error) (default info)
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
|
||||||
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
|
||||||
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
|
|
||||||
--ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa)
|
|
||||||
--ssh-rsa-bits rsaKeyBits SSH RSA public key bit size (multiplies of 8) (default 2048)
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
|
|
||||||
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
|
|
||||||
--verbose print generated objects
|
|
||||||
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
|
|
||||||
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components
|
|
||||||
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux bootstrap gitlab command"
|
|
||||||
---
|
|
||||||
## flux bootstrap gitlab
|
|
||||||
|
|
||||||
Bootstrap toolkit components in a GitLab repository
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
The bootstrap gitlab command creates the GitLab repository if it doesn't exists and
|
|
||||||
commits the toolkit components manifests to the master branch.
|
|
||||||
Then it configures the target cluster to synchronize with the repository.
|
|
||||||
If the toolkit components are present on the cluster,
|
|
||||||
the bootstrap command will perform an upgrade if needed.
|
|
||||||
|
|
||||||
```
|
|
||||||
flux bootstrap gitlab [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
# Create a GitLab API token and export it as an env var
|
|
||||||
export GITLAB_TOKEN=<my-token>
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository using HTTPS token authentication
|
|
||||||
flux bootstrap gitlab --owner=<group> --repository=<repository name> --token-auth
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository using SSH authentication
|
|
||||||
flux bootstrap gitlab --owner=<group> --repository=<repository name>
|
|
||||||
|
|
||||||
# Run bootstrap for a repository path
|
|
||||||
flux bootstrap gitlab --owner=<group> --repository=<repository name> --path=dev-cluster
|
|
||||||
|
|
||||||
# Run bootstrap for a public repository on a personal account
|
|
||||||
flux bootstrap gitlab --owner=<user> --repository=<repository name> --private=false --personal --token-auth
|
|
||||||
|
|
||||||
# Run bootstrap for a private repository hosted on a GitLab server
|
|
||||||
flux bootstrap gitlab --owner=<group> --repository=<repository name> --hostname=<domain> --token-auth
|
|
||||||
|
|
||||||
# Run bootstrap for a an existing repository with a branch named main
|
|
||||||
flux bootstrap gitlab --owner=<organization> --repository=<repository name> --branch=main --token-auth
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for gitlab
|
|
||||||
--hostname string GitLab hostname (default "gitlab.com")
|
|
||||||
--interval duration sync interval (default 1m0s)
|
|
||||||
--owner string GitLab user or group name
|
|
||||||
--path safeRelativePath path relative to the repository root, when specified the cluster sync will be scoped to this path
|
|
||||||
--personal if true, the owner is assumed to be a GitLab user; otherwise a group
|
|
||||||
--private if true, the repository is setup or configured as private (default true)
|
|
||||||
--read-write-key if true, the deploy key is configured with read/write permissions
|
|
||||||
--repository string GitLab repository name
|
|
||||||
--team stringArray GitLab teams to be given maintainer access
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--author-email string author email for Git commits
|
|
||||||
--author-name string author name for Git commits (default "Flux")
|
|
||||||
--branch string Git branch (default "main")
|
|
||||||
--ca-file string path to TLS CA file used for validating self-signed certificates
|
|
||||||
--cluster-domain string internal cluster domain (default "cluster.local")
|
|
||||||
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
|
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
|
||||||
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
--log-level logLevel log level, available options are: (debug, info, error) (default info)
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
|
|
||||||
--private-key-file string path to a private key file used for authenticating to the Git SSH server
|
|
||||||
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
|
|
||||||
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
|
|
||||||
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
|
|
||||||
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
|
|
||||||
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
|
|
||||||
--ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa)
|
|
||||||
--ssh-rsa-bits rsaKeyBits SSH RSA public key bit size (multiplies of 8) (default 2048)
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
|
|
||||||
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
|
|
||||||
--verbose print generated objects
|
|
||||||
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
|
|
||||||
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components
|
|
||||||
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux check command"
|
|
||||||
---
|
|
||||||
## flux check
|
|
||||||
|
|
||||||
Check requirements and installation
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
```
|
|
||||||
flux check [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
# Run pre-installation checks
|
|
||||||
flux check --pre
|
|
||||||
|
|
||||||
# Run installation checks
|
|
||||||
flux check
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
|
|
||||||
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
|
|
||||||
-h, --help help for check
|
|
||||||
--pre only run pre-installation checks
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux completion command"
|
|
||||||
---
|
|
||||||
## flux completion
|
|
||||||
|
|
||||||
Generates completion scripts for various shells
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
The completion sub-command generates completion scripts for various shells
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for completion
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines
|
|
||||||
* [flux completion bash](../flux_completion_bash/) - Generates bash completion scripts
|
|
||||||
* [flux completion fish](../flux_completion_fish/) - Generates fish completion scripts
|
|
||||||
* [flux completion powershell](../flux_completion_powershell/) - Generates powershell completion scripts
|
|
||||||
* [flux completion zsh](../flux_completion_zsh/) - Generates zsh completion scripts
|
|
||||||
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux completion bash command"
|
|
||||||
---
|
|
||||||
## flux completion bash
|
|
||||||
|
|
||||||
Generates bash completion scripts
|
|
||||||
|
|
||||||
```
|
|
||||||
flux completion bash [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
To load completion run
|
|
||||||
|
|
||||||
. <(flux completion bash)
|
|
||||||
|
|
||||||
To configure your bash shell to load completions for each session add to your bashrc
|
|
||||||
|
|
||||||
# ~/.bashrc or ~/.profile
|
|
||||||
command -v flux >/dev/null && . <(flux completion bash)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for bash
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux completion](../flux_completion/) - Generates completion scripts for various shells
|
|
||||||
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux completion fish command"
|
|
||||||
---
|
|
||||||
## flux completion fish
|
|
||||||
|
|
||||||
Generates fish completion scripts
|
|
||||||
|
|
||||||
```
|
|
||||||
flux completion fish [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
To configure your fish shell to load completions for each session write this script to your completions dir:
|
|
||||||
|
|
||||||
flux completion fish > ~/.config/fish/completions/flux.fish
|
|
||||||
|
|
||||||
See http://fishshell.com/docs/current/index.html#completion-own for more details
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for fish
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux completion](../flux_completion/) - Generates completion scripts for various shells
|
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux completion powershell command"
|
|
||||||
---
|
|
||||||
## flux completion powershell
|
|
||||||
|
|
||||||
Generates powershell completion scripts
|
|
||||||
|
|
||||||
```
|
|
||||||
flux completion powershell [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
To load completion run
|
|
||||||
|
|
||||||
. <(flux completion powershell)
|
|
||||||
|
|
||||||
To configure your powershell shell to load completions for each session add to your powershell profile
|
|
||||||
|
|
||||||
Windows:
|
|
||||||
|
|
||||||
cd "$env:USERPROFILE\Documents\WindowsPowerShell\Modules"
|
|
||||||
flux completion >> flux-completion.ps1
|
|
||||||
|
|
||||||
Linux:
|
|
||||||
|
|
||||||
cd "${XDG_CONFIG_HOME:-"$HOME/.config/"}/powershell/modules"
|
|
||||||
flux completion >> flux-completions.ps1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for powershell
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux completion](../flux_completion/) - Generates completion scripts for various shells
|
|
||||||
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
---
|
|
||||||
title: "flux completion zsh command"
|
|
||||||
---
|
|
||||||
## flux completion zsh
|
|
||||||
|
|
||||||
Generates zsh completion scripts
|
|
||||||
|
|
||||||
```
|
|
||||||
flux completion zsh [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
To load completion run
|
|
||||||
|
|
||||||
. <(flux completion zsh) && compdef _flux flux
|
|
||||||
|
|
||||||
To configure your zsh shell to load completions for each session add to your zshrc
|
|
||||||
|
|
||||||
# ~/.zshrc or ~/.profile
|
|
||||||
command -v flux >/dev/null && . <(flux completion zsh) && compdef _flux flux
|
|
||||||
|
|
||||||
or write a cached file in one of the completion directories in your ${fpath}:
|
|
||||||
|
|
||||||
echo "${fpath// /\n}" | grep -i completion
|
|
||||||
flux completion zsh > _flux
|
|
||||||
|
|
||||||
mv _flux ~/.oh-my-zsh/completions # oh-my-zsh
|
|
||||||
mv _flux ~/.zprezto/modules/completion/external/src/ # zprezto
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for zsh
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--context string kubernetes context to use
|
|
||||||
--kubeconfig string absolute path to the kubeconfig file
|
|
||||||
-n, --namespace string the namespace scope for this operation (default "flux-system")
|
|
||||||
--timeout duration timeout for this operation (default 5m0s)
|
|
||||||
--verbose print generated objects
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [flux completion](../flux_completion/) - Generates completion scripts for various shells
|
|
||||||
|
|
||||||