Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace bigbang extension in favor of zarf dev generate bigbang command #2875

Closed
AustinAbro321 opened this issue Aug 13, 2024 · 0 comments · Fixed by #3059
Closed

Replace bigbang extension in favor of zarf dev generate bigbang command #2875

AustinAbro321 opened this issue Aug 13, 2024 · 0 comments · Fixed by #3059
Labels
enhancement ✨ New feature or request
Milestone

Comments

@AustinAbro321
Copy link
Contributor

AustinAbro321 commented Aug 13, 2024

Is your feature request related to a problem? Please describe.

The bigbang extension was created to make it simpler to deploy big bang alongside Zarf. Big bang is a helm chart containing helm charts so it can be hard to find all the images and repos within. The Zarf bigbang extension simplifies the creation of the big bang package by automatically going through the big bang helm chart & git repos to find all of the images, git repos, and manifests that are deployed by big bang. Zarf also automatically creates a custom values file to set registry creds, git server info, and kyverno policies in the helm chart. This lets users deploy bigbang with only a few lines of yaml, however this comes with downsides.

  1. The images, repos, and values file going into the cluster is implicit with the bb extension. It's not 100% clear to the user what's going into the cluster, for example users might not expect the custom Zarf values file.
  2. Compose functionality doesn't work as expected. See Refactor Big Bang composability to match component composability #2120 and Importing BigBang component does not allow overriding of BigBang version #2465. These issues can be fixed, but it is simpler to treat bigbang as a normal component.
  3. The code is more complex in several places where we need to check if we are including the big bang extension and run processing. By making big bang generate a regular Zarf file, we would simplify create time & publish time logic.

