Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d274a1115e | ||
|
|
bfae2899f3 | ||
|
|
5352a7e13a | ||
|
|
c49f9ef26a | ||
|
|
4a7376c5f5 | ||
|
|
567ce7f987 | ||
|
|
26bc0a8100 | ||
|
|
e7ff319685 | ||
|
|
072138deff | ||
|
|
dd8dc90c1e | ||
|
|
8f1da33375 | ||
|
|
c02fbc2794 | ||
|
|
371db07108 | ||
|
|
99f5dbf16b | ||
|
|
0db06c8962 | ||
|
|
a8e5876b2e | ||
|
|
8273851b73 | ||
|
|
c2967240bb | ||
|
|
282a6270c8 | ||
|
|
1b299fad90 | ||
|
|
aa8dced7ad | ||
|
|
050ba951b0 | ||
|
|
5e47c16099 | ||
|
|
902db4c732 | ||
|
|
86462fbee6 | ||
|
|
48bed79439 | ||
|
|
26b61c2b6b | ||
|
|
3b2253ddc0 |
@@ -109,8 +109,6 @@ Depending on what you want to do, some of the following bits might be your first
|
|||||||
|
|
||||||
### Upcoming Events
|
### Upcoming Events
|
||||||
|
|
||||||
- 2 Nov 2020 - [The Power of GitOps with Flux & GitOps Toolkit - Part 2 with Leigh Capili](https://www.meetup.com/GitOps-Community/events/273934676/)
|
- 30 Nov 2020 - [The Power of GitOps with Flux & GitOps Toolkit - Part 3 with Leigh Capili](https://www.meetup.com/Weave-User-Group/events/274657228/)
|
||||||
- 12-13 Nov 2020 - [GitOps Days EMEA](https://www.gitopsdays.com/) with talks and workshops on migrating to Flux v2 and Helm Controller
|
|
||||||
- 19 Nov 2020 - [KubeCon NA: Progressive Delivery Techniques with Flagger and Flux v2 with Stefan Prodan](https://kccncna20.sched.com/event/1b04f8408b49976b843a5d0019cb8112)
|
|
||||||
|
|
||||||
We are looking forward to seeing you with us!
|
We are looking forward to seeing you with us!
|
||||||
|
|||||||
6
action/Dockerfile
Normal file
6
action/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM stefanprodan/alpine-base:latest
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
25
action/README.md
Normal file
25
action/README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Flux GitHub Action
|
||||||
|
|
||||||
|
Example workflow:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: e2e
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
kubernetes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Flux CLI
|
||||||
|
uses: fluxcd/flux2/action@main
|
||||||
|
- name: Setup Kubernetes Kind
|
||||||
|
uses: engineerd/setup-kind@v0.5.0
|
||||||
|
- name: Install Flux in Kubernetes Kind
|
||||||
|
run: flux install
|
||||||
|
```
|
||||||
15
action/action.yml
Normal file
15
action/action.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
name: 'kustomize'
|
||||||
|
description: 'A GitHub Action for running Flux commands'
|
||||||
|
author: 'Flux project'
|
||||||
|
branding:
|
||||||
|
icon: 'command'
|
||||||
|
color: 'blue'
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'strict semver'
|
||||||
|
required: false
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
args:
|
||||||
|
- ${{ inputs.version }}
|
||||||
40
action/entrypoint.sh
Executable file
40
action/entrypoint.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2020 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.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
VERSION=$1
|
||||||
|
|
||||||
|
if [ -z $VERSION ]; then
|
||||||
|
# Find latest release if no version is specified
|
||||||
|
VERSION=$(curl https://api.github.com/repos/fluxcd/flux2/releases/latest -sL | grep tag_name | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 2-)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download linux binary
|
||||||
|
BIN_URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_amd64.tar.gz"
|
||||||
|
curl -sL $BIN_URL | tar xz
|
||||||
|
|
||||||
|
# Copy binary to GitHub runner
|
||||||
|
mkdir -p $GITHUB_WORKSPACE/bin
|
||||||
|
cp ./flux $GITHUB_WORKSPACE/bin
|
||||||
|
chmod +x $GITHUB_WORKSPACE/bin/flux
|
||||||
|
|
||||||
|
# Print version
|
||||||
|
$GITHUB_WORKSPACE/bin/flux -v
|
||||||
|
|
||||||
|
# Add binary to GitHub runner path
|
||||||
|
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
|
||||||
|
echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH
|
||||||
@@ -135,13 +135,13 @@ func generateInstallManifests(targetPath, namespace, tmpDir string, localManifes
|
|||||||
|
|
||||||
func applyInstallManifests(ctx context.Context, manifestPath string, components []string) error {
|
func applyInstallManifests(ctx context.Context, manifestPath string, components []string) error {
|
||||||
kubectlArgs := []string{"apply", "-f", manifestPath}
|
kubectlArgs := []string{"apply", "-f", manifestPath}
|
||||||
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubectlArgs...); err != nil {
|
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
return fmt.Errorf("install failed")
|
return fmt.Errorf("install failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, deployment := range components {
|
for _, deployment := range components {
|
||||||
kubectlArgs = []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
|
kubectlArgs = []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
|
||||||
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubectlArgs...); err != nil {
|
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
return fmt.Errorf("install failed")
|
return fmt.Errorf("install failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,7 +177,7 @@ func generateSyncManifests(url, branch, name, namespace, targetPath, tmpDir stri
|
|||||||
|
|
||||||
func applySyncManifests(ctx context.Context, kubeClient client.Client, name, namespace, targetPath, tmpDir string) error {
|
func applySyncManifests(ctx context.Context, kubeClient client.Client, name, namespace, targetPath, tmpDir string) error {
|
||||||
kubectlArgs := []string{"apply", "-k", filepath.Join(tmpDir, targetPath, namespace)}
|
kubectlArgs := []string{"apply", "-k", filepath.Join(tmpDir, targetPath, namespace)}
|
||||||
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeStderrOS, kubectlArgs...); err != nil {
|
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeStderrOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ func kubectlCheck(ctx context.Context, version string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kubectlArgs := []string{"version", "--client", "--output", "json"}
|
kubectlArgs := []string{"version", "--client", "--output", "json"}
|
||||||
output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubectlArgs...)
|
output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubeconfig, kubecontext, kubectlArgs...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Failuref("kubectl version can't be determined")
|
logger.Failuref("kubectl version can't be determined")
|
||||||
return false
|
return false
|
||||||
@@ -174,14 +174,14 @@ func componentsCheck() bool {
|
|||||||
ok := true
|
ok := true
|
||||||
for _, deployment := range checkComponents {
|
for _, deployment := range checkComponents {
|
||||||
kubectlArgs := []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
|
kubectlArgs := []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
|
||||||
if output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubectlArgs...); err != nil {
|
if output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
logger.Failuref("%s: %s", deployment, strings.TrimSuffix(output, "\n"))
|
logger.Failuref("%s: %s", deployment, strings.TrimSuffix(output, "\n"))
|
||||||
ok = false
|
ok = false
|
||||||
} else {
|
} else {
|
||||||
logger.Successf("%s is healthy", deployment)
|
logger.Successf("%s is healthy", deployment)
|
||||||
}
|
}
|
||||||
kubectlArgs = []string{"-n", namespace, "get", "deployment", deployment, "-o", "jsonpath=\"{..image}\""}
|
kubectlArgs = []string{"-n", namespace, "get", "deployment", deployment, "-o", "jsonpath=\"{..image}\""}
|
||||||
if output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubectlArgs...); err == nil {
|
if output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubeconfig, kubecontext, kubectlArgs...); err == nil {
|
||||||
logger.Actionf(strings.TrimPrefix(strings.TrimSuffix(output, "\""), "\""))
|
logger.Actionf(strings.TrimPrefix(strings.TrimSuffix(output, "\""), "\""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,14 @@ var createHelmReleaseCmd = &cobra.Command{
|
|||||||
--chart=podinfo \
|
--chart=podinfo \
|
||||||
--values=./my-values.yaml
|
--values=./my-values.yaml
|
||||||
|
|
||||||
|
# Create a HelmRelease with values from a Kubernetes secret
|
||||||
|
kubectl -n app create secret generic my-secret-values \
|
||||||
|
--from-file=values.yaml=/path/to/my-secret-values.yaml
|
||||||
|
flux -n app create hr podinfo \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
--values-from=Secret/my-secret-values
|
||||||
|
|
||||||
# Create a HelmRelease with a custom release name
|
# Create a HelmRelease with a custom release name
|
||||||
flux create hr podinfo \
|
flux create hr podinfo \
|
||||||
--release-name=podinfo-dev
|
--release-name=podinfo-dev
|
||||||
@@ -98,6 +106,7 @@ var (
|
|||||||
hrChartVersion string
|
hrChartVersion string
|
||||||
hrTargetNamespace string
|
hrTargetNamespace string
|
||||||
hrValuesFile string
|
hrValuesFile string
|
||||||
|
hrValuesFrom flags.HelmReleaseValuesFrom
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -108,6 +117,7 @@ func init() {
|
|||||||
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
|
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
|
||||||
|
createHelmReleaseCmd.Flags().Var(&hrValuesFrom, "values-from", hrValuesFrom.Description())
|
||||||
createCmd.AddCommand(createHelmReleaseCmd)
|
createCmd.AddCommand(createHelmReleaseCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,6 +181,13 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
helmRelease.Spec.Values = &apiextensionsv1.JSON{Raw: json}
|
helmRelease.Spec.Values = &apiextensionsv1.JSON{Raw: json}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hrValuesFrom.String() != "" {
|
||||||
|
helmRelease.Spec.ValuesFrom = []helmv2.ValuesReference{{
|
||||||
|
Kind: hrValuesFrom.Kind,
|
||||||
|
Name: hrValuesFrom.Name,
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
|
||||||
if export {
|
if export {
|
||||||
return exportHelmRelease(helmRelease)
|
return exportHelmRelease(helmRelease)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ var createTenantCmd = &cobra.Command{
|
|||||||
Use: "tenant",
|
Use: "tenant",
|
||||||
Short: "Create or update a tenant",
|
Short: "Create or update a tenant",
|
||||||
Long: `
|
Long: `
|
||||||
The create tenant command generates namespaces and role bindings to limit the
|
The create tenant command generates namespaces, service accounts and role bindings to limit the
|
||||||
reconcilers scope to the tenant namespaces.`,
|
reconcilers scope to the tenant namespaces.`,
|
||||||
Example: ` # Create a tenant with access to a namespace
|
Example: ` # Create a tenant with access to a namespace
|
||||||
flux create tenant dev-team \
|
flux create tenant dev-team \
|
||||||
@@ -65,7 +65,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createTenantCmd.Hidden = true
|
|
||||||
createTenantCmd.Flags().StringSliceVar(&tenantNamespaces, "with-namespace", nil, "namespace belonging to this tenant")
|
createTenantCmd.Flags().StringSliceVar(&tenantNamespaces, "with-namespace", nil, "namespace belonging to this tenant")
|
||||||
createTenantCmd.Flags().StringVar(&tenantClusterRole, "cluster-role", "cluster-admin", "cluster role of the tenant role binding")
|
createTenantCmd.Flags().StringVar(&tenantClusterRole, "cluster-role", "cluster-admin", "cluster role of the tenant role binding")
|
||||||
createCmd.AddCommand(createTenantCmd)
|
createCmd.AddCommand(createTenantCmd)
|
||||||
@@ -89,6 +88,7 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var namespaces []corev1.Namespace
|
var namespaces []corev1.Namespace
|
||||||
|
var accounts []corev1.ServiceAccount
|
||||||
var roleBindings []rbacv1.RoleBinding
|
var roleBindings []rbacv1.RoleBinding
|
||||||
|
|
||||||
for _, ns := range tenantNamespaces {
|
for _, ns := range tenantNamespaces {
|
||||||
@@ -111,6 +111,16 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
namespaces = append(namespaces, namespace)
|
namespaces = append(namespaces, namespace)
|
||||||
|
|
||||||
|
account := corev1.ServiceAccount{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: tenant,
|
||||||
|
Namespace: ns,
|
||||||
|
Labels: objLabels,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
accounts = append(accounts, account)
|
||||||
|
|
||||||
roleBinding := rbacv1.RoleBinding{
|
roleBinding := rbacv1.RoleBinding{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: tenantRoleBinding,
|
Name: tenantRoleBinding,
|
||||||
@@ -119,9 +129,12 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
},
|
},
|
||||||
Subjects: []rbacv1.Subject{
|
Subjects: []rbacv1.Subject{
|
||||||
{
|
{
|
||||||
APIGroup: "rbac.authorization.k8s.io",
|
Kind: "User",
|
||||||
Kind: "User",
|
Name: fmt.Sprintf("gotk:%s:reconciler", ns),
|
||||||
Name: fmt.Sprintf("gotk:%s:reconciler", ns),
|
},
|
||||||
|
{
|
||||||
|
Kind: "ServiceAccount",
|
||||||
|
Name: tenant,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RoleRef: rbacv1.RoleRef{
|
RoleRef: rbacv1.RoleRef{
|
||||||
@@ -135,7 +148,7 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
if export {
|
if export {
|
||||||
for i, _ := range tenantNamespaces {
|
for i, _ := range tenantNamespaces {
|
||||||
if err := exportTenant(namespaces[i], roleBindings[i]); err != nil {
|
if err := exportTenant(namespaces[i], accounts[i], roleBindings[i]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,6 +169,11 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Actionf("applying service account %s", accounts[i].Name)
|
||||||
|
if err := upsertServiceAccount(ctx, kubeClient, accounts[i]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
logger.Actionf("applying role binding %s", roleBindings[i].Name)
|
logger.Actionf("applying role binding %s", roleBindings[i].Name)
|
||||||
if err := upsertRoleBinding(ctx, kubeClient, roleBindings[i]); err != nil {
|
if err := upsertRoleBinding(ctx, kubeClient, roleBindings[i]); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -195,6 +213,35 @@ func upsertNamespace(ctx context.Context, kubeClient client.Client, namespace co
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func upsertServiceAccount(ctx context.Context, kubeClient client.Client, account corev1.ServiceAccount) error {
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: account.GetNamespace(),
|
||||||
|
Name: account.GetName(),
|
||||||
|
}
|
||||||
|
|
||||||
|
var existing corev1.ServiceAccount
|
||||||
|
err := kubeClient.Get(ctx, namespacedName, &existing)
|
||||||
|
if err != nil {
|
||||||
|
if errors.IsNotFound(err) {
|
||||||
|
if err := kubeClient.Create(ctx, &account); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if !equality.Semantic.DeepDerivative(account.Labels, existing.Labels) {
|
||||||
|
existing.Labels = account.Labels
|
||||||
|
if err := kubeClient.Update(ctx, &existing); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func upsertRoleBinding(ctx context.Context, kubeClient client.Client, roleBinding rbacv1.RoleBinding) error {
|
func upsertRoleBinding(ctx context.Context, kubeClient client.Client, roleBinding rbacv1.RoleBinding) error {
|
||||||
namespacedName := types.NamespacedName{
|
namespacedName := types.NamespacedName{
|
||||||
Namespace: roleBinding.GetNamespace(),
|
Namespace: roleBinding.GetNamespace(),
|
||||||
@@ -228,7 +275,7 @@ func upsertRoleBinding(ctx context.Context, kubeClient client.Client, roleBindin
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func exportTenant(namespace corev1.Namespace, roleBinding rbacv1.RoleBinding) error {
|
func exportTenant(namespace corev1.Namespace, account corev1.ServiceAccount, roleBinding rbacv1.RoleBinding) error {
|
||||||
namespace.TypeMeta = metav1.TypeMeta{
|
namespace.TypeMeta = metav1.TypeMeta{
|
||||||
APIVersion: "v1",
|
APIVersion: "v1",
|
||||||
Kind: "Namespace",
|
Kind: "Namespace",
|
||||||
@@ -242,6 +289,19 @@ func exportTenant(namespace corev1.Namespace, roleBinding rbacv1.RoleBinding) er
|
|||||||
data = bytes.Replace(data, []byte("spec: {}\n"), []byte(""), 1)
|
data = bytes.Replace(data, []byte("spec: {}\n"), []byte(""), 1)
|
||||||
fmt.Println(resourceToString(data))
|
fmt.Println(resourceToString(data))
|
||||||
|
|
||||||
|
account.TypeMeta = metav1.TypeMeta{
|
||||||
|
APIVersion: "",
|
||||||
|
Kind: "ServiceAccount",
|
||||||
|
}
|
||||||
|
data, err = yaml.Marshal(account)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("---")
|
||||||
|
data = bytes.Replace(data, []byte("spec: {}\n"), []byte(""), 1)
|
||||||
|
fmt.Println(resourceToString(data))
|
||||||
|
|
||||||
roleBinding.TypeMeta = metav1.TypeMeta{
|
roleBinding.TypeMeta = metav1.TypeMeta{
|
||||||
APIVersion: "rbac.authorization.k8s.io/v1",
|
APIVersion: "rbac.authorization.k8s.io/v1",
|
||||||
Kind: "RoleBinding",
|
Kind: "RoleBinding",
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func getAlertCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Suspended", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -80,18 +80,16 @@ func getAlertCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(alert.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(alert.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
alert.GetName(),
|
alert.GetName(),
|
||||||
//alert.Status.LastAppliedRevision,
|
|
||||||
strings.Title(strconv.FormatBool(alert.Spec.Suspend)),
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
strings.Title(strconv.FormatBool(alert.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
alert.GetName(),
|
alert.GetName(),
|
||||||
//alert.Status.LastAppliedRevision,
|
|
||||||
strings.Title(strconv.FormatBool(alert.Spec.Suspend)),
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
strings.Title(strconv.FormatBool(alert.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ func getHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Revision", "Suspended", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Revision", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -82,18 +82,18 @@ func getHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(helmRelease.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(helmRelease.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
helmRelease.GetName(),
|
helmRelease.GetName(),
|
||||||
helmRelease.Status.LastAppliedRevision,
|
|
||||||
strings.Title(strconv.FormatBool(helmRelease.Spec.Suspend)),
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
helmRelease.Status.LastAppliedRevision,
|
||||||
|
strings.Title(strconv.FormatBool(helmRelease.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
helmRelease.GetName(),
|
helmRelease.GetName(),
|
||||||
helmRelease.Status.LastAppliedRevision,
|
|
||||||
strings.Title(strconv.FormatBool(helmRelease.Spec.Suspend)),
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
helmRelease.Status.LastAppliedRevision,
|
||||||
|
strings.Title(strconv.FormatBool(helmRelease.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func getKsCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Revision", "Suspended", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Revision", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -81,18 +81,18 @@ func getKsCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(kustomization.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(kustomization.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
kustomization.GetName(),
|
kustomization.GetName(),
|
||||||
kustomization.Status.LastAppliedRevision,
|
|
||||||
strings.Title(strconv.FormatBool(kustomization.Spec.Suspend)),
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
kustomization.Status.LastAppliedRevision,
|
||||||
|
strings.Title(strconv.FormatBool(kustomization.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
kustomization.GetName(),
|
kustomization.GetName(),
|
||||||
kustomization.Status.LastAppliedRevision,
|
|
||||||
strings.Title(strconv.FormatBool(kustomization.Spec.Suspend)),
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
kustomization.Status.LastAppliedRevision,
|
||||||
|
strings.Title(strconv.FormatBool(kustomization.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func getReceiverCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Suspended", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -80,16 +80,16 @@ func getReceiverCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(receiver.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(receiver.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
receiver.GetName(),
|
receiver.GetName(),
|
||||||
strings.Title(strconv.FormatBool(receiver.Spec.Suspend)),
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
strings.Title(strconv.FormatBool(receiver.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
receiver.GetName(),
|
receiver.GetName(),
|
||||||
strings.Title(strconv.FormatBool(receiver.Spec.Suspend)),
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
strings.Title(strconv.FormatBool(receiver.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rows = append(rows, row)
|
rows = append(rows, row)
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/internal/utils"
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
@@ -36,6 +38,9 @@ var getSourceBucketCmd = &cobra.Command{
|
|||||||
Long: "The get sources bucket command prints the status of the Bucket sources.",
|
Long: "The get sources bucket command prints the status of the Bucket sources.",
|
||||||
Example: ` # List all Buckets and their status
|
Example: ` # List all Buckets and their status
|
||||||
flux get sources bucket
|
flux get sources bucket
|
||||||
|
|
||||||
|
# List buckets from all namespaces
|
||||||
|
flux get sources helm --all-namespaces
|
||||||
`,
|
`,
|
||||||
RunE: getSourceBucketCmdRun,
|
RunE: getSourceBucketCmdRun,
|
||||||
}
|
}
|
||||||
@@ -68,7 +73,7 @@ func getSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Revision", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Revision", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -82,16 +87,18 @@ func getSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
source.GetName(),
|
source.GetName(),
|
||||||
revision,
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
source.GetName(),
|
source.GetName(),
|
||||||
revision,
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
|
|||||||
111
cmd/flux/get_source_chart.go
Normal file
111
cmd/flux/get_source_chart.go
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
)
|
||||||
|
|
||||||
|
var getSourceHelmChartCmd = &cobra.Command{
|
||||||
|
Use: "chart",
|
||||||
|
Short: "Get HelmChart statuses",
|
||||||
|
Long: "The get sources chart command prints the status of the HelmCharts.",
|
||||||
|
Example: ` # List all Helm charts and their status
|
||||||
|
flux get sources chart
|
||||||
|
|
||||||
|
# List Helm charts from all namespaces
|
||||||
|
flux get sources chart --all-namespaces
|
||||||
|
`,
|
||||||
|
RunE: getSourceHelmChartCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
getSourceCmd.AddCommand(getSourceHelmChartCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getSourceHelmChartCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var listOpts []client.ListOption
|
||||||
|
if !allNamespaces {
|
||||||
|
listOpts = append(listOpts, client.InNamespace(namespace))
|
||||||
|
}
|
||||||
|
var list sourcev1.HelmChartList
|
||||||
|
err = kubeClient.List(ctx, &list, listOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(list.Items) == 0 {
|
||||||
|
logger.Failuref("no chart sources found in %s namespace", namespace)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
header := []string{"Name", "Ready", "Message", "Revision", "Suspended"}
|
||||||
|
if allNamespaces {
|
||||||
|
header = append([]string{"Namespace"}, header...)
|
||||||
|
}
|
||||||
|
var rows [][]string
|
||||||
|
for _, source := range list.Items {
|
||||||
|
var row []string
|
||||||
|
var revision string
|
||||||
|
if source.GetArtifact() != nil {
|
||||||
|
revision = source.GetArtifact().Revision
|
||||||
|
}
|
||||||
|
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
|
row = []string{
|
||||||
|
source.GetName(),
|
||||||
|
string(c.Status),
|
||||||
|
c.Message,
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
row = []string{
|
||||||
|
source.GetName(),
|
||||||
|
string(metav1.ConditionFalse),
|
||||||
|
"waiting to be reconciled",
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if allNamespaces {
|
||||||
|
row = append([]string{source.Namespace}, row...)
|
||||||
|
}
|
||||||
|
rows = append(rows, row)
|
||||||
|
}
|
||||||
|
utils.PrintTable(os.Stdout, header, rows)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -19,6 +19,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/internal/utils"
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
@@ -36,6 +38,9 @@ var getSourceGitCmd = &cobra.Command{
|
|||||||
Long: "The get sources git command prints the status of the GitRepository sources.",
|
Long: "The get sources git command prints the status of the GitRepository sources.",
|
||||||
Example: ` # List all Git repositories and their status
|
Example: ` # List all Git repositories and their status
|
||||||
flux get sources git
|
flux get sources git
|
||||||
|
|
||||||
|
# List Git repositories from all namespaces
|
||||||
|
flux get sources git --all-namespaces
|
||||||
`,
|
`,
|
||||||
RunE: getSourceGitCmdRun,
|
RunE: getSourceGitCmdRun,
|
||||||
}
|
}
|
||||||
@@ -68,7 +73,7 @@ func getSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Revision", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Revision", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -82,16 +87,18 @@ func getSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
source.GetName(),
|
source.GetName(),
|
||||||
revision,
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
source.GetName(),
|
source.GetName(),
|
||||||
revision,
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/internal/utils"
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
"github.com/fluxcd/pkg/apis/meta"
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
@@ -36,6 +38,9 @@ var getSourceHelmCmd = &cobra.Command{
|
|||||||
Long: "The get sources helm command prints the status of the HelmRepository sources.",
|
Long: "The get sources helm command prints the status of the HelmRepository sources.",
|
||||||
Example: ` # List all Helm repositories and their status
|
Example: ` # List all Helm repositories and their status
|
||||||
flux get sources helm
|
flux get sources helm
|
||||||
|
|
||||||
|
# List Helm repositories from all namespaces
|
||||||
|
flux get sources helm --all-namespaces
|
||||||
`,
|
`,
|
||||||
RunE: getSourceHelmCmdRun,
|
RunE: getSourceHelmCmdRun,
|
||||||
}
|
}
|
||||||
@@ -68,7 +73,7 @@ func getSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
header := []string{"Name", "Revision", "Ready", "Message"}
|
header := []string{"Name", "Ready", "Message", "Revision", "Suspended"}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
header = append([]string{"Namespace"}, header...)
|
header = append([]string{"Namespace"}, header...)
|
||||||
}
|
}
|
||||||
@@ -82,16 +87,18 @@ func getSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
if c := apimeta.FindStatusCondition(source.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
row = []string{
|
row = []string{
|
||||||
source.GetName(),
|
source.GetName(),
|
||||||
revision,
|
|
||||||
string(c.Status),
|
string(c.Status),
|
||||||
c.Message,
|
c.Message,
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
row = []string{
|
row = []string{
|
||||||
source.GetName(),
|
source.GetName(),
|
||||||
revision,
|
|
||||||
string(metav1.ConditionFalse),
|
string(metav1.ConditionFalse),
|
||||||
"waiting to be reconciled",
|
"waiting to be reconciled",
|
||||||
|
revision,
|
||||||
|
strings.Title(strconv.FormatBool(source.Spec.Suspend)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allNamespaces {
|
if allNamespaces {
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
kubectlArgs = append(kubectlArgs, "--dry-run=client")
|
kubectlArgs = append(kubectlArgs, "--dry-run=client")
|
||||||
applyOutput = utils.ModeOS
|
applyOutput = utils.ModeOS
|
||||||
}
|
}
|
||||||
if _, err := utils.ExecKubectlCommand(ctx, applyOutput, kubectlArgs...); err != nil {
|
if _, err := utils.ExecKubectlCommand(ctx, applyOutput, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
return fmt.Errorf("install failed")
|
return fmt.Errorf("install failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
logger.Waitingf("verifying installation")
|
logger.Waitingf("verifying installation")
|
||||||
for _, deployment := range installComponents {
|
for _, deployment := range installComponents {
|
||||||
kubectlArgs = []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
|
kubectlArgs = []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
|
||||||
if _, err := utils.ExecKubectlCommand(ctx, applyOutput, kubectlArgs...); err != nil {
|
if _, err := utils.ExecKubectlCommand(ctx, applyOutput, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
return fmt.Errorf("install failed")
|
return fmt.Errorf("install failed")
|
||||||
} else {
|
} else {
|
||||||
logger.Successf("%s ready", deployment)
|
logger.Successf("%s ready", deployment)
|
||||||
|
|||||||
@@ -109,9 +109,6 @@ func isHelmReleaseResumed(ctx context.Context, kubeClient client.Client,
|
|||||||
case metav1.ConditionTrue:
|
case metav1.ConditionTrue:
|
||||||
return true, nil
|
return true, nil
|
||||||
case metav1.ConditionFalse:
|
case metav1.ConditionFalse:
|
||||||
if c.Reason == meta.SuspendedReason {
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
return false, fmt.Errorf(c.Message)
|
return false, fmt.Errorf(c.Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,9 +108,6 @@ func isKustomizationResumed(ctx context.Context, kubeClient client.Client,
|
|||||||
case metav1.ConditionTrue:
|
case metav1.ConditionTrue:
|
||||||
return true, nil
|
return true, nil
|
||||||
case metav1.ConditionFalse:
|
case metav1.ConditionFalse:
|
||||||
if c.Reason == meta.SuspendedReason {
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
return false, fmt.Errorf(c.Message)
|
return false, fmt.Errorf(c.Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
31
cmd/flux/resume_source.go
Normal file
31
cmd/flux/resume_source.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var resumeSourceCmd = &cobra.Command{
|
||||||
|
Use: "source",
|
||||||
|
Short: "Resume sources",
|
||||||
|
Long: "The resume sub-commands resume a suspended source.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
resumeCmd.AddCommand(resumeSourceCmd)
|
||||||
|
}
|
||||||
115
cmd/flux/resume_source_bucket.go
Normal file
115
cmd/flux/resume_source_bucket.go
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var resumeSourceBucketCmd = &cobra.Command{
|
||||||
|
Use: "bucket [name]",
|
||||||
|
Short: "Resume a suspended Bucket",
|
||||||
|
Long: `The resume command marks a previously suspended Bucket resource for reconciliation and waits for it to finish.`,
|
||||||
|
Example: ` # Resume reconciliation for an existing Bucket
|
||||||
|
flux resume source bucket podinfo
|
||||||
|
`,
|
||||||
|
RunE: resumeSourceBucketCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
resumeSourceCmd.AddCommand(resumeSourceBucketCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func resumeSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var bucket sourcev1.Bucket
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &bucket)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("resuming source %s in %s namespace", name, namespace)
|
||||||
|
bucket.Spec.Suspend = false
|
||||||
|
if err := kubeClient.Update(ctx, &bucket); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source resumed")
|
||||||
|
|
||||||
|
logger.Waitingf("waiting for Bucket reconciliation")
|
||||||
|
if err := wait.PollImmediate(pollInterval, timeout,
|
||||||
|
isBucketResumed(ctx, kubeClient, namespacedName, &bucket)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("Bucket reconciliation completed")
|
||||||
|
|
||||||
|
logger.Successf("fetched revision %s", bucket.Status.Artifact.Revision)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func isBucketResumed(ctx context.Context, kubeClient client.Client,
|
||||||
|
namespacedName types.NamespacedName, bucket *sourcev1.Bucket) wait.ConditionFunc {
|
||||||
|
return func() (bool, error) {
|
||||||
|
err := kubeClient.Get(ctx, namespacedName, bucket)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Confirm the state we are observing is for the current generation
|
||||||
|
if bucket.Generation != bucket.Status.ObservedGeneration {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if c := apimeta.FindStatusCondition(bucket.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
|
switch c.Status {
|
||||||
|
case metav1.ConditionTrue:
|
||||||
|
return true, nil
|
||||||
|
case metav1.ConditionFalse:
|
||||||
|
return false, fmt.Errorf(c.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
115
cmd/flux/resume_source_chart.go
Normal file
115
cmd/flux/resume_source_chart.go
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var resumeSourceHelmChartCmd = &cobra.Command{
|
||||||
|
Use: "chart [name]",
|
||||||
|
Short: "Resume a suspended HelmChart",
|
||||||
|
Long: `The resume command marks a previously suspended HelmChart resource for reconciliation and waits for it to finish.`,
|
||||||
|
Example: ` # Resume reconciliation for an existing HelmChart
|
||||||
|
flux resume source chart podinfo
|
||||||
|
`,
|
||||||
|
RunE: resumeSourceHelmChartCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
resumeSourceCmd.AddCommand(resumeSourceHelmChartCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func resumeSourceHelmChartCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var repository sourcev1.HelmChart
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &repository)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("resuming source %s in %s namespace", name, namespace)
|
||||||
|
repository.Spec.Suspend = false
|
||||||
|
if err := kubeClient.Update(ctx, &repository); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source resumed")
|
||||||
|
|
||||||
|
logger.Waitingf("waiting for HelmChart reconciliation")
|
||||||
|
if err := wait.PollImmediate(pollInterval, timeout,
|
||||||
|
isHelmChartResumed(ctx, kubeClient, namespacedName, &repository)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("HelmChart reconciliation completed")
|
||||||
|
|
||||||
|
logger.Successf("fetched revision %s", repository.Status.Artifact.Revision)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func isHelmChartResumed(ctx context.Context, kubeClient client.Client,
|
||||||
|
namespacedName types.NamespacedName, chart *sourcev1.HelmChart) wait.ConditionFunc {
|
||||||
|
return func() (bool, error) {
|
||||||
|
err := kubeClient.Get(ctx, namespacedName, chart)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Confirm the state we are observing is for the current generation
|
||||||
|
if chart.Generation != chart.Status.ObservedGeneration {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if c := apimeta.FindStatusCondition(chart.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
|
switch c.Status {
|
||||||
|
case metav1.ConditionTrue:
|
||||||
|
return true, nil
|
||||||
|
case metav1.ConditionFalse:
|
||||||
|
return false, fmt.Errorf(c.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
115
cmd/flux/resume_source_git.go
Normal file
115
cmd/flux/resume_source_git.go
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var resumeSourceGitCmd = &cobra.Command{
|
||||||
|
Use: "git [name]",
|
||||||
|
Short: "Resume a suspended GitRepository",
|
||||||
|
Long: `The resume command marks a previously suspended GitRepository resource for reconciliation and waits for it to finish.`,
|
||||||
|
Example: ` # Resume reconciliation for an existing GitRepository
|
||||||
|
flux resume source git podinfo
|
||||||
|
`,
|
||||||
|
RunE: resumeSourceGitCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
resumeSourceCmd.AddCommand(resumeSourceGitCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func resumeSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var repository sourcev1.GitRepository
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &repository)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("resuming source %s in %s namespace", name, namespace)
|
||||||
|
repository.Spec.Suspend = false
|
||||||
|
if err := kubeClient.Update(ctx, &repository); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source resumed")
|
||||||
|
|
||||||
|
logger.Waitingf("waiting for GitRepository reconciliation")
|
||||||
|
if err := wait.PollImmediate(pollInterval, timeout,
|
||||||
|
isGitRepositoryResumed(ctx, kubeClient, namespacedName, &repository)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("GitRepository reconciliation completed")
|
||||||
|
|
||||||
|
logger.Successf("fetched revision %s", repository.Status.Artifact.Revision)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func isGitRepositoryResumed(ctx context.Context, kubeClient client.Client,
|
||||||
|
namespacedName types.NamespacedName, repository *sourcev1.GitRepository) wait.ConditionFunc {
|
||||||
|
return func() (bool, error) {
|
||||||
|
err := kubeClient.Get(ctx, namespacedName, repository)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Confirm the state we are observing is for the current generation
|
||||||
|
if repository.Generation != repository.Status.ObservedGeneration {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if c := apimeta.FindStatusCondition(repository.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
|
switch c.Status {
|
||||||
|
case metav1.ConditionTrue:
|
||||||
|
return true, nil
|
||||||
|
case metav1.ConditionFalse:
|
||||||
|
return false, fmt.Errorf(c.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
115
cmd/flux/resume_source_helm.go
Normal file
115
cmd/flux/resume_source_helm.go
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var resumeSourceHelmCmd = &cobra.Command{
|
||||||
|
Use: "helm [name]",
|
||||||
|
Short: "Resume a suspended HelmRepository",
|
||||||
|
Long: `The resume command marks a previously suspended HelmRepository resource for reconciliation and waits for it to finish.`,
|
||||||
|
Example: ` # Resume reconciliation for an existing HelmRepository
|
||||||
|
flux resume source helm bitnami
|
||||||
|
`,
|
||||||
|
RunE: resumeSourceHelmCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
resumeSourceCmd.AddCommand(resumeSourceHelmCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func resumeSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var repository sourcev1.HelmRepository
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &repository)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("resuming source %s in %s namespace", name, namespace)
|
||||||
|
repository.Spec.Suspend = false
|
||||||
|
if err := kubeClient.Update(ctx, &repository); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source resumed")
|
||||||
|
|
||||||
|
logger.Waitingf("waiting for HelmRepository reconciliation")
|
||||||
|
if err := wait.PollImmediate(pollInterval, timeout,
|
||||||
|
isHelmRepositoryResumed(ctx, kubeClient, namespacedName, &repository)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("HelmRepository reconciliation completed")
|
||||||
|
|
||||||
|
logger.Successf("fetched revision %s", repository.Status.Artifact.Revision)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func isHelmRepositoryResumed(ctx context.Context, kubeClient client.Client,
|
||||||
|
namespacedName types.NamespacedName, repository *sourcev1.HelmRepository) wait.ConditionFunc {
|
||||||
|
return func() (bool, error) {
|
||||||
|
err := kubeClient.Get(ctx, namespacedName, repository)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Confirm the state we are observing is for the current generation
|
||||||
|
if repository.Generation != repository.Status.ObservedGeneration {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if c := apimeta.FindStatusCondition(repository.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||||
|
switch c.Status {
|
||||||
|
case metav1.ConditionTrue:
|
||||||
|
return true, nil
|
||||||
|
case metav1.ConditionFalse:
|
||||||
|
return false, fmt.Errorf(c.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
31
cmd/flux/suspend_source.go
Normal file
31
cmd/flux/suspend_source.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var suspendSourceCmd = &cobra.Command{
|
||||||
|
Use: "source",
|
||||||
|
Short: "Suspend sources",
|
||||||
|
Long: "The suspend sub-commands suspend the reconciliation of a source.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
suspendCmd.AddCommand(suspendSourceCmd)
|
||||||
|
}
|
||||||
75
cmd/flux/suspend_source_bucket.go
Normal file
75
cmd/flux/suspend_source_bucket.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var suspendSourceBucketCmd = &cobra.Command{
|
||||||
|
Use: "bucket [name]",
|
||||||
|
Short: "Suspend reconciliation of a Bucket",
|
||||||
|
Long: "The suspend command disables the reconciliation of a Bucket resource.",
|
||||||
|
Example: ` # Suspend reconciliation for an existing Bucket
|
||||||
|
flux suspend source bucket podinfo
|
||||||
|
`,
|
||||||
|
RunE: suspendSourceBucketCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
suspendSourceCmd.AddCommand(suspendSourceBucketCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func suspendSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var bucket sourcev1.Bucket
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &bucket)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("suspending source %s in %s namespace", name, namespace)
|
||||||
|
bucket.Spec.Suspend = true
|
||||||
|
if err := kubeClient.Update(ctx, &bucket); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source suspended")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
75
cmd/flux/suspend_source_chart.go
Normal file
75
cmd/flux/suspend_source_chart.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var suspendSourceHelmChartCmd = &cobra.Command{
|
||||||
|
Use: "chart [name]",
|
||||||
|
Short: "Suspend reconciliation of a HelmChart",
|
||||||
|
Long: "The suspend command disables the reconciliation of a HelmChart resource.",
|
||||||
|
Example: ` # Suspend reconciliation for an existing HelmChart
|
||||||
|
flux suspend source chart podinfo
|
||||||
|
`,
|
||||||
|
RunE: suspendSourceHelmChartCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
suspendSourceCmd.AddCommand(suspendSourceHelmChartCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func suspendSourceHelmChartCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var chart sourcev1.HelmChart
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &chart)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("suspending source %s in %s namespace", name, namespace)
|
||||||
|
chart.Spec.Suspend = true
|
||||||
|
if err := kubeClient.Update(ctx, &chart); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source suspended")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
75
cmd/flux/suspend_source_git.go
Normal file
75
cmd/flux/suspend_source_git.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var suspendSourceGitCmd = &cobra.Command{
|
||||||
|
Use: "git [name]",
|
||||||
|
Short: "Suspend reconciliation of a GitRepository",
|
||||||
|
Long: "The suspend command disables the reconciliation of a GitRepository resource.",
|
||||||
|
Example: ` # Suspend reconciliation for an existing GitRepository
|
||||||
|
flux suspend source git podinfo
|
||||||
|
`,
|
||||||
|
RunE: suspendSourceGitCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
suspendSourceCmd.AddCommand(suspendSourceGitCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func suspendSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var repository sourcev1.GitRepository
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &repository)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("suspending source %s in %s namespace", name, namespace)
|
||||||
|
repository.Spec.Suspend = true
|
||||||
|
if err := kubeClient.Update(ctx, &repository); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source suspended")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
75
cmd/flux/suspend_source_helm.go
Normal file
75
cmd/flux/suspend_source_helm.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var suspendSourceHelmCmd = &cobra.Command{
|
||||||
|
Use: "helm [name]",
|
||||||
|
Short: "Suspend reconciliation of a HelmRepository",
|
||||||
|
Long: "The suspend command disables the reconciliation of a HelmRepository resource.",
|
||||||
|
Example: ` # Suspend reconciliation for an existing HelmRepository
|
||||||
|
flux suspend source helm bitnami
|
||||||
|
`,
|
||||||
|
RunE: suspendSourceHelmCmdRun,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
suspendSourceCmd.AddCommand(suspendSourceHelmCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func suspendSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) < 1 {
|
||||||
|
return fmt.Errorf("source name is required")
|
||||||
|
}
|
||||||
|
name := args[0]
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
namespacedName := types.NamespacedName{
|
||||||
|
Namespace: namespace,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
var repository sourcev1.HelmRepository
|
||||||
|
err = kubeClient.Get(ctx, namespacedName, &repository)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Actionf("suspending source %s in %s namespace", name, namespace)
|
||||||
|
repository.Spec.Suspend = true
|
||||||
|
if err := kubeClient.Update(ctx, &repository); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Successf("source suspended")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -144,7 +144,7 @@ func uninstallCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
if uninstallDryRun {
|
if uninstallDryRun {
|
||||||
kubectlArgs = append(kubectlArgs, dryRun)
|
kubectlArgs = append(kubectlArgs, dryRun)
|
||||||
}
|
}
|
||||||
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubectlArgs...); err != nil {
|
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
|
||||||
return fmt.Errorf("uninstall failed: %w", err)
|
return fmt.Errorf("uninstall failed: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,6 +164,6 @@ func deleteAll(ctx context.Context, kind string, dryRun bool) error {
|
|||||||
kubectlArgs = append(kubectlArgs, "--dry-run=server")
|
kubectlArgs = append(kubectlArgs, "--dry-run=server")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubectlArgs...)
|
_, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,4 +34,5 @@ The create sub-commands generate sources and resources.
|
|||||||
* [flux create kustomization](flux_create_kustomization.md) - Create or update a Kustomization resource
|
* [flux create kustomization](flux_create_kustomization.md) - Create or update a Kustomization resource
|
||||||
* [flux create receiver](flux_create_receiver.md) - Create or update a Receiver resource
|
* [flux create receiver](flux_create_receiver.md) - Create or update a Receiver resource
|
||||||
* [flux create source](flux_create_source.md) - Create or update sources
|
* [flux create source](flux_create_source.md) - Create or update sources
|
||||||
|
* [flux create tenant](flux_create_tenant.md) - Create or update a tenant
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,14 @@ flux create helmrelease [name] [flags]
|
|||||||
--chart=podinfo \
|
--chart=podinfo \
|
||||||
--values=./my-values.yaml
|
--values=./my-values.yaml
|
||||||
|
|
||||||
|
# Create a HelmRelease with values from a Kubernetes secret
|
||||||
|
kubectl -n app create secret generic my-secret-values \
|
||||||
|
--from-file=values.yaml=/path/to/my-secret-values.yaml
|
||||||
|
flux -n app create hr podinfo \
|
||||||
|
--source=HelmRepository/podinfo \
|
||||||
|
--chart=podinfo \
|
||||||
|
--values-from=Secret/my-secret-values
|
||||||
|
|
||||||
# Create a HelmRelease with a custom release name
|
# Create a HelmRelease with a custom release name
|
||||||
flux create hr podinfo \
|
flux create hr podinfo \
|
||||||
--release-name=podinfo-dev
|
--release-name=podinfo-dev
|
||||||
@@ -62,14 +70,15 @@ flux create helmrelease [name] [flags]
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
--chart string Helm chart name or path
|
--chart string Helm chart name or path
|
||||||
--chart-version string Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)
|
--chart-version string Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)
|
||||||
--depends-on stringArray HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'
|
--depends-on stringArray HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'
|
||||||
-h, --help help for helmrelease
|
-h, --help help for helmrelease
|
||||||
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'
|
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'
|
||||||
--source helmChartSource source that contains the chart in the format '<kind>/<name>',where kind can be one of: (HelmRepository, GitRepository, Bucket)
|
--source helmChartSource source that contains the chart in the format '<kind>/<name>',where kind can be one of: (HelmRepository, GitRepository, Bucket)
|
||||||
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
|
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
|
||||||
--values string local path to the values.yaml file
|
--values string local path to the values.yaml file
|
||||||
|
--values-from helmReleaseValuesFrom Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>',where kind can be one of: (Secret, ConfigMap)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
|
|||||||
55
docs/cmd/flux_create_tenant.md
Normal file
55
docs/cmd/flux_create_tenant.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
## flux create tenant
|
||||||
|
|
||||||
|
Create or update a tenant
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
|
||||||
|
The create tenant command generates namespaces, service accounts and role bindings to limit the
|
||||||
|
reconcilers scope to the tenant namespaces.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux create tenant [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Create a tenant with access to a namespace
|
||||||
|
flux create tenant dev-team \
|
||||||
|
--with-namespace=frontend \
|
||||||
|
--label=environment=dev
|
||||||
|
|
||||||
|
# Generate tenant namespaces and role bindings in YAML format
|
||||||
|
flux create tenant dev-team \
|
||||||
|
--with-namespace=frontend \
|
||||||
|
--with-namespace=backend \
|
||||||
|
--export > dev-team.yaml
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
--cluster-role string cluster role of the tenant role binding (default "cluster-admin")
|
||||||
|
-h, --help help for tenant
|
||||||
|
--with-namespace strings namespace belonging to this tenant
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--export export in YAML format to stdout
|
||||||
|
--interval duration source sync interval (default 1m0s)
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
|
||||||
|
-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 create](flux_create.md) - Create or update sources and resources
|
||||||
|
|
||||||
@@ -27,6 +27,7 @@ The get source sub-commands print the statuses of the sources.
|
|||||||
|
|
||||||
* [flux get](flux_get.md) - Get sources and resources
|
* [flux get](flux_get.md) - Get sources and resources
|
||||||
* [flux get sources bucket](flux_get_sources_bucket.md) - Get Bucket source statuses
|
* [flux get sources bucket](flux_get_sources_bucket.md) - Get Bucket source statuses
|
||||||
|
* [flux get sources chart](flux_get_sources_chart.md) - Get HelmChart statuses
|
||||||
* [flux get sources git](flux_get_sources_git.md) - Get GitRepository source statuses
|
* [flux get sources git](flux_get_sources_git.md) - Get GitRepository source statuses
|
||||||
* [flux get sources helm](flux_get_sources_helm.md) - Get HelmRepository source statuses
|
* [flux get sources helm](flux_get_sources_helm.md) - Get HelmRepository source statuses
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ flux get sources bucket [flags]
|
|||||||
# List all Buckets and their status
|
# List all Buckets and their status
|
||||||
flux get sources bucket
|
flux get sources bucket
|
||||||
|
|
||||||
|
# List buckets from all namespaces
|
||||||
|
flux get sources helm --all-namespaces
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|||||||
44
docs/cmd/flux_get_sources_chart.md
Normal file
44
docs/cmd/flux_get_sources_chart.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
## flux get sources chart
|
||||||
|
|
||||||
|
Get HelmChart statuses
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The get sources chart command prints the status of the HelmCharts.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux get sources chart [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# List all Helm charts and their status
|
||||||
|
flux get sources chart
|
||||||
|
|
||||||
|
# List Helm charts from all namespaces
|
||||||
|
flux get sources chart --all-namespaces
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for chart
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
-A, --all-namespaces list the requested object(s) across all namespaces
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 get sources](flux_get_sources.md) - Get source statuses
|
||||||
|
|
||||||
@@ -16,6 +16,9 @@ flux get sources git [flags]
|
|||||||
# List all Git repositories and their status
|
# List all Git repositories and their status
|
||||||
flux get sources git
|
flux get sources git
|
||||||
|
|
||||||
|
# List Git repositories from all namespaces
|
||||||
|
flux get sources git --all-namespaces
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ flux get sources helm [flags]
|
|||||||
# List all Helm repositories and their status
|
# List all Helm repositories and their status
|
||||||
flux get sources helm
|
flux get sources helm
|
||||||
|
|
||||||
|
# List Helm repositories from all namespaces
|
||||||
|
flux get sources helm --all-namespaces
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|||||||
@@ -29,4 +29,5 @@ The resume sub-commands resume a suspended resource.
|
|||||||
* [flux resume helmrelease](flux_resume_helmrelease.md) - Resume a suspended HelmRelease
|
* [flux resume helmrelease](flux_resume_helmrelease.md) - Resume a suspended HelmRelease
|
||||||
* [flux resume kustomization](flux_resume_kustomization.md) - Resume a suspended Kustomization
|
* [flux resume kustomization](flux_resume_kustomization.md) - Resume a suspended Kustomization
|
||||||
* [flux resume receiver](flux_resume_receiver.md) - Resume a suspended Receiver
|
* [flux resume receiver](flux_resume_receiver.md) - Resume a suspended Receiver
|
||||||
|
* [flux resume source](flux_resume_source.md) - Resume sources
|
||||||
|
|
||||||
|
|||||||
32
docs/cmd/flux_resume_source.md
Normal file
32
docs/cmd/flux_resume_source.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
## flux resume source
|
||||||
|
|
||||||
|
Resume sources
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The resume sub-commands resume a suspended source.
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for source
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 resume](flux_resume.md) - Resume suspended resources
|
||||||
|
* [flux resume source bucket](flux_resume_source_bucket.md) - Resume a suspended Bucket
|
||||||
|
* [flux resume source chart](flux_resume_source_chart.md) - Resume a suspended HelmChart
|
||||||
|
* [flux resume source git](flux_resume_source_git.md) - Resume a suspended GitRepository
|
||||||
|
* [flux resume source helm](flux_resume_source_helm.md) - Resume a suspended HelmRepository
|
||||||
|
|
||||||
40
docs/cmd/flux_resume_source_bucket.md
Normal file
40
docs/cmd/flux_resume_source_bucket.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux resume source bucket
|
||||||
|
|
||||||
|
Resume a suspended Bucket
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The resume command marks a previously suspended Bucket resource for reconciliation and waits for it to finish.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux resume source bucket [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Resume reconciliation for an existing Bucket
|
||||||
|
flux resume source bucket podinfo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for bucket
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 resume source](flux_resume_source.md) - Resume sources
|
||||||
|
|
||||||
40
docs/cmd/flux_resume_source_chart.md
Normal file
40
docs/cmd/flux_resume_source_chart.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux resume source chart
|
||||||
|
|
||||||
|
Resume a suspended HelmChart
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The resume command marks a previously suspended HelmChart resource for reconciliation and waits for it to finish.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux resume source chart [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Resume reconciliation for an existing HelmChart
|
||||||
|
flux resume source chart podinfo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for chart
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 resume source](flux_resume_source.md) - Resume sources
|
||||||
|
|
||||||
40
docs/cmd/flux_resume_source_git.md
Normal file
40
docs/cmd/flux_resume_source_git.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux resume source git
|
||||||
|
|
||||||
|
Resume a suspended GitRepository
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The resume command marks a previously suspended GitRepository resource for reconciliation and waits for it to finish.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux resume source git [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Resume reconciliation for an existing GitRepository
|
||||||
|
flux resume source git podinfo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 resume source](flux_resume_source.md) - Resume sources
|
||||||
|
|
||||||
40
docs/cmd/flux_resume_source_helm.md
Normal file
40
docs/cmd/flux_resume_source_helm.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux resume source helm
|
||||||
|
|
||||||
|
Resume a suspended HelmRepository
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The resume command marks a previously suspended HelmRepository resource for reconciliation and waits for it to finish.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux resume source helm [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Resume reconciliation for an existing HelmRepository
|
||||||
|
flux resume source helm bitnami
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for helm
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 resume source](flux_resume_source.md) - Resume sources
|
||||||
|
|
||||||
@@ -29,4 +29,5 @@ The suspend sub-commands suspend the reconciliation of a resource.
|
|||||||
* [flux suspend helmrelease](flux_suspend_helmrelease.md) - Suspend reconciliation of HelmRelease
|
* [flux suspend helmrelease](flux_suspend_helmrelease.md) - Suspend reconciliation of HelmRelease
|
||||||
* [flux suspend kustomization](flux_suspend_kustomization.md) - Suspend reconciliation of Kustomization
|
* [flux suspend kustomization](flux_suspend_kustomization.md) - Suspend reconciliation of Kustomization
|
||||||
* [flux suspend receiver](flux_suspend_receiver.md) - Suspend reconciliation of Receiver
|
* [flux suspend receiver](flux_suspend_receiver.md) - Suspend reconciliation of Receiver
|
||||||
|
* [flux suspend source](flux_suspend_source.md) - Suspend sources
|
||||||
|
|
||||||
|
|||||||
32
docs/cmd/flux_suspend_source.md
Normal file
32
docs/cmd/flux_suspend_source.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
## flux suspend source
|
||||||
|
|
||||||
|
Suspend sources
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The suspend sub-commands suspend the reconciliation of a source.
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for source
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 suspend](flux_suspend.md) - Suspend resources
|
||||||
|
* [flux suspend source bucket](flux_suspend_source_bucket.md) - Suspend reconciliation of a Bucket
|
||||||
|
* [flux suspend source chart](flux_suspend_source_chart.md) - Suspend reconciliation of a HelmChart
|
||||||
|
* [flux suspend source git](flux_suspend_source_git.md) - Suspend reconciliation of a GitRepository
|
||||||
|
* [flux suspend source helm](flux_suspend_source_helm.md) - Suspend reconciliation of a HelmRepository
|
||||||
|
|
||||||
40
docs/cmd/flux_suspend_source_bucket.md
Normal file
40
docs/cmd/flux_suspend_source_bucket.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux suspend source bucket
|
||||||
|
|
||||||
|
Suspend reconciliation of a Bucket
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The suspend command disables the reconciliation of a Bucket resource.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux suspend source bucket [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Suspend reconciliation for an existing Bucket
|
||||||
|
flux suspend source bucket podinfo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for bucket
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 suspend source](flux_suspend_source.md) - Suspend sources
|
||||||
|
|
||||||
40
docs/cmd/flux_suspend_source_chart.md
Normal file
40
docs/cmd/flux_suspend_source_chart.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux suspend source chart
|
||||||
|
|
||||||
|
Suspend reconciliation of a HelmChart
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The suspend command disables the reconciliation of a HelmChart resource.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux suspend source chart [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Suspend reconciliation for an existing HelmChart
|
||||||
|
flux suspend source chart podinfo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for chart
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 suspend source](flux_suspend_source.md) - Suspend sources
|
||||||
|
|
||||||
40
docs/cmd/flux_suspend_source_git.md
Normal file
40
docs/cmd/flux_suspend_source_git.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux suspend source git
|
||||||
|
|
||||||
|
Suspend reconciliation of a GitRepository
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The suspend command disables the reconciliation of a GitRepository resource.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux suspend source git [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Suspend reconciliation for an existing GitRepository
|
||||||
|
flux suspend source git podinfo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 suspend source](flux_suspend_source.md) - Suspend sources
|
||||||
|
|
||||||
40
docs/cmd/flux_suspend_source_helm.md
Normal file
40
docs/cmd/flux_suspend_source_helm.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## flux suspend source helm
|
||||||
|
|
||||||
|
Suspend reconciliation of a HelmRepository
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
The suspend command disables the reconciliation of a HelmRepository resource.
|
||||||
|
|
||||||
|
```
|
||||||
|
flux suspend source helm [name] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
# Suspend reconciliation for an existing HelmRepository
|
||||||
|
flux suspend source helm bitnami
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for helm
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options inherited from parent commands
|
||||||
|
|
||||||
|
```
|
||||||
|
--context string kubernetes context to use
|
||||||
|
--kubeconfig string path to the kubeconfig file (default "~/.kube/config")
|
||||||
|
-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 suspend source](flux_suspend_source.md) - Suspend sources
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ Flux v1 repository to the bootstrap one.
|
|||||||
## In-place migration
|
## In-place migration
|
||||||
|
|
||||||
!!! warning
|
!!! warning
|
||||||
For production use we recommend using the **bootstrap** procedure,
|
For production use we recommend using the **bootstrap** procedure (see the [Gitops migration](#gitops-migration) section above),
|
||||||
but if you wish to install Flux v2 in the
|
but if you wish to install Flux v2 in the
|
||||||
same way as Flux v1 then follow along.
|
same way as Flux v1 then follow along.
|
||||||
|
|
||||||
|
|||||||
@@ -257,6 +257,83 @@ The definition of the listed keys is as follows:
|
|||||||
You can read more about the available formats and limitations in
|
You can read more about the available formats and limitations in
|
||||||
the [Helm documentation](https://helm.sh/docs/intro/using_helm/#the-format-and-limitations-of---set).
|
the [Helm documentation](https://helm.sh/docs/intro/using_helm/#the-format-and-limitations-of---set).
|
||||||
|
|
||||||
|
## Refer to values in `ConfigMaps` generated with Kustomize
|
||||||
|
|
||||||
|
It is possible to use Kustomize [ConfigMap generator](https://kubectl.docs.kubernetes.io/references/kustomize/configmapgenerator/)
|
||||||
|
to trigger a Helm release upgrade every time the encoded values change.
|
||||||
|
|
||||||
|
First create a `kustomizeconfig.yaml` for Kustomize to be able to patch
|
||||||
|
`ConfigMaps` referenced in `HelmRelease` manifests:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
nameReference:
|
||||||
|
- kind: ConfigMap
|
||||||
|
version: v1
|
||||||
|
fieldSpecs:
|
||||||
|
- path: spec/valuesFrom/name
|
||||||
|
kind: HelmRelease
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a `HelmRelease` definition that references a `ConfigMap`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: podinfo
|
||||||
|
namespace: podinfo
|
||||||
|
spec:
|
||||||
|
interval: 5m
|
||||||
|
releaseName: podinfo
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: podinfo
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: podinfo
|
||||||
|
valuesFrom:
|
||||||
|
- kind: ConfigMap
|
||||||
|
name: podinfo-values
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a `kustomization.yaml` that generates the `ConfigMap` using our kustomize config:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: podinfo
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- repository.yaml
|
||||||
|
- release.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: podinfo-values
|
||||||
|
files:
|
||||||
|
- values.yaml=my-values.yaml
|
||||||
|
configurations:
|
||||||
|
- kustomizeconfig.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
When [kustomize-controller](../components/kustomize/controller.md) reconciles the above manifests, it will generate
|
||||||
|
a unique name of the `ConfigMap` every time `my-values.yaml` content is updated in Git:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: podinfo
|
||||||
|
namespace: podinfo
|
||||||
|
spec:
|
||||||
|
valuesFrom:
|
||||||
|
- kind: ConfigMap
|
||||||
|
name: podinfo-values-2mh2t8m94h
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! hint "Note"
|
||||||
|
Stale `ConfigMaps`, previously generated by Kustomize, will be
|
||||||
|
removed from the cluster by kustomize-controller if
|
||||||
|
[pruning](../components/kustomize/kustomization/#garbage-collection) is enabled.
|
||||||
|
|
||||||
## Refer to values inside the chart
|
## Refer to values inside the chart
|
||||||
|
|
||||||
It is possible to replace the `values.yaml` with a different file present inside the Helm chart.
|
It is possible to replace the `values.yaml` with a different file present inside the Helm chart.
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ sops --encrypt \
|
|||||||
|
|
||||||
You can now commit the encrypted secret to your Git repository.
|
You can now commit the encrypted secret to your Git repository.
|
||||||
|
|
||||||
|
!!! hint
|
||||||
|
Note that you shouldn't apply the encrypted secrets onto the cluster with kubectl. SOPS encrypted secrets are designed to be consumed by kustomize-controller.
|
||||||
|
|
||||||
## Configure secrets decryption
|
## Configure secrets decryption
|
||||||
|
|
||||||
Registry the Git repository on your cluster:
|
Registry the Git repository on your cluster:
|
||||||
|
|||||||
10
go.mod
10
go.mod
@@ -4,15 +4,15 @@ go 1.15
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/blang/semver/v4 v4.0.0
|
github.com/blang/semver/v4 v4.0.0
|
||||||
github.com/fluxcd/helm-controller/api v0.3.0
|
github.com/fluxcd/helm-controller/api v0.4.0
|
||||||
github.com/fluxcd/kustomize-controller/api v0.3.0
|
github.com/fluxcd/kustomize-controller/api v0.4.0
|
||||||
github.com/fluxcd/notification-controller/api v0.3.0
|
github.com/fluxcd/notification-controller/api v0.4.0
|
||||||
github.com/fluxcd/pkg/apis/meta v0.4.0
|
github.com/fluxcd/pkg/apis/meta v0.4.0
|
||||||
github.com/fluxcd/pkg/git v0.0.7
|
github.com/fluxcd/pkg/git v0.0.7
|
||||||
github.com/fluxcd/pkg/runtime v0.3.0
|
github.com/fluxcd/pkg/runtime v0.3.1
|
||||||
github.com/fluxcd/pkg/ssh v0.0.5
|
github.com/fluxcd/pkg/ssh v0.0.5
|
||||||
github.com/fluxcd/pkg/untar v0.0.5
|
github.com/fluxcd/pkg/untar v0.0.5
|
||||||
github.com/fluxcd/source-controller/api v0.3.0
|
github.com/fluxcd/source-controller/api v0.4.1
|
||||||
github.com/manifoldco/promptui v0.7.0
|
github.com/manifoldco/promptui v0.7.0
|
||||||
github.com/olekukonko/tablewriter v0.0.4
|
github.com/olekukonko/tablewriter v0.0.4
|
||||||
github.com/spf13/cobra v1.0.0
|
github.com/spf13/cobra v1.0.0
|
||||||
|
|||||||
20
go.sum
20
go.sum
@@ -132,25 +132,25 @@ github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi
|
|||||||
github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
|
github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
|
||||||
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
github.com/fluxcd/helm-controller/api v0.3.0 h1:56jalUU7Xqx6n3E8fF6sxBJ1NhmKb9NzF7gxHG4cGRo=
|
github.com/fluxcd/helm-controller/api v0.4.0 h1:sFWhxiFi1x7IHdmmOAZm4y0aN32O6xTgdt4sXfsW0po=
|
||||||
github.com/fluxcd/helm-controller/api v0.3.0/go.mod h1:9gzwQVtBhUHpp9iwH/3DNNz0kOV6hchtS3k5UaoAdFA=
|
github.com/fluxcd/helm-controller/api v0.4.0/go.mod h1:2oU4Q26TW39IGC7tmJehCNJpISj8ovpU0DoRI7Y76wE=
|
||||||
github.com/fluxcd/kustomize-controller/api v0.3.0 h1:OE2CQJXgHAMpNmqWWC4/YWsp2VcSrUCfJPKeDahG1/c=
|
github.com/fluxcd/kustomize-controller/api v0.4.0 h1:QBilPNIFf5VCmJrt0L96iPWfV0lRT28n6vD+W7Kz88s=
|
||||||
github.com/fluxcd/kustomize-controller/api v0.3.0/go.mod h1:dBqBgDzU4RFYik6jdCdXGEsILXccS1oHAydjDJ9Jc6g=
|
github.com/fluxcd/kustomize-controller/api v0.4.0/go.mod h1:NB4aJ+hSWyg6Tx6p47ZWExzjwq4sPRRYvaP02JrHrNU=
|
||||||
github.com/fluxcd/notification-controller/api v0.3.0 h1:CmS0hKzBOH3WrNQPuO5EeQHlCxhHdHYFR9XGenxNRZE=
|
github.com/fluxcd/notification-controller/api v0.4.0 h1:x7QwF7F/uG0JuaMaEBWqHWhy5DLJEsC3zWlj5rK6kB8=
|
||||||
github.com/fluxcd/notification-controller/api v0.3.0/go.mod h1:D/PyTHO0LiwEKwpBqbzJbjolJs1Ggw/tCMaLc7BHQi4=
|
github.com/fluxcd/notification-controller/api v0.4.0/go.mod h1:D/PyTHO0LiwEKwpBqbzJbjolJs1Ggw/tCMaLc7BHQi4=
|
||||||
github.com/fluxcd/pkg/apis/meta v0.3.0/go.mod h1:wOzQQx8CdtUQCGaLzqGu4QgnNxYkI6/wvdvlovxWhF0=
|
github.com/fluxcd/pkg/apis/meta v0.3.0/go.mod h1:wOzQQx8CdtUQCGaLzqGu4QgnNxYkI6/wvdvlovxWhF0=
|
||||||
github.com/fluxcd/pkg/apis/meta v0.4.0 h1:JChqB9GGgorW9HWKxirTVV0rzrcLyzBaVjinmqZ0iHA=
|
github.com/fluxcd/pkg/apis/meta v0.4.0 h1:JChqB9GGgorW9HWKxirTVV0rzrcLyzBaVjinmqZ0iHA=
|
||||||
github.com/fluxcd/pkg/apis/meta v0.4.0/go.mod h1:wOzQQx8CdtUQCGaLzqGu4QgnNxYkI6/wvdvlovxWhF0=
|
github.com/fluxcd/pkg/apis/meta v0.4.0/go.mod h1:wOzQQx8CdtUQCGaLzqGu4QgnNxYkI6/wvdvlovxWhF0=
|
||||||
github.com/fluxcd/pkg/git v0.0.7 h1:tFSYPy7tcIYfOt8H5EUERXIRz7fk0id302oQZde1NtU=
|
github.com/fluxcd/pkg/git v0.0.7 h1:tFSYPy7tcIYfOt8H5EUERXIRz7fk0id302oQZde1NtU=
|
||||||
github.com/fluxcd/pkg/git v0.0.7/go.mod h1:5Vu92x6Q3CpxDUllmB69kAkVY5jAtPpXcY2TSZ/oCJI=
|
github.com/fluxcd/pkg/git v0.0.7/go.mod h1:5Vu92x6Q3CpxDUllmB69kAkVY5jAtPpXcY2TSZ/oCJI=
|
||||||
github.com/fluxcd/pkg/runtime v0.3.0 h1:WpeTmDT2meIe4NsU081I8zmUGgTYs3bIMRgs9F3Lj90=
|
github.com/fluxcd/pkg/runtime v0.3.1 h1:UI+FQd1OgipZ6N8YxXHtKYMAu1NRFWaR/Gp1M3T6RZA=
|
||||||
github.com/fluxcd/pkg/runtime v0.3.0/go.mod h1:gPe6JgfPB4EDh5gaVkuI0SPuATk3PmclbFa1kPcZrKE=
|
github.com/fluxcd/pkg/runtime v0.3.1/go.mod h1:wg33L6k5FkGEYoZta7hbUlBIscM5VZd/PfCbaEi+wK4=
|
||||||
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
|
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
|
||||||
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
|
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
|
||||||
github.com/fluxcd/pkg/untar v0.0.5 h1:UGI3Ch1UIEIaqQvMicmImL1s9npQa64DJ/ozqHKB7gk=
|
github.com/fluxcd/pkg/untar v0.0.5 h1:UGI3Ch1UIEIaqQvMicmImL1s9npQa64DJ/ozqHKB7gk=
|
||||||
github.com/fluxcd/pkg/untar v0.0.5/go.mod h1:O6V9+rtl8c1mHBafgqFlJN6zkF1HS5SSYn7RpQJ/nfw=
|
github.com/fluxcd/pkg/untar v0.0.5/go.mod h1:O6V9+rtl8c1mHBafgqFlJN6zkF1HS5SSYn7RpQJ/nfw=
|
||||||
github.com/fluxcd/source-controller/api v0.3.0 h1:liDV8tqpBeQp7KDdVxX9YYb6gFoO7v2hyIFXudw2vQg=
|
github.com/fluxcd/source-controller/api v0.4.1 h1:HiMg8XNqGEDeelGG22GfCUGgfyXffiXyluDYsRrjvLQ=
|
||||||
github.com/fluxcd/source-controller/api v0.3.0/go.mod h1:MYmvbADJp/21m4C+PEY7WXCeqEErMYuhns+jnKyewqs=
|
github.com/fluxcd/source-controller/api v0.4.1/go.mod h1:MYmvbADJp/21m4C+PEY7WXCeqEErMYuhns+jnKyewqs=
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
|||||||
71
internal/flags/helm_release_values.go
Normal file
71
internal/flags/helm_release_values.go
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 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 flags
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
var supportedHelmReleaseValuesFromKinds = []string{"Secret", "ConfigMap"}
|
||||||
|
|
||||||
|
type HelmReleaseValuesFrom struct {
|
||||||
|
Kind string
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *HelmReleaseValuesFrom) String() string {
|
||||||
|
if h.Name == "" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%s/%s", h.Kind, h.Name)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *HelmReleaseValuesFrom) Set(str string) error {
|
||||||
|
if strings.TrimSpace(str) == "" {
|
||||||
|
return fmt.Errorf("no values given, please specify %s",
|
||||||
|
h.Description())
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceKind, sourceName := utils.ParseObjectKindName(str)
|
||||||
|
if sourceKind == "" {
|
||||||
|
return fmt.Errorf("invalid Kubernetes object reference '%s', must be in format <kind>/<name>", str)
|
||||||
|
}
|
||||||
|
if !utils.ContainsItemString(supportedHelmReleaseValuesFromKinds, sourceKind) {
|
||||||
|
return fmt.Errorf("reference kind '%s' is not supported, can be one of: %s",
|
||||||
|
sourceKind, strings.Join(supportedHelmReleaseValuesFromKinds, ", "))
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Name = sourceName
|
||||||
|
h.Kind = sourceKind
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *HelmReleaseValuesFrom) Type() string {
|
||||||
|
return "helmReleaseValuesFrom"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *HelmReleaseValuesFrom) Description() string {
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>',"+
|
||||||
|
"where kind can be one of: (%s)",
|
||||||
|
strings.Join(supportedHelmReleaseValuesFromKinds, ", "),
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -60,9 +60,17 @@ const (
|
|||||||
ModeCapture ExecMode = "capture.stderr|stdout"
|
ModeCapture ExecMode = "capture.stderr|stdout"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExecKubectlCommand(ctx context.Context, mode ExecMode, args ...string) (string, error) {
|
func ExecKubectlCommand(ctx context.Context, mode ExecMode, kubeConfigPath string, kubeContext string, args ...string) (string, error) {
|
||||||
var stdoutBuf, stderrBuf bytes.Buffer
|
var stdoutBuf, stderrBuf bytes.Buffer
|
||||||
|
|
||||||
|
if kubeConfigPath != "" {
|
||||||
|
args = append(args, "--kubeconfig="+kubeConfigPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
if kubeContext != "" {
|
||||||
|
args = append(args, "--context="+kubeContext)
|
||||||
|
}
|
||||||
|
|
||||||
c := exec.CommandContext(ctx, "kubectl", args...)
|
c := exec.CommandContext(ctx, "kubectl", args...)
|
||||||
|
|
||||||
if mode == ModeStderrOS {
|
if mode == ModeStderrOS {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/helm-controller/archive/v0.3.0.zip//helm-controller-0.3.0/config/crd
|
- https://github.com/fluxcd/helm-controller/archive/v0.4.0.zip//helm-controller-0.4.0/config/crd
|
||||||
- https://github.com/fluxcd/helm-controller/archive/v0.3.0.zip//helm-controller-0.3.0/config/manager
|
- https://github.com/fluxcd/helm-controller/archive/v0.4.0.zip//helm-controller-0.4.0/config/manager
|
||||||
patchesJson6902:
|
patchesJson6902:
|
||||||
- target:
|
- target:
|
||||||
group: apps
|
group: apps
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/kustomize-controller/archive/v0.3.0.zip//kustomize-controller-0.3.0/config/crd
|
- https://github.com/fluxcd/kustomize-controller/archive/v0.4.0.zip//kustomize-controller-0.4.0/config/crd
|
||||||
- https://github.com/fluxcd/kustomize-controller/archive/v0.3.0.zip//kustomize-controller-0.3.0/config/manager
|
- https://github.com/fluxcd/kustomize-controller/archive/v0.4.0.zip//kustomize-controller-0.4.0/config/manager
|
||||||
patchesJson6902:
|
patchesJson6902:
|
||||||
- target:
|
- target:
|
||||||
group: apps
|
group: apps
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/notification-controller/archive/v0.3.0.zip//notification-controller-0.3.0/config/crd
|
- https://github.com/fluxcd/notification-controller/archive/v0.4.0.zip//notification-controller-0.4.0/config/crd
|
||||||
- https://github.com/fluxcd/notification-controller/archive/v0.3.0.zip//notification-controller-0.3.0/config/manager
|
- https://github.com/fluxcd/notification-controller/archive/v0.4.0.zip//notification-controller-0.4.0/config/manager
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/source-controller/archive/v0.3.0.zip//source-controller-0.3.0/config/crd
|
- https://github.com/fluxcd/source-controller/archive/v0.4.1.zip//source-controller-0.4.1/config/crd
|
||||||
- https://github.com/fluxcd/source-controller/archive/v0.3.0.zip//source-controller-0.3.0/config/manager
|
- https://github.com/fluxcd/source-controller/archive/v0.4.1.zip//source-controller-0.4.1/config/manager
|
||||||
patchesJson6902:
|
patchesJson6902:
|
||||||
- target:
|
- target:
|
||||||
group: apps
|
group: apps
|
||||||
|
|||||||
13
mkdocs.yml
13
mkdocs.yml
@@ -95,7 +95,7 @@ nav:
|
|||||||
- Create alert provider: cmd/flux_create_alert-provider.md
|
- Create alert provider: cmd/flux_create_alert-provider.md
|
||||||
- Create alert: cmd/flux_create_alert.md
|
- Create alert: cmd/flux_create_alert.md
|
||||||
- Create receiver: cmd/flux_create_receiver.md
|
- Create receiver: cmd/flux_create_receiver.md
|
||||||
#- Create tenant: cmd/flux_create_tenant.md
|
- Create tenant: cmd/flux_create_tenant.md
|
||||||
- Delete: cmd/flux_delete.md
|
- Delete: cmd/flux_delete.md
|
||||||
- Delete kustomization: cmd/flux_delete_kustomization.md
|
- Delete kustomization: cmd/flux_delete_kustomization.md
|
||||||
- Delete helmrelease: cmd/flux_delete_helmrelease.md
|
- Delete helmrelease: cmd/flux_delete_helmrelease.md
|
||||||
@@ -119,6 +119,7 @@ nav:
|
|||||||
- Get sources: cmd/flux_get_sources.md
|
- Get sources: cmd/flux_get_sources.md
|
||||||
- Get sources git: cmd/flux_get_sources_git.md
|
- Get sources git: cmd/flux_get_sources_git.md
|
||||||
- Get sources helm: cmd/flux_get_sources_helm.md
|
- Get sources helm: cmd/flux_get_sources_helm.md
|
||||||
|
- Get sources chart: cmd/flux_get_sources_chart.md
|
||||||
- Get sources bucket: cmd/flux_get_sources_bucket.md
|
- Get sources bucket: cmd/flux_get_sources_bucket.md
|
||||||
- Get alert provider: cmd/flux_get_alert-provider.md
|
- Get alert provider: cmd/flux_get_alert-provider.md
|
||||||
- Get alert: cmd/flux_get_alert.md
|
- Get alert: cmd/flux_get_alert.md
|
||||||
@@ -127,12 +128,22 @@ nav:
|
|||||||
- Resume: cmd/flux_resume.md
|
- Resume: cmd/flux_resume.md
|
||||||
- Resume kustomization: cmd/flux_resume_kustomization.md
|
- Resume kustomization: cmd/flux_resume_kustomization.md
|
||||||
- Resume helmrelease: cmd/flux_resume_helmrelease.md
|
- Resume helmrelease: cmd/flux_resume_helmrelease.md
|
||||||
|
- Resume source: cmd/flux_resume_source.md
|
||||||
|
- Resume source git: cmd/flux_resume_source_git.md
|
||||||
|
- Resume source helm: cmd/flux_resume_source_helm.md
|
||||||
|
- Resume source chart: cmd/flux_resume_source_chart.md
|
||||||
|
- Resume source bucket: cmd/flux_resume_source_bucket.md
|
||||||
- Resume alert provider: cmd/flux_resume_alert-provider.md
|
- Resume alert provider: cmd/flux_resume_alert-provider.md
|
||||||
- Resume alert: cmd/flux_resume_alert.md
|
- Resume alert: cmd/flux_resume_alert.md
|
||||||
- Resume receiver: cmd/flux_resume_receiver.md
|
- Resume receiver: cmd/flux_resume_receiver.md
|
||||||
- Suspend: cmd/flux_suspend.md
|
- Suspend: cmd/flux_suspend.md
|
||||||
- Suspend kustomization: cmd/flux_suspend_kustomization.md
|
- Suspend kustomization: cmd/flux_suspend_kustomization.md
|
||||||
- Suspend helmrelease: cmd/flux_suspend_helmrelease.md
|
- Suspend helmrelease: cmd/flux_suspend_helmrelease.md
|
||||||
|
- Suspend source: cmd/flux_suspend_source.md
|
||||||
|
- Suspend source git: cmd/flux_suspend_source_git.md
|
||||||
|
- Suspend source helm: cmd/flux_suspend_source_helm.md
|
||||||
|
- Suspend source chart: cmd/flux_suspend_source_chart.md
|
||||||
|
- Suspend source bucket: cmd/flux_suspend_source_bucket.md
|
||||||
- Suspend alert provider: cmd/flux_suspend_alert-provider.md
|
- Suspend alert provider: cmd/flux_suspend_alert-provider.md
|
||||||
- Suspend alert: cmd/flux_suspend_alert.md
|
- Suspend alert: cmd/flux_suspend_alert.md
|
||||||
- Suspend receiver: cmd/flux_suspend_receiver.md
|
- Suspend receiver: cmd/flux_suspend_receiver.md
|
||||||
|
|||||||
Reference in New Issue
Block a user