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

be able to disable namespace watching by configuring the operator watches file #257

Merged
merged 1 commit into from
May 3, 2024

Conversation

jmazzitelli
Copy link
Contributor

part of: kiali/kiali#7322

@jmazzitelli
Copy link
Contributor Author

jmazzitelli commented Apr 30, 2024

To test,

  1. Build the helm charts: make build-helm-charts
  2. See that the default behavior still generates the proper watches file. Run helm template --show-only templates/deployment.yaml _output/charts/kiali-operator-*.tgz and see the following in the Deployment yaml that is generated:
...
        - "--watches-file=./$(WATCHES_FILE)"
...
        - name: WATCHES_FILE
          value: "watches-k8s.yaml"
...
  1. Now set a watches file: helm template --show-only templates/deployment.yaml --set watchesFile=watches-os-ns.yaml _output/charts/kiali-operator*.tgz and see that the env var value for WATCHES_FILE changed:
...
        - "--watches-file=./$(WATCHES_FILE)"
...
        - name: WATCHES_FILE
          value: "watches-os-ns.yaml"
...
  1. You can install it to see it still works. Start a k8s cluster (like minikube) and run helm install --create-namespace -n kiali-operator --set image.tag=latest kiali-operator _output/charts/kiali-operator-*.tgz
  2. At this point, confirm the operator starts up and is Running: kubectl get pods -n kiali-operator
  3. See that the container args has --watches-files=./$(WATCHES_FILE):
$ kubectl get pod -n kiali-operator -l app.kubernetes.io/name=kiali-operator -o jsonpath='{..spec.containers..args[2]}{"\n"}'
--watches-file=./$(WATCHES_FILE)
  1. You can uninstall after your test by running helm uninstall -n kiali-operator kiali-operator

@hhovsepy hhovsepy self-requested a review May 3, 2024 12:36
Copy link
Contributor

@hhovsepy hhovsepy left a comment

Choose a reason for hiding this comment

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

Verified in a scope of operator PR testing on remote OCP cluster.

@jmazzitelli jmazzitelli merged commit 5703675 into kiali:master May 3, 2024
1 check passed
@jmazzitelli jmazzitelli deleted the 7322-config-ns-watch branch May 3, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires operator PR Requires changes to the operator
Projects
Development

Successfully merging this pull request may close these issues.

2 participants