coreos / etcd-operator

etcd operator creates/configures/manages etcd clusters atop Kubernetes
https://coreos.com/blog/introducing-the-etcd-operator.html
Apache License 2.0
1.75k stars 741 forks source link

Busybox configurable image repository #2153

Closed AlexsJones closed 4 years ago

AlexsJones commented 4 years ago

Working at a large company, we often need to resolve images via internalproxy.largecompany.com/busybox:latest I've not seen an option through the helm chart or the operator configuration itself to be able to do so e.g. etcdCluster.busybox.image.repository .

This currently impedes our adoption as the image pull fails when we inject a cluster CRD.

Looks like this line https://github.com/coreos/etcd-operator/blob/b2a63ce924602be64a156361f3ee85498843026a/pkg/util/k8sutil/k8sutil.go#L65

Could use some configuration that can be overridden here:

func imageNameBusybox(policy *api.PodPolicy) string {
    if policy != nil && len(policy.BusyboxImage) > 0 {
        return policy.BusyboxImage
    }
    return defaultBusyboxImage
}

Question: I can see the PodPolicy can override default image, but how do you achieve this outside the code?

TomHellier commented 4 years ago

https://github.com/coreos/etcd-operator/blob/8347d27afa18b6c76d4a8bb85ad56a2e60927018/pkg/apis/etcd/v1beta2/cluster.go#L150

you need to define /spec/pod/busyboxImage: 'internalproxy.largecompany.com/busybox:latest' in your crd yaml

apiVersion: etcd.database.coreos.com/v1beta2
kind: EtcdCluster
AlexsJones commented 4 years ago

Thanks @TomHellier will check tomorrow and close this out if it works.