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

Make addon yaml templates image name configurable #10063

Closed
lingsamuel opened this issue Dec 30, 2020 · 13 comments · Fixed by #10111
Closed

Make addon yaml templates image name configurable #10063

lingsamuel opened this issue Dec 30, 2020 · 13 comments · Fixed by #10111
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@lingsamuel
Copy link
Contributor

lingsamuel commented Dec 30, 2020

Some registry may have different image name rule, for example:
aliyun ingress image name: registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2, but in the template:

image: {{default "us.gcr.io/k8s-artifacts-prod/ingress-nginx" .ImageRepository}}/controller:v0.40.2

Notice the image name ingress-nginx/controller and nginx-ingress-controller.

We may need more configurable YAML templates.

@springcomefromprogrammingtheworld

I used the command: minicube cache add registry.cn - hangzhou.aliyuncs.com/google_ containers/nginx-ingress-c ontroller:v0.40.2

Then run the command: minicube cache list
result: [spring@bogon .minikube]$ minikube cache list
registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2

Try the command again: minicube addresses enable address

result:[spring@bogon .minikube]$ minikube addons enable ingress
🔎 Verifying ingress addon...

❌ Exiting due to MK_ENABLE: run callbacks: running callbacks: [waiting for app.kubernetes.io/name=ingress-nginx pods: timed out waiting for the condition]

😿 If the above advice does not help, please let us know:
👉 https://github.com/kubernetes/minikube/issues/new/choose

@lingsamuel
Copy link
Contributor Author

lingsamuel commented Dec 30, 2020

@springcomefromprogrammingtheworld It's a bug currently I think... you may need to tag the image as us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.40.2 or registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2 if you are using aliyun as image repository.
Then run minikube cache add us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.40.2.

You could check the image name by run kubectl -n kube-system describe deploy ingress-nginx-controller | grep Image

@springcomefromprogrammingtheworld

@springcomefromprogrammingtheworld It's a bug currently I think... you may need to tag the image as us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.40.2 or registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2 if you are using aliyun as image repository.
Then run minikube cache add us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.40.2.

You could check the image name by run kubectl -n kube-system describe deploy ingress-nginx-controller | grep Image

[spring@bogon .minikube]$ kubectl -n kube-system describe deploy ingress-nginx-controller | grep Image
Image: registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2
.......I feel like I've missed some steps

@lingsamuel
Copy link
Contributor Author

lingsamuel commented Dec 30, 2020

@springcomefromprogrammingtheworld Currently the template is wrong, it renders registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2, notice the last part controller:v0.40.2, the image pulled from aliyun is nginx-ingress-controller:v0.40.2
So you need to retag it.

@springcomefromprogrammingtheworld

@springcomefromprogrammingtheworld Currently the template is wrong, it renders registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2, notice the last part controller:v0.40.2, the image pulled from aliyun is nginx-ingress-controller:v0.40.2

[spring@bogon .minikube]$ minikube cache list
.
registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2

Is that right? A little confused. Are you Chinese?

@springcomefromprogrammingtheworld

@lingsamuel

@lingsamuel
Copy link
Contributor Author

run:

docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2 registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2
minikube cache add registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2

@lingsamuel lingsamuel changed the title aliyun docker registry has a different image name aliyun docker registry has a different ingress-nginx image name Dec 30, 2020
@springcomefromprogrammingtheworld

run:

docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2 registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2
minikube cache add registry.cn-hangzhou.aliyuncs.com/google_containers/controller:v0.40.2

@lingsamuel

oh my god

@lingsamuel lingsamuel changed the title aliyun docker registry has a different ingress-nginx image name Make addon yaml templates more configurable Jan 5, 2021
@lingsamuel
Copy link
Contributor Author

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 5, 2021
@tstromberg
Copy link
Contributor

Can we find a better title for this issue? It's not clear to me what isn't configurable. It's a Go template that can apply nearly any logic you can think of.

PR's welcome to adjust the name of the image appropriately.

@tstromberg tstromberg added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Jan 6, 2021
@lingsamuel lingsamuel changed the title Make addon yaml templates more configurable Make addon yaml templates image name configurable Jan 6, 2021
@springcomefromprogrammingtheworld

The problem has been solved。。。

1.docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2

2.docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v0.40.2 us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.40.2

3.minikube cache add us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.40.2

4.minikube addons enable ingress --alsologtostderr

Thank you for your proposal @lingsamuel

@lingsamuel
Copy link
Contributor Author

lingsamuel commented Jan 8, 2021

Can't find a simple command line way to config addons image names cuz some addons contains many images...
Maybe this format: minikube addons enable ingress --images='IngressController=reg/imageA:v1'.
Yaml template may like this:

image: {{default "us.gcr.io/k8s-artifacts-prod" .ImageRepository}}/{{default "ingress-nginx/controller:v0.40.2" .Images.IngressController}}

To make all image names configurable, we may need some configs at cluster config/somewhere else.

e.g.

$ minikube addons images ingress
Addon "ingress" images:
|-------------------|----------------------------------|-----------------------------------|
| IMAGE CONFIG NAME |            IMAGE NAME            |          IMAGE REPOSITORY         |
|-------------------|----------------------------------|-----------------------------------|
| IngressController | ingress-nginx/controller:v0.40.2 |                                   |
| IngressController | nginx-ingress-controller:v0.40.2 | registry.cn-hangzhou.aliyuncs.com |
|-------------------|----------------------------------|-----------------------------------|

This should be stored system-wide instead of profile and should be related to which image repository being used.

$ minikube addons configure-image ingress
Config format is "registry/image-name", divided by comma
-- Enter custom images for "IngressController": registry.cn-hangzhou.aliyuncs.com/nginx-ingress-controller:v0.40.2

@lingsamuel
Copy link
Contributor Author

/cc @tstromberg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants