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

[BOP-111] add support for enabled field #85

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

sakshisharma84
Copy link
Contributor

@sakshisharma84 sakshisharma84 commented Sep 5, 2024

Description

This PR adds support for enabled field in BOP addons.

JIRA Ticket

https://mirantis.jira.com/browse/BOP-1111

BOP Issue

#84

Testing

  1. Apply the following blueprint. The 3 addons should be created successfully.
kubectl get addons -A
NAMESPACE          NAME             STATUS
blueprint-system   calico           Available
blueprint-system   example-server   Available
blueprint-system   ss-metallb       Available

Blueprint YAML

apiVersion: blueprint.mirantis.com/v1alpha1
kind: Blueprint
metadata:
  name: my-cluster
spec:
  components:
    addons:
      - name: ss-metallb
        kind: chart
        enabled: true
        namespace: metallb-system
        chart:
          name: metallb
          repo: https://metallb.github.io/metallb
          version: 0.14.7
          values: |
            speaker:
              frr:
                enabled: false
      - name: example-server
        kind: chart
        enabled: true
        namespace: default
        chart:
          name: nginx
          repo: https://charts.bitnami.com/bitnami
          version: 15.1.1
          values: |
            service:
              type: ClusterIP
      - name: calico
        kind: "manifest"
        enabled: true
        manifest:
          url: "https://raw.githubusercontent.com/projectcalico/calico/v3.26.3/manifests/calico.yaml"
  1. Check disable works correctly.
    (i) Set the enabled field for ss-metallb addon to false and apply the blueprint. The ss-metallb addon should get deleted.
addons:
  - name: ss-metallb
    kind: chart
    enabled: false
    namespace: metallb-system
    chart:
      name: metallb
      repo: https://metallb.github.io/metallb
      version: 0.14.7
      values: |
        speaker:
          frr:
            enabled: false
  - name: example-server

….

 kubectl get addons -A
NAMESPACE          NAME             STATUS
blueprint-system   calico           Available
blueprint-system   example-server   Available

(ii) Remove the example server addon completely from the blueprint and then apply the blueprint.

apiVersion: blueprint.mirantis.com/v1alpha1
kind: Blueprint
metadata:
  name: my-cluster
spec:
  components:
    addons:
      - name: ss-metallb
        kind: chart
        enabled: false
        namespace: metallb-system
        chart:
          name: metallb
          repo: https://metallb.github.io/metallb
          version: 0.14.7
          values: |
            speaker:
              frr:
                enabled: false
      - name: calico
        kind: "manifest"
        enabled: true
        manifest:
          url: "https://raw.githubusercontent.com/projectcalico/calico/v3.26.3/manifests/calico.yaml"

Example-server addon should get deleted and ss-metallb should NOT be started. Only calico addon should be present.

kubectl get addons -A
NAMESPACE          NAME     STATUS
blueprint-system   calico   Available
ssharma@Sakshi-Sharma-MacBook-Pro-14-inch-2021- blueprint-operator %

iii) Set enabled field for ss-metallb to true and apply the blueprint. We should now see 2 addons.

apiVersion: blueprint.mirantis.com/v1alpha1
kind: Blueprint
metadata:
  name: my-cluster
spec:
  components:
    addons:
      - name: ss-metallb
        kind: chart
        enabled: true
        namespace: metallb-system
        chart:
          name: metallb
          repo: https://metallb.github.io/metallb
          version: 0.14.7
          values: |
            speaker:
              frr:
                enabled: false
      - name: calico
        kind: "manifest"
        enabled: true
        manifest:
          url: "https://raw.githubusercontent.com/projectcalico/calico/v3.26.3/manifests/calico.yaml"
kubectl get addons -A
NAMESPACE          NAME         STATUS
blueprint-system   calico       Available
blueprint-system   ss-metallb   Available

iv) Add example-server back. All 3 addons should be enabled.

apiVersion: blueprint.mirantis.com/v1alpha1
kind: Blueprint
metadata:
  name: my-cluster
spec:
  components:
    addons:
      - name: ss-metallb
        kind: chart
        enabled: true
        namespace: metallb-system
        chart:
          name: metallb
          repo: https://metallb.github.io/metallb
          version: 0.14.7
          values: |
            speaker:
              frr:
                enabled: false
      - name: example-server
        kind: chart
        enabled: true
        namespace: default
        chart:
          name: nginx
          repo: https://charts.bitnami.com/bitnami
          version: 15.1.1
          values: |
            service:
              type: ClusterIP
      - name: calico
        kind: "manifest"
        enabled: true
        manifest:
          url: "https://raw.githubusercontent.com/projectcalico/calico/v3.26.3/manifests/calico.yaml"
kubectl get addons -A
NAMESPACE          NAME             STATUS
blueprint-system   calico           Available
blueprint-system   example-server   Progressing
blueprint-system   ss-metallb       Available

@@ -129,6 +129,8 @@ spec:
TagSuffix is the value used to suffix the original tag
If Digest and NewTag is present an error is thrown
type: string
required:
- name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like someone forgot to checkin these changes when this variable was introduced. So, checking it in as part of this PR.

@sakshisharma84 sakshisharma84 changed the title [WIP][BOP-111] add support for enabled field [BOP-111] add support for enabled field Sep 5, 2024
@sakshisharma84 sakshisharma84 requested review from ranyodh and a team September 5, 2024 17:36
funcs.AddonHaveStatusWithin(2*time.Minute, newAddon(a2), v1alpha1.TypeComponentAvailable),
// For some reason, the metallb deployment after the update test suite is run.
// This is causing the test to fail. This is a temporary fix
//funcs.AddonHaveStatusWithin(2*time.Minute, newAddon(a2), v1alpha1.TypeComponentAvailable),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e2e tests have been failing consistently in this repo. On some investigation, I found that Metallb pods fail to come up after the update test suite is run. This requires further detailed debugging. So, I have a temporary fix for it. And please note that this fix does NOT affect uninstallation workflow. So, it is safe.

@sakshisharma84 sakshisharma84 merged commit fb7ffbf into Mirantis:main Sep 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants