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

setting imagePullSecrets for workers #652

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/arroyo-controller/src/schedulers/kubernetes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl KubernetesScheduler {
"spec": {
"volumes": c.worker.volumes,
"restartPolicy": "Never",
"imagePullSecrets": c.worker.image_pull_secrets,
"containers": [
{
"name": "worker",
Expand Down
7 changes: 6 additions & 1 deletion crates/arroyo-rpc/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use arc_swap::ArcSwapOption;
use figment::providers::{Env, Format, Json, Toml, Yaml};
use figment::Figment;
use k8s_openapi::api::core::v1::{EnvVar, ResourceRequirements, Volume, VolumeMount};
use k8s_openapi::api::core::v1::{
EnvVar, LocalObjectReference, ResourceRequirements, Volume, VolumeMount,
};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::OwnerReference;
use log::warn;
use regex::Regex;
Expand Down Expand Up @@ -518,6 +520,9 @@ pub struct KubernetesWorkerConfig {

pub image_pull_policy: String,

#[serde(default)]
pub image_pull_secrets: Vec<LocalObjectReference>,

pub service_account_name: String,

#[serde(default)]
Expand Down
6 changes: 5 additions & 1 deletion k8s/arroyo/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ data:
{{- end }}
image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag }}"
image-pull-policy: "{{ .Values.worker.image.pullPolicy }}"
image-pull-secrets:
{{- with .Values.imagePullSecrets }}
Copy link
Member

Choose a reason for hiding this comment

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

image_pull_secrets is defined as a string, but here it's passed in an object which fails:

Configuration is invalid!
  • invalid type: found unit, expected a string for key "default.kubernetes-scheduler.worker.image-pull-secrets" in /root/.config/arroyo/config.yaml YAML file

{{- toYaml . | nindent 10 }}
{{- end }}
resources: {{ .Values.worker.resources | toYaml | nindent 10 }}
service-account-name: {{ .Values.serviceAccount.name | quote }}
volumes:
Expand All @@ -83,4 +87,4 @@ data:
- name: arroyo-user-config
mountPath: /config
{{- end }}
command: "/app/arroyo --config-dir /config worker"
command: "/app/arroyo --config-dir /config worker"
2 changes: 1 addition & 1 deletion k8s/arroyo/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
- name: arroyo-user-config
mountPath: /config
{{- end }}

env:
{{- if .Values.postgresql.deploy }}
- name: ARROYO__DATABASE__POSTGRES__PASSWORD
Expand Down
Loading