-
Notifications
You must be signed in to change notification settings - Fork 1.8k
For Ansible/Helm-based operators, add Liveness and Readiness probe #4326
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
For Ansible/Helm-based operators, add Liveness and Readiness probe #4326
Conversation
One thing to be aware of (not blocking), and probably encoded in the changelog fragment's migration guide: these probes now are hard-coded to |
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.
/lgtm
@@ -183,6 +179,7 @@ func run(cmd *cobra.Command, f *flags.Flags) { | |||
}, w.Blacklist) | |||
} | |||
|
|||
// todo: remove when a upper version be bumped |
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.
it might be a good idea to file an issue for this and put a "backwards incompatible" label, or put this in the 2.0 milestone. Otherwise, we will probably forget this when we bump to 2.0.0
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.
New changes are detected. LGTM label has been removed. |
internal/plugins/ansible/v1/scaffolds/internal/templates/config/manager/manager.go
Outdated
Show resolved
Hide resolved
internal/plugins/ansible/v1/scaffolds/internal/templates/config/manager/manager.go
Outdated
Show resolved
Hide resolved
internal/plugins/helm/v1/scaffolds/internal/templates/config/manager/manager.go
Show resolved
Hide resolved
internal/plugins/helm/v1/scaffolds/internal/templates/config/manager/manager.go
Show resolved
Hide resolved
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 agree with @estroz that the port should remain the same, and if people want to change it they can specify 8081. I know this means that go and ansible/helm will diverge, but I think that's okay.
Co-authored-by: Eric Stroczynski <[email protected]>
Co-authored-by: Eric Stroczynski <[email protected]>
all suggestions are addressed so it shows fine for we move on.
…perator-framework#4326) **Description of the change:** - Add the probes for Helm/Ansible by default as it was done for Golang go/v3 in upstream. - For Ansible/Helm-based operators, added new flag `--health-probe-bind-address` to allow customize the probe port used. - For Ansible-based operators, deprecated the ping endpoint **Motivation for the change:** - operator-framework#1234 Signed-off-by: reinvantveer <[email protected]>
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.
The Upgrade SDK version
guide for version 1.4.2 contains a wrong path to the manager resource in the For Helm-based operators, add Liveness and Readiness probe
and For Ansible-based operators, add Liveness and Readiness probe
section.
|
||
You can update your pre-existing project to use them. For that update the Dockerfile to use the latest | ||
release base image, then add the following to the `manager` container in | ||
`config/default/manager/manager.yaml`: |
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.
The path to the manager resource seems to be wrong. Should be config/manager/manager.yaml
instead.
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 always compare (diff -r
) my repository with the one freshly generated by operator-sdk init
to see which things I changed or have been introduced by a new version. While doing so, I saw that the manager resource includes the changes mentioned in version 1.4.0 of the 'Upgrade SDK version guide. But while the guide says to use
/readyzendpoint for the readinessProbe and
/healthz` endpoint for the livenessProbe, the generated project uses the endpoints the other way around:
config/manager/manager.yaml:
livenessProbe:
httpGet:
path: /readyz
port: 6789
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 6789
initialDelaySeconds: 5
periodSeconds: 10
I guess the upgrade guide shows it correctly but is wrong for generated projects.
$ operator-sdk version
operator-sdk version: "v1.4.2", commit: "4b083393be65589358b3e0416573df04f4ae8d9b", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64"
Should I open an issue for this?
@@ -78,5 +78,17 @@ spec: | |||
- name: ANSIBLE_GATHERING | |||
value: explicit | |||
image: {{ .Image }} | |||
livenessProbe: | |||
httpGet: | |||
path: /readyz |
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.
livenessProbe using /readyz
endpoint
periodSeconds: 20 | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz |
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.
readinessProbe using /healthz
endpoint
livenessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 6789 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
name: manager | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 6789 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 |
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.
livenessProbe using /readyz endpoint and readinessProbe using /healthz endpoint. Should be the other way around I guess.
livenessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 6789 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 6789 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 |
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.
livenessProbe using /readyz endpoint and readinessProbe using /healthz endpoint. Should be the other way around I guess.
livenessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
name: manager | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 |
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.
livenessProbe using /readyz endpoint and readinessProbe using /healthz endpoint. Should be the other way around I guess.
livenessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 |
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.
livenessProbe using /readyz endpoint and readinessProbe using /healthz endpoint. Should be the other way around I guess.
HI @flozzone, Thank you for your contribution? WDYT about todo a pr against the branches and master to update the info.? |
Related to operator-sdk v1.4.0 upgrade: https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.4.0/ operator-framework/operator-sdk#4326 Signed-off-by: Wayne Sun <[email protected]>
Description of the change:
--health-probe-bind-address
to allow customize the probe port used.Motivation for the change:
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs