Skip to content

Commit

Permalink
[installer]: add image pull secrets to third-party container images
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms committed Dec 1, 2021
1 parent 8844ed5 commit 3c6f215
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 16 deletions.
4 changes: 2 additions & 2 deletions installer/pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ func MessageBusWaiterContainer(ctx *RenderContext) *corev1.Container {
}
}

func KubeRBACProxyContainer() *corev1.Container {
func KubeRBACProxyContainer(ctx *RenderContext) *corev1.Container {
return &corev1.Container{
Name: "kube-rbac-proxy",
Image: "quay.io/brancz/kube-rbac-proxy:v0.11.0",
Image: ImageName(ThirdPartyContainerRepo(ctx.Config.Repository, KubeRBACProxyRepo), KubeRBACProxyImage, KubeRBACProxyTag),
Args: []string{
"--v=5",
"--logtostderr",
Expand Down
4 changes: 4 additions & 0 deletions installer/pkg/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ const (
BlobServeServicePort = 4000
CertManagerCAIssuer = "ca-issuer"
DockerRegistryName = "registry"
GitpodContainerRegistry = "eu.gcr.io/gitpod-core-dev/build"
InClusterDbSecret = "mysql"
InClusterMessageQueueName = "rabbitmq"
InClusterMessageQueueTLS = "messagebus-certificates-secret-core"
KubeRBACProxyRepo = "quay.io/brancz"
KubeRBACProxyImage = "kube-rbac-proxy"
KubeRBACProxyTag = "v0.11.0"
MinioServiceAPIPort = 9000
MonitoringChart = "monitoring"
ProxyComponent = "proxy"
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/agent-smith/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
Privileged: pointer.Bool(true),
ProcMount: func() *corev1.ProcMountType { r := corev1.DefaultProcMount; return &r }(),
},
}, *common.KubeRBACProxyContainer()},
}, *common.KubeRBACProxyContainer(ctx)},
Volumes: []corev1.Volume{{
Name: "config",
VolumeSource: corev1.VolumeSource{ConfigMap: &corev1.ConfigMapVolumeSource{
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/blobserve/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
MountPath: "/mnt/pull-secret.json",
SubPath: ".dockerconfigjson",
}},
}, *common.KubeRBACProxyContainer()},
}, *common.KubeRBACProxyContainer(ctx)},
},
},
},
Expand Down
1 change: 1 addition & 0 deletions installer/pkg/components/database/init/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package init

const (
Component = "dbinit"
dbSessionsRepo = "docker.io"
dbSessionsImage = "mysql"
dbSessionsTag = "5.7.34"
initScriptDir = "files"
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/database/init/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func job(ctx *common.RenderContext) ([]runtime.Object, error) {
InitContainers: []corev1.Container{*common.DatabaseWaiterContainer(ctx)},
Containers: []corev1.Container{{
Name: fmt.Sprintf("%s-session", Component),
Image: fmt.Sprintf("%s:%s", dbSessionsImage, dbSessionsTag),
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, dbSessionsRepo), dbSessionsImage, dbSessionsTag),
ImagePullPolicy: corev1.PullIfNotPresent,
Env: common.MergeEnv(
common.DatabaseEnv(&ctx.Config),
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/image-builder-mk3/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
*common.InternalCAVolumeMount(),
},
},
*common.KubeRBACProxyContainer(),
*common.KubeRBACProxyContainer(ctx),
},
},
},
Expand Down
8 changes: 6 additions & 2 deletions installer/pkg/components/proxy/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ const (
ContainerHTTPSPort = common.ProxyContainerHTTPSPort
ContainerHTTPSName = common.ProxyContainerHTTPSName
PrometheusPort = 9500
InitContainerImage = "alpine:3.14"
KubeRBACProxyImage = "quay.io/brancz/kube-rbac-proxy:v0.11.0"
InitContainerRepo = "docker.io"
InitContainerImage = "alpine"
InitContainerTag = "3.14"
KubeRBACProxyRepo = common.KubeRBACProxyRepo
KubeRBACProxyImage = common.KubeRBACProxyImage
KubeRBACProxyTag = common.KubeRBACProxyTag
MetricsContainerName = "metrics"
ReadinessPort = 8003
RegistryAuthSecret = common.RegistryAuthSecret
Expand Down
4 changes: 2 additions & 2 deletions installer/pkg/components/proxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
Volumes: volumes,
InitContainers: []corev1.Container{{
Name: "sysctl",
Image: InitContainerImage,
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, InitContainerRepo), InitContainerImage, InitContainerTag),
ImagePullPolicy: corev1.PullIfNotPresent,
SecurityContext: &corev1.SecurityContext{
Privileged: pointer.Bool(true),
Expand All @@ -142,7 +142,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
}},
Containers: []corev1.Container{{
Name: "kube-rbac-proxy",
Image: KubeRBACProxyImage,
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, KubeRBACProxyRepo), KubeRBACProxyImage, KubeRBACProxyTag),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{
"--v=10",
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/registry-facade/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
}, volumeMounts...),
},

*common.KubeRBACProxyContainer(),
*common.KubeRBACProxyContainer(ctx),
},
Volumes: append([]corev1.Volume{{
Name: "cache",
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/server/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
MountPath: "/ws-manager-client-tls-certs",
ReadOnly: true,
}},
}, *common.KubeRBACProxyContainer()},
}, *common.KubeRBACProxyContainer(ctx)},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions installer/pkg/components/ws-daemon/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
initContainers := []corev1.Container{
{
Name: "disable-kube-health-monitor",
Image: "ubuntu:20.04",
Image: common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, "docker.io"), "ubuntu", "20.04"),
Command: []string{
"/usr/bin/nsenter",
"-t",
Expand Down Expand Up @@ -281,7 +281,7 @@ fi
Privileged: pointer.Bool(true),
},
},
*common.KubeRBACProxyContainer(),
*common.KubeRBACProxyContainer(ctx),
},
RestartPolicy: "Always",
TerminationGracePeriodSeconds: pointer.Int64(30),
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/ws-manager-bridge/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
MountPath: "/ws-manager-client-tls-certs",
ReadOnly: true,
}},
}, *common.KubeRBACProxyContainer()},
}, *common.KubeRBACProxyContainer(ctx)},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/components/ws-scheduler/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
MountPath: "/ws-manager-client-tls-certs",
ReadOnly: true,
}},
}, *common.KubeRBACProxyContainer()},
}, *common.KubeRBACProxyContainer(ctx)},
},
},
},
Expand Down

0 comments on commit 3c6f215

Please sign in to comment.