Below is the component that Zarf currently creates from the big bang extension. The zarf dev generate bigbang command will create a similar component to the one below. The files and values file will be placed on disk in a directory beside the zarf.yaml file. User supplied values file & flux patch files can be added after running generate and will be merged into the component on subsequent generate runs. skipFlux repo and version will become cli args.

  - name: bigbang
    required: true
    manifests:
    - name: flux-system
      namespace: flux-system
      files:
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-ext-flux.yaml
    - name: bigbang
      namespace: bigbang
      files:
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-ext-gitrepository.yaml
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-ext-zarf-credentials.yaml
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-usr-vals-0-ingress.yaml
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-usr-vals-1-kyverno.yaml
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-usr-vals-2-loki.yaml
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-usr-vals-3-neuvector.yaml
      - /tmp/zarf-1909041666/components/bigbang/temp/bb-ext-helmrelease.yaml
    images:
    - registry1.dso.mil/ironbank/fluxcd/source-controller:v1.3.0
    - registry1.dso.mil/ironbank/fluxcd/kustomize-controller:v1.3.0
    - registry1.dso.mil/ironbank/fluxcd/helm-controller:v1.0.1
    - registry1.dso.mil/ironbank/fluxcd/notification-controller:v1.3.0
    - registry1.dso.mil/ironbank/opensource/prometheus/alertmanager:v0.27.0
    - registry1.dso.mil/ironbank/big-bang/base:2.1.0
    - registry1.dso.mil/ironbank/opensource/kubernetes/kubectl:v1.29.6
    - registry1.dso.mil/ironbank/opensource/kubernetes/kube-state-metrics:v2.12.0
    - registry1.dso.mil/ironbank/opensource/ingress-nginx/kube-webhook-certgen:v1.3.0
    - registry1.dso.mil/ironbank/opensource/prometheus/prometheus:v2.53.0
    - registry1.dso.mil/ironbank/opensource/prometheus-operator/prometheus-config-reloader:v0.75.0
    - registry1.dso.mil/ironbank/opensource/prometheus-operator/prometheus-operator:v0.75.0
    - registry1.dso.mil/ironbank/opensource/prometheus/node-exporter:v1.8.1
    - registry1.dso.mil/ironbank/opensource/thanos/thanos:v0.35.1
    - registry1.dso.mil/ironbank/neuvector/neuvector/controller:5.3.4
    - registry1.dso.mil/ironbank/neuvector/neuvector/enforcer:5.3.4
    - registry1.dso.mil/ironbank/neuvector/neuvector/manager:5.3.4
    - registry1.dso.mil/ironbank/neuvector/neuvector/scanner:5
    - registry1.dso.mil/ironbank/neuvector/neuvector/prometheus-exporter:5.3.2
    - registry1.dso.mil/ironbank/opensource/grafana/promtail:v3.0.0
    - registry1.dso.mil/ironbank/opensource/grafana/tempo:2.5.0
    - registry1.dso.mil/ironbank/opensource/grafana/tempo-query:2.5.0
    - registry1.dso.mil/ironbank/opensource/istio/pilot:1.22.3
    - registry1.dso.mil/ironbank/opensource/istio/proxyv2:1.22.3
    - registry1.dso.mil/ironbank/opensource/kiali/kiali:v1.88.0
    - registry1.dso.mil/ironbank/opensource/kiali/kiali-operator:v1.88.0
    - registry1.dso.mil/ironbank/opensource/kubernetes-sigs/metrics-server:v0.7.1
    - registry1.dso.mil/ironbank/opensource/kyverno/policy-reporter:2.20.1
    - registry1.dso.mil/ironbank/opensource/kyverno:v1.12.5
    - registry1.dso.mil/ironbank/opensource/kyverno/kyvernopre:v1.12.5
    - registry1.dso.mil/ironbank/opensource/kubernetes/kubectl:v1.29.7
    - registry1.dso.mil/ironbank/redhat/ubi/ubi9-minimal:9.4
    - registry1.dso.mil/ironbank/opensource/kyverno/kyverno/reports-controller:v1.12.5
    - registry1.dso.mil/ironbank/opensource/kyverno/kyverno/background-controller:v1.12.5
    - registry1.dso.mil/ironbank/opensource/kyverno/kyverno/cleanup-controller:v1.12.5
    - registry1.dso.mil/ironbank/opensource/kyverno/kyvernocli:v1.12.5
    - registry1.dso.mil/ironbank/opensource/grafana/loki:3.1.1
    - registry1.dso.mil/ironbank/big-bang/grafana/grafana-plugins:11.1.3
    - registry1.dso.mil/ironbank/kiwigrid/k8s-sidecar:1.27.5
    - registry1.dso.mil/ironbank/opensource/istio/operator:1.22.3
    repos:
    - https://repo1.dso.mil/big-bang/bigbang.git@2.34.0
    - https://repo1.dso.mil/big-bang/product/packages/grafana.git@8.4.4-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/istio-operator.git@1.22.3-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/istio-controlplane.git@1.22.3-bb.1
    - https://repo1.dso.mil/big-bang/product/packages/kyverno-reporter.git@2.24.1-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/kyverno.git@3.2.6-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/loki.git@6.10.0-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/tempo.git@1.10.1-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/kiali.git@1.88.0-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/kyverno-policies.git@3.2.5-bb.3
    - https://repo1.dso.mil/big-bang/product/packages/metrics-server.git@3.12.1-bb.4
    - https://repo1.dso.mil/big-bang/product/packages/monitoring.git@61.2.0-bb.5
    - https://repo1.dso.mil/big-bang/product/packages/neuvector.git@2.7.8-bb.0
    - https://repo1.dso.mil/big-bang/product/packages/promtail.git@6.16.2-bb.3
    extensions:
      bigbang:
        version: 2.34.0
        repo: https://repo1.dso.mil/big-bang/bigbang.git
        valuesFiles:
        - config/ingress.yaml
        - config/kyverno.yaml
        - config/loki.yaml
        - config/neuvector.yaml
  actions:
    onDeploy:
      onSuccess:
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.kyverno` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: kyverno
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.kyverno-policies` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: kyverno-policies
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.istio-operator` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: istio-operator
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.istio` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: istio
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.monitoring` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: monitoring
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.loki` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: loki
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.kyverno-reporter` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: kyverno-reporter
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.grafana` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: grafana
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: K8s metric server to exist or be deployed by Big Bang
        wait:
          cluster:
            kind: APIService
            name: v1beta1.metrics.k8s.io
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.kiali` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: kiali
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.tempo` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: tempo
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.promtail` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: promtail
            namespace: bigbang
            condition: ready
      - maxTotalSeconds: 600
        description: Big Bang Helm Release `bigbang.neuvector` to be ready
        wait:
          cluster:
            kind: HelmRelease
            name: neuvector
            namespace: bigbang
            condition: ready
      onFailure:
      - cmd: ./zarf tools kubectl get nodes -o wide
      - cmd: ./zarf tools kubectl get hr -n bigbang
      - cmd: ./zarf tools kubectl get gitrepo -n bigbang
      - cmd: ./zarf tools kubectl get pods -A
      - mute: true
        cmd: ./zarf tools kubectl describe hr -n bigbang
        description: Storing debug information to the log for troubleshooting.
      - mute: true
        cmd: ./zarf tools kubectl describe gitrepo -n bigbang
        description: Storing debug information to the log for troubleshooting.
      - mute: true
        cmd: ./zarf tools kubectl describe pods -A
        description: Storing debug information to the log for troubleshooting.
      - mute: true
        cmd: ./zarf tools kubectl describe nodes
        description: Storing debug information to the log for troubleshooting.
      - mute: true
        cmd: ./zarf tools kubectl get events -A
        description: Storing debug information to the log for troubleshooting.
    onRemove:
      before:
      - cmd: |
          ./zarf tools kubectl patch helmrelease -n bigbang bigbang --type=merge -p '{"spec":{"suspend":true}}'
          ./zarf tools kubectl delete helmrelease -n bigbang istio --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang istio-operator --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang monitoring --ignore-not-found
          ./zarf tools kubectl delete providers grafana -n monitoring --ignore-not-found
          ./zarf tools kubectl delete alerts grafana -n monitoring --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang promtail --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang loki --ignore-not-found
          ./zarf tools kubectl delete kiali -n kiali kiali --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang tempo --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang neuvector --ignore-not-found
          ./zarf tools kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io neuvector-validating-crd-webhook --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang kyverno-reporter --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang kyverno-policies --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang kyverno --ignore-not-found
          ./zarf tools kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io kyverno-policy-validating-webhook-cfg kyverno-resource-validating-webhook-cfg --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang kiali --ignore-not-found
          ./zarf tools kubectl delete helmrelease -n bigbang metrics-server --ignore-not-found
          ./zarf tools kubectl delete apiservices.apiregistration.k8s.io -l helm.toolkit.fluxcd.io/namespace=bigbang,helm.toolkit.fluxcd.io/name=metrics-server --ignore-not-found
          ./zarf tools kubectl delete gitrepositories -n bigbang -l app.kubernetes.io/part-of=bigbang
        description: Cleaning up Big Bang resources
      - cmd: ./zarf tools kubectl patch helmrelease -n bigbang bigbang --type=merge -p '{"spec":{"suspend":true}}'
        description: Suspend Big Bang HelmReleases to prevent reconciliation during removal.

Implementation decisions:

  • Do we still want to deploy bigbang as an already templated manifest file from a helm chart, or as a regular helm chart. Unless there is a specific issue we run into likely we want to deploy it as a regular helm chart.
@AustinAbro321 AustinAbro321 added the enhancement ✨ New feature or request label Aug 13, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Zarf Aug 30, 2024
@salaxander salaxander added this to the v0.41.0 milestone Sep 5, 2024
@salaxander salaxander moved this from Backlog to In progress in Zarf Sep 10, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Zarf Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants