Skip to content

Commit a7efef1

Browse files
committed
configurable pull secrets, no defaults
1 parent d48aa89 commit a7efef1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

apps/supervisor/src/env.ts

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const Env = z.object({
4242
DOCKER_NETWORK: z.string().default("host"),
4343
OTEL_EXPORTER_OTLP_ENDPOINT: z.string().url(),
4444
ENFORCE_MACHINE_PRESETS: z.coerce.boolean().default(false),
45+
KUBERNETES_IMAGE_PULL_SECRETS: z.string().optional(), // csv
4546

4647
// Used by the resource monitor
4748
OVERRIDE_CPU_TOTAL: z.coerce.number().optional(),

apps/supervisor/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class ManagedSupervisor {
9797
workloadApiDomain,
9898
workloadApiPort: workloadApiPortExternal,
9999
warmStartUrl: this.warmStartUrl,
100+
imagePullSecrets: env.KUBERNETES_IMAGE_PULL_SECRETS?.split(","),
100101
});
101102
} else {
102103
this.resourceMonitor = new DockerResourceMonitor(new Docker());

apps/supervisor/src/workloadManager/kubernetes.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,15 @@ export class KubernetesWorkloadManager implements WorkloadManager {
182182
}
183183
}
184184

185+
private getImagePullSecrets(): k8s.V1LocalObjectReference[] | undefined {
186+
return this.opts.imagePullSecrets?.map((name) => ({ name }));
187+
}
188+
185189
get #defaultPodSpec(): Omit<k8s.V1PodSpec, "containers"> {
186190
return {
187191
restartPolicy: "Never",
188192
automountServiceAccountToken: false,
189-
imagePullSecrets: [
190-
{
191-
name: "registry-trigger",
192-
},
193-
{
194-
name: "registry-trigger-failover",
195-
},
196-
],
193+
imagePullSecrets: this.getImagePullSecrets(),
197194
nodeSelector: {
198195
nodetype: "worker-re2",
199196
},

apps/supervisor/src/workloadManager/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface WorkloadManagerOptions {
55
workloadApiDomain?: string; // If unset, will use orchestrator-specific default
66
workloadApiPort: number;
77
warmStartUrl?: string;
8+
imagePullSecrets?: string[];
89
}
910

1011
export interface WorkloadManager {

0 commit comments

Comments
 (0)