fluxcd / flux2-kustomize-helm-example

A GitOps workflow example for multi-env deployments with Flux, Kustomize and Helm.
https://fluxcd.io
Apache License 2.0
935 stars 992 forks source link

error with production sync #28

Closed iancote closed 3 years ago

iancote commented 3 years ago

The staging context sets up fine and everything launches, but when I try to spin up the production context I get an error and nothing goes forward:

iancote@iancote-XPS-13-7390:~/git/awx-k3s-flux$ flux bootstrap github \

--context=staging \ --owner=iancote \ --repository=awx-k3s-flux \ --branch=main \ --personal \ --path=clusters/staging ► connecting to github.com ► cloning branch "main" from Git repository "https://github.com/iancote/awx-k3s-flux.git" ✔ cloned repository ► generating component manifests ✔ generated component manifests ✔ committed sync manifests to "main" ("2f83add8aa71d4a6d36f3e136c0121e89644c287") ► pushing component manifests to "https://github.com/iancote/awx-k3s-flux.git" ► installing components in "flux-system" namespace ✔ installed components ✔ reconciled components ► determining if source secret "flux-system/flux-system" exists ► generating source secret ✔ public key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD5CWGl4r459xB1USxuJFGwOYun2I/AWM6tGARfzcAUUP0sYhdfPrMVyfe2nWSkWVCP7fUd8YfzxxdW/wtLCnkwlUxtVFArV5BDuC3e7yCc+J63vMZw3AY7RpP9rdso4GJ0jCMJ6R0Aj3F7maVHi9fBgxIqZgq+hOKHuC8l6IaMadClKz9Dl7vCD97m6irOegQiRTmUbVMpdJWNkinWiyvf+1PoPhESXlkkk45uVI7bgI8oxsjz5S6ysQSkSrLfCygMzdjaKcU6IUQAT7YUAX/siqePbsI7SnKp7Y5vgF6tz9KnT9T6S2v8SnY2HgZHGN+Cl4/03etI430M+wKd0+F/ ✔ configured deploy key "flux-system-main-flux-system-./clusters/staging" for "https://github.com/iancote/awx-k3s-flux" ► applying source secret "flux-system/flux-system" ✔ reconciled source secret ► generating sync manifests ✔ generated sync manifests ✔ committed sync manifests to "main" ("52e7cafe8eac4a06e88d32895189d293b538d375") ► pushing sync manifests to "https://github.com/iancote/awx-k3s-flux.git" ► applying sync manifests ✔ reconciled sync configuration ◎ waiting for Kustomization "flux-system/flux-system" to be reconciled ✔ Kustomization reconciled successfully ► confirming components are healthy ✔ source-controller: deployment ready ✔ kustomize-controller: deployment ready ✔ helm-controller: deployment ready ✔ notification-controller: deployment ready ✔ all components are healthy iancote@iancote-XPS-13-7390:~/git/awx-k3s-flux$ kubectl config use-context production Switched to context "production". iancote@iancote-XPS-13-7390:~/git/awx-k3s-flux$ flux bootstrap github --context=production --owner=iancote --repository=awx-k3s-flux --branch=main --personal --path=clusters/production ► connecting to github.com ► cloning branch "main" from Git repository "https://github.com/iancote/awx-k3s-flux.git" ✔ cloned repository ► generating component manifests ✔ generated component manifests ✔ committed sync manifests to "main" ("710f4d5f4f3ef5da9c31631fb73f07dea7dc696a") ► pushing component manifests to "https://github.com/iancote/awx-k3s-flux.git" ✔ reconciled components ► determining if source secret "flux-system/flux-system" exists ✔ source secret up to date ✗ sync path configuration ("./clusters/production") would overwrite path ("./clusters/staging") of existing Kustomization

iancote@iancote-XPS-13-7390:~/git/awx-k3s-flux$ git pull remote: Enumerating objects: 21, done. remote: Counting objects: 100% (21/21), done. remote: Compressing objects: 100% (16/16), done. remote: Total 17 (delta 0), reused 16 (delta 0), pack-reused 0 Unpacking objects: 100% (17/17), 18.33 KiB | 3.67 MiB/s, done. From github.com:iancote/awx-k3s-flux ffb1ba9..710f4d5 main -> origin/main Updating ffb1ba9..710f4d5 Fast-forward clusters/production/flux-system/gotk-components.yaml | 2831 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ clusters/staging/flux-system/gotk-components.yaml | 2831 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ clusters/staging/flux-system/gotk-sync.yaml | 27 + clusters/staging/flux-system/kustomization.yaml | 5 + 4 files changed, 5694 insertions(+) create mode 100644 clusters/production/flux-system/gotk-components.yaml create mode 100644 clusters/staging/flux-system/gotk-components.yaml create mode 100644 clusters/staging/flux-system/gotk-sync.yaml create mode 100644 clusters/staging/flux-system/kustomization.yaml iancote@iancote-XPS-13-7390:~/git/awx-k3s-flux$ tree . ├── apps │   ├── base │   │   └── podinfo │   │   ├── kustomization.yaml │   │   ├── namespace.yaml │   │   └── release.yaml │   ├── production │   │   ├── kustomization.yaml │   │   └── podinfo-values.yaml │   └── staging │   ├── kustomization.yaml │   └── podinfo-values.yaml ├── clusters │   ├── production │   │   ├── apps.yaml │   │   ├── flux-system │   │   │   └── gotk-components.yaml │   │   └── infrastructure.yaml │   └── staging │   ├── apps.yaml │   ├── flux-system │   │   ├── gotk-components.yaml │   │   ├── gotk-sync.yaml │   │   └── kustomization.yaml │   └── infrastructure.yaml └── infrastructure ├── kustomization.yaml ├── nginx │   ├── kustomization.yaml │   ├── namespace.yaml │   └── release.yaml ├── redis │   ├── kustomization.yaml │   ├── kustomizeconfig.yaml │   ├── namespace.yaml │   ├── release.yaml │   └── values.yaml └── sources ├── bitnami.yaml ├── kustomization.yaml └── podinfo.yaml

Any ideas what would cause that? Thanks, -ian

iancote commented 3 years ago

Please disregard, I'm a bobo. I was trying to use the same actual cluster for both contexts.

bunengxiu commented 2 months ago

I have the same problem ~/project/k8s/dev/openobserve ddd !3 ?8 flux check --pre 1 err 4s staging kube 06:27:56 ► checking prerequisites ✔ Kubernetes 1.28.2 >=1.26.0-0 ✔ prerequisites checks passed ~/project/k8s/dev/openobserve ddd !3 ?8 kc config use-context staging ok staging kube 06:28:15 Switched to context "staging". ~/project/k8s/dev/openobserve ddd !3 ?8 flux bootstrap github \ ok staging kube 06:32:10 --context=staging \ --owner=${GITHUB_USER} \ --repository=${GITHUB_REPO} \ --branch=main \ --personal \ --path=clusters/staging ► connecting to github.com ► cloning branch "main" from Git repository "https://github.com/bunengxiu/gitops.git" ✔ cloned repository ► generating component manifests ✔ generated component manifests ✔ component manifests are up to date ✔ reconciled components ► determining if source secret "flux-system/flux-system" exists ✔ source secret up to date ✗ sync path configuration ("./clusters/staging") would overwrite path ("./clusters/production") of existing Kustomization