-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add healthz liveness probe Sets up a Ping healthz endpoint (ping) Adds a liveness probe to ansible operator deployment scaffolding * why doesnt molecule work * fix scaffold * rm dev artifacts * molecule liveness FAILING * Add e2e and e2e molecule liveness tests * check err * add changelog and comments * add example to migration instructions * reformat migration header
- Loading branch information
Showing
8 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,46 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: > | ||
The Ansible operator now includes a healthz endpoint and liveness probe. | ||
All operators will now have a running healthz endpoint (not publicly | ||
exposed) without changes. Existing Oper | ||
# kind is one of: | ||
# - addition | ||
# - change | ||
# - deprecation | ||
# - removal | ||
# - bugfix | ||
kind: "addition" | ||
# Is this a breaking change? | ||
breaking: false | ||
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS | ||
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST! | ||
# | ||
# The generator auto-detects the PR number from the commit | ||
# message in which this file was originally added. | ||
# | ||
# What is the pull request number (without the "#")? | ||
# pull_request_override: 0 | ||
# Migration can be defined to automatically add a section to | ||
# the migration guide. This is required for breaking changes. | ||
migration: | ||
header: (Optional) Add livenessProbe check for Ansible-based operators | ||
body: > | ||
Existing operators will have a healthz endpoint without intervention, | ||
but to take advantage of it, a liveness probe should be manually added | ||
to the operator manifest. For example, the `deploy/operator.yaml` file would need to include: | ||
```yaml | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 6789 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 3 | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,16 @@ | ||
- name: get the operator pod | ||
set_fact: | ||
op_pod: "{{ lookup('k8s', kind='Pod', label_selector='name=ansible') }}" | ||
|
||
- name: Check for liveness probe failure events | ||
# We can't directly hit the endpoint, which is not publicly exposed. If k8s sees a failing endpoint, it will create a "Killing" event. | ||
k8s_info: | ||
kind: Event | ||
field_selectors: | ||
- "involvedObject.name={{ op_pod.metadata.name }}" | ||
- "reason=Killing" | ||
register: liveness_failures | ||
|
||
- name: Assert that the Pod has not been liveness probe Killed | ||
assert: | ||
that: liveness_failures.resources|length == 0 |
This file contains 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