Skip to content

Conversation

@segfault16
Copy link

Add helm chart for docker plain

Refers to #1013

Tasks:

  • Updated documentation in docs/modules/... directory
  • Ran tests in <quickstarter>/testdata directory
  • Shared library adaptions

@faust2199
Copy link
Contributor

Having a very strict values.schema.json is probably not going to provide good experience when using helmValues defined from the Jenkinsfile. According to https://helm.sh/docs/topics/charts/ , "the schema is applied to the final .Values object, and not just to the values.yaml file."

Let's say we have the following in the Jenkinsfile:
odsComponentStageRolloutOpenShiftDeployment(context, [ 'selector': "app.kubernetes.io/name=${context.componentId}", 'helmEnvBasedValuesFiles': ['values.env.yaml'], 'helmValues': [ 'foo': 'bar' ] ]

When the above runs on Jenkins, ods-jenkins-shared-library will add two arguments on the command line:
--set foo=bar --set global.foo=bar

Then it will be aborted because additionalProperties are not allowed in both places. Is the user really expected to add two entries in values.schema.json to fix this?

I suggest that we remove the whole values.schema.json file. If the result of rendering is bad, helm upgrade is going to fail and rollback anyway.

@renedupont
Copy link
Member

Having a very strict values.schema.json is probably not going to provide good experience when using helmValues defined from the Jenkinsfile. According to https://helm.sh/docs/topics/charts/ , "the schema is applied to the final .Values object, and not just to the values.yaml file."

Let's say we have the following in the Jenkinsfile: odsComponentStageRolloutOpenShiftDeployment(context, [ 'selector': "app.kubernetes.io/name=${context.componentId}", 'helmEnvBasedValuesFiles': ['values.env.yaml'], 'helmValues': [ 'foo': 'bar' ] ]

When the above runs on Jenkins, ods-jenkins-shared-library will add two arguments on the command line: --set foo=bar --set global.foo=bar

Then it will be aborted because additionalProperties are not allowed in both places. Is the user really expected to add two entries in values.schema.json to fix this?

I suggest that we remove the whole values.schema.json file. If the result of rendering is bad, helm upgrade is going to fail and rollback anyway.

I partially agree, I think there is a middle way though. In the values.schema.json we could set "additionalProperties": false to true in the relevant parts. That way we validate everything that is set in that file and everything else will not be considered and not lead to failing the helm validation.

serverhorror
serverhorror previously approved these changes Feb 7, 2025
Copy link
Contributor

@jafarre-bi jafarre-bi left a comment

Choose a reason for hiding this comment

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

A few new comments and some conversations still open.

}
odsComponentStageRolloutOpenShiftDeployment(context)
odsComponentStageRolloutOpenShiftDeployment(context, [
'selector': "app.kubernetes.io/name=${context.componentId}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this selector only the name? chart.selectorLables are, as they should, name + instance.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this selector only the name? chart.selectorLables are, as they should, name + instance.

Do you mean https://kubernetes.io/docs/reference/labels-annotations-taints/#app-kubernetes-io-instance? How do we generate the unique postfix like in the example given "mysql-abcxyz"?

Copy link
Contributor

@jafarre-bi jafarre-bi Feb 12, 2025

Choose a reason for hiding this comment

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

@faust2199 Unless there's something I'm missing, the deployment.yaml is using chart.selectorLabels for the selector. This is defined in _helpers.tpl to be name = chart.name and instance = .Release.Name. Whatever we use it must match the actual selectors used in deployments, services...

Copy link
Contributor

Choose a reason for hiding this comment

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

My questions here are:

  1. Is the chart name always equal to the componentId?
  2. Will the functionality of getting resources based only on the name label never return resources that shouldn't match?
  3. Is it correct to specify this selector in the deployment mean when the actual selector used is different? (For this I would answer no)

Copy link
Contributor

Choose a reason for hiding this comment

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

As agreed in the meeting, we will make the helmReleaseName config parameter explicit and add it to the selector to match the actual selector used in the deployments.

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
Copy link
Contributor

Choose a reason for hiding this comment

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

The Release Manager doesn't support multiple replicas yet. Not sure if these values should even be configurable, or at least maxReplicas should be 1 by default, with a comment saying that higher values aren't supported.

Copy link
Author

Choose a reason for hiding this comment

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

@jafarre-bi I don't know about this limitation, there's nothing in opendevstack documentation about. Please provide the source

Copy link
Contributor

@jafarre-bi jafarre-bi Feb 12, 2025

Choose a reason for hiding this comment

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

@segfault16 HelmDeploymentStrategy, line 198:
// TODO: Once the orchestration pipeline can deal with multiple replicas,
// update this to store multiple pod artifacts.
Even if the code could deal with it and the documentation and traceability would be correctly preserved, it's still not officially supported. We would need to validate the functionality, document it and create specific automated tests to prevent regressions.

Copy link
Contributor

Choose a reason for hiding this comment

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

As agreed, I will see if we are on time to add a note stating that multiple replicas are currently unsupported to the official documentation. We will add a comment to this values file referencing that to warn the users to use this at their own risk.

Copy link
Contributor

Choose a reason for hiding this comment

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

The default value for maxReplicas must be 1. Using (unsupported) multiple replicas must be an informed opt-in.

Copy link
Contributor

@jafarre-bi jafarre-bi left a comment

Choose a reason for hiding this comment

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

Adding comments to the open conversations with the outcome of the meeting we just had.

}
odsComponentStageRolloutOpenShiftDeployment(context)
odsComponentStageRolloutOpenShiftDeployment(context, [
'selector': "app.kubernetes.io/name=${context.componentId}",
Copy link
Contributor

Choose a reason for hiding this comment

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

As agreed in the meeting, we will make the helmReleaseName config parameter explicit and add it to the selector to match the actual selector used in the deployments.

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
Copy link
Contributor

Choose a reason for hiding this comment

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

As agreed, I will see if we are on time to add a note stating that multiple replicas are currently unsupported to the official documentation. We will add a comment to this values file referencing that to warn the users to use this at their own risk.

@segfault16
Copy link
Author

@jafarre-bi is the official doc updated?

serverhorror
serverhorror previously approved these changes Sep 2, 2025
@jafarre-bi
Copy link
Contributor

@jafarre-bi is the official doc updated?

The change in the documentation has been merged into master through opendevstack/ods-jenkins-shared-library#1245

@jafarre-bi
Copy link
Contributor

As agreed in the meeting, we will make the helmReleaseName config parameter explicit and add it to the selector to match the actual selector used in the deployments.

Has this open point been addressed?
If we can close the open points in the next few days, we aim to release the Helm quickstarter in the next EDP release, which will start mid-November.
Please, @faust2199 , @segfault16, and everyone else, we are almost there —let's work together to close this.
Thank you!

@segfault16
Copy link
Author

@jafarre-bi selectors and doc updated, please test rollout to production and merge on success

Copy link
Contributor

@jafarre-bi jafarre-bi left a comment

Choose a reason for hiding this comment

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

@segfault16, please see the comments to the latest changes.

*/
odsComponentStageBuildOpenShiftImage(context)
}
def releaseName = context.componentId // can be customized as needed
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be explicit that it must match .Release.Name. Otherwise, it will still be inconsistent with the selector used elsewhere.

Copy link
Author

Choose a reason for hiding this comment

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

@jafarre-bi we're supplying the same releaseName to helm upgrade (via helmReleaseName) as we use in the selector. .Release.Name is given by releaseName, we specify the selector. What inconsistency are you referring to?

memory: 16Mi
ephemeral-storage: 1Mi

## Before enabling check the official ODS documentation about replicate support: https://www.opendevstack.org/ods-documentation/opendevstack/latest/jenkins-shared-library/orchestration-pipeline.html#_known_limitations
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea to link to the official docs, but it's not enough, since many people will miss it. Please, make the warning explicit: multiple replicas aren't currently supported by the orchestration pipeline.

Copy link
Author

Choose a reason for hiding this comment

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

@jafarre-bi we agreed on this in July and I've been waiting for the official doc to reference since then. Those values will get templated and there's no way to keep this information up-to-date then. the reference will stay valid longer.

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
Copy link
Contributor

Choose a reason for hiding this comment

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

The default value for maxReplicas must be 1. Using (unsupported) multiple replicas must be an informed opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants