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

chore(docs): document how to set imagePullSecrets in baseJobTemplate #446

Merged
merged 6 commits into from
Feb 11, 2025

Conversation

mitchnielsen
Copy link
Contributor

@mitchnielsen mitchnielsen commented Feb 10, 2025

Summary

Documents how to set imagePullSecrets in the baseJobTemplate.

Will be expanded as part of https://linear.app/prefect/issue/PLA-1020/expand-documentation-on-how-to-use-basejobtemplate

Closes https://linear.app/prefect/issue/PLA-1029/document-how-to-set-image-pull-secrets-in-the-base-job-template

Testing

I installed the prefect-server chart, and then deployed the prefect-worker chart with this config:

worker:
  apiConfig: server
  serverApiConfig:
    apiUrl: http://prefect-server.prefect.svc.cluster.local:4200/api
  config:
    workPool: test-pool
    baseJobTemplate:
      configuration: |
        # ...

I then confirmed the configuration appeared as expected in the UI.

'.Values' is how values are referenced from within Helm templates, not
how end users set it.
@mitchnielsen mitchnielsen self-assigned this Feb 10, 2025
Comment on lines 259 to 268
"spec": {
"template": {
"spec": {
"imagePullSecrets": [
{
"name": "my-pull-secret"
}
]
}
}
Copy link
Contributor Author

@mitchnielsen mitchnielsen Feb 10, 2025

Choose a reason for hiding this comment

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

$ k explain deployment.spec.template.spec.imagePullSecrets
GROUP:      apps
KIND:       Deployment
VERSION:    v1

FIELD: imagePullSecrets <[]LocalObjectReference>


DESCRIPTION:
    ImagePullSecrets is an optional list of references to secrets in the same
    namespace to use for pulling any of the images used by this PodSpec. If
    specified, these secrets will be passed to individual puller implementations
    for them to use. More info:
    https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
    LocalObjectReference contains enough information to let you locate the
    referenced object inside the same namespace.

FIELDS:
  name  <string>
    Name of the referent. This field is effectively required, but due to
    backwards compatibility is allowed to be empty. Instances of this type with
    an empty value here are almost certainly wrong. More info:
    https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

@mitchnielsen mitchnielsen marked this pull request as ready for review February 10, 2025 22:41
@mitchnielsen mitchnielsen requested a review from a team as a code owner February 10, 2025 22:41

1. Define the base job template in a local file. To get a formatted template, run the following command & store locally in `base-job-template.json`
**Note**: if the target work pool (`config.workPool`) already exists, the base job template passed **will be ignored**.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this definitely true? In my testing, I was able to modify the base job template and each time it would update the configuration seen in the UI - even though I created the work pool before attaching the worker.

Copy link
Contributor

Choose a reason for hiding this comment

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

hm good question. it is true i think - but maybe with the addition of the init container it is no longer true for our helm charts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I bet that's it, since we're directly using prefect work-pool update <json-file> now. I'll remove that warning.

Now that we have the initContainer that calls `prefect work-pool
update`, updates are indeed respected.
@mitchnielsen mitchnielsen merged commit 4810162 into main Feb 11, 2025
13 checks passed
@mitchnielsen mitchnielsen deleted the basejobtemplate-imagepullsecrets branch February 11, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants