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

fix: Add liveness and readiness probes #339

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

Sovietaced
Copy link
Contributor

@Sovietaced Sovietaced commented Nov 21, 2024

Description

The pull request updates various controllers to add readiness & liveness probes to containers where applicable. These probes should help indicate when it is safe to cutover to new deployments.

I cross referenced https://github.com/armadaproject/armada/tree/master/deployment (I may have found some bugs in here tho) as well as each application's config structs to understand which ports they expose.

Fixes #334

Type of change

Please select the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code Style Update (formatting, renaming)
  • Refactor (code changes that do not fix a bug or add a feature)
  • Documentation Update
  • Other (please describe):

How Has This Been Tested?

Added unit tests to assert the fully generated deployment with probes.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

@@ -274,10 +275,12 @@ func (r *ExecutorReconciler) createDeployment(
ImagePullPolicy: corev1.PullIfNotPresent,
Image: ImageString(executor.Spec.Image),
Args: []string{appConfigFlag, appConfigFilepath},
Ports: newContainerPortsMetrics(config),
Ports: newContainerPortsHTTPWithMetrics(config),
Copy link
Contributor Author

@Sovietaced Sovietaced Nov 23, 2024

Choose a reason for hiding this comment

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

This is a bug fix since the executor does have an HTTP server.

@@ -314,10 +315,12 @@ func newSchedulerDeployment(
ImagePullPolicy: corev1.PullIfNotPresent,
Image: ImageString(scheduler.Spec.Image),
Args: []string{"run", appConfigFlag, appConfigFilepath},
Ports: newContainerPortsGRPCWithMetrics(config),
Ports: newContainerPortsAll(config),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another bug fix since the scheduler has all the ports.

@@ -371,6 +380,36 @@ func createEnv(crdEnv []corev1.EnvVar) []corev1.EnvVar {
return envVars
}

func CreateProbesWithScheme(scheme corev1.URIScheme) (*corev1.Probe, *corev1.Probe) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The values here are pretty standardized for now but we might want to support customization later.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, seems good enough for starters.

@Sovietaced Sovietaced marked this pull request as ready for review November 25, 2024 17:47
@Sovietaced Sovietaced requested a review from dejanzele November 25, 2024 17:48
Signed-off-by: Jason Parraga <[email protected]>
@dejanzele dejanzele merged commit 100a0e7 into armadaproject:main Nov 26, 2024
15 checks passed
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.

Controller should include readiness/liveness checks in deployments
2 participants