-
Notifications
You must be signed in to change notification settings - Fork 68
🌱 Add health probes to test-operator bundles #2311
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
Open
pedjak
wants to merge
2
commits into
operator-framework:main
Choose a base branch
from
pedjak:adjustable-health-propes-test-operator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+87
−16
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
testdata/images/bundles/test-operator/v1.0.0/manifests/script.configmap.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: httpd-script | ||
| data: | ||
| httpd.sh: | | ||
| #!/bin/sh | ||
| echo true > /var/www/started | ||
| echo true > /var/www/ready | ||
| echo true > /var/www/live | ||
| exec httpd -f -h /var/www -p 80 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
testdata/images/bundles/test-operator/v1.2.0/manifests/script.configmap.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: httpd-script | ||
| data: | ||
| httpd.sh: | | ||
| #!/bin/sh | ||
| echo "Version 1.2.0" | ||
| echo true > /var/www/started | ||
| echo true > /var/www/ready | ||
| echo true > /var/www/live | ||
| exec httpd -f -h /var/www -p 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,15 +56,39 @@ spec: | |
| app: olme2etest | ||
| spec: | ||
| terminationGracePeriodSeconds: 0 | ||
| volumes: | ||
| - name: scripts | ||
| configMap: | ||
| name: httpd-script | ||
| defaultMode: 0755 | ||
| containers: | ||
| - name: busybox | ||
| - name: busybox-httpd-container | ||
| image: busybox:1.37 | ||
| command: | ||
| - 'sleep' | ||
| - '1000' | ||
| securityContext: | ||
| runAsUser: 1000 | ||
| runAsNonRoot: true | ||
| command: ["/scripts/httpd.sh"] | ||
| ports: | ||
| - containerPort: 80 | ||
| volumeMounts: | ||
| - name: scripts | ||
| mountPath: /scripts | ||
| readOnly: true | ||
| startupProbe: | ||
| httpGet: | ||
| path: /started | ||
| port: 80 | ||
| failureThreshold: 30 | ||
| periodSeconds: 10 | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /live | ||
| port: 80 | ||
| failureThreshold: 1 | ||
| periodSeconds: 2 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /ready | ||
| port: 80 | ||
| initialDelaySeconds: 1 | ||
| periodSeconds: 1 | ||
| serviceAccountName: simple-bundle-manager | ||
|
||
| clusterPermissions: | ||
| - rules: | ||
|
|
@@ -125,7 +149,7 @@ spec: | |
| verbs: | ||
| - create | ||
| - patch | ||
| serviceAccountName: simple-bundle-manager | ||
| serviceAccountName: simple-bundle-manager | ||
| strategy: deployment | ||
| installModes: | ||
| - supported: false | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR (just to share):
If there’s a strong reason to add probe implementations here (which doesn’t seem to be the case right now), I’d prefer to rely on the existing setup — meaning we can create a bundle using test-operator.
Otherwise, adding probes here feels unnecessary. I’d suggest using the existing test-operator instead.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we ever reached a steady state on the test-operator or use it within our e2es. I'm actually wondering if we should nuke it for now.
The nice thing about having the health and readiness probes defined in this way is that we can very easily change their state at runtime by creating/deleting the files in /var/www, which is great for e2e testing. This is the real value added here by this PR.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be a true point. However, unless we add tests that actually take advantage of it, I don’t see a strong reason to include it.
Could we add some unit tests or use case scenarios that demonstrate where this feature would be helpful? If so, I’d be completely on board with it — that would show not only that this change is useful, but also that it works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will come when we start to lay down more boxcutter tests. This was added to help with manual testing of the conditions changes we've been introducing. I think it's ok to add this now, to reduce the size of PRs later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to move forward, I’m okay with that.
But I think we should properly validate that:
I’d prefer to have at least one test using it, but I won’t block this one! 👍