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

For Ansible/Helm-based operators, add Liveness and Readiness probe #4326

Merged
merged 3 commits into from
Dec 18, 2020

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Dec 16, 2020

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:

Checklist

If the pull request includes user-facing changes, extra documentation is required:

estroz
estroz previously requested changes Dec 16, 2020
internal/cmd/ansible-operator/run/cmd.go Show resolved Hide resolved
@estroz
Copy link
Member

estroz commented Dec 16, 2020

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 healthz.Ping and can't be configured by helm/ansible artifacts.

Copy link
Member

@asmacdo asmacdo left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2020
@@ -183,6 +179,7 @@ func run(cmd *cobra.Command, f *flags.Flags) {
}, w.Blacklist)
}

// todo: remove when a upper version be bumped
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2020
Copy link
Member

@jmrodri jmrodri left a 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.

camilamacedo86 and others added 2 commits December 17, 2020 19:12
Co-authored-by: Eric Stroczynski <estroczy@redhat.com>
Co-authored-by: Eric Stroczynski <estroczy@redhat.com>
@camilamacedo86 camilamacedo86 dismissed estroz’s stale review December 18, 2020 16:34

all suggestions are addressed so it shows fine for we move on.

@camilamacedo86 camilamacedo86 merged commit ea43495 into operator-framework:master Dec 18, 2020
@camilamacedo86 camilamacedo86 deleted the issue-1234 branch December 18, 2020 16:34
reinvantveer pushed a commit to reinvantveer/operator-sdk that referenced this pull request Feb 5, 2021
…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 <rein.van.t.veer@geodan.nl>
rearl-scwx pushed a commit to rearl-scwx/operator-sdk that referenced this pull request Feb 5, 2021
…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: rearl <rearl@secureworks.com>
Copy link
Contributor

@flozzone flozzone left a 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`:
Copy link
Contributor

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.

Copy link
Contributor

@flozzone flozzone left a 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

readinessProbe using /healthz endpoint

Comment on lines +127 to +139
livenessProbe:
httpGet:
path: /readyz
port: 6789
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /healthz
port: 6789
initialDelaySeconds: 5
periodSeconds: 10
Copy link
Contributor

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.

Comment on lines +34 to +45
livenessProbe:
httpGet:
path: /readyz
port: 6789
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 6789
initialDelaySeconds: 5
periodSeconds: 10
Copy link
Contributor

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.

Comment on lines +212 to +224
livenessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
Copy link
Contributor

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.

Comment on lines +31 to +42
livenessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
Copy link
Contributor

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.

@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Feb 16, 2021

HI @flozzone,

Thank you for your contribution? WDYT about todo a pr against the branches and master to update the info.?

waynesun09 added a commit to waynesun09/reportportal-operator that referenced this pull request Apr 21, 2021
@ramperher ramperher mentioned this pull request Jan 9, 2024
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.

None yet

6 participants