[英]How to install kubernetes / ingress-nginx using kubectl ? (not helm)
I would like to use kubernetes/ingress-nginx using kubectl apply -f
when I deploy in AKS (Azure), but I cannot figure out how.当我在 AKS (Azure) 中部署时,我想使用 kubernetes/ingress-nginx 使用
kubectl apply -f
,但我不知道如何。
I know that I can do kubectl apply -f https://github.com/kubernetes/ingress-nginx/blob/master/deploy/static/provider/cloud/deploy.yaml
我知道我可以做
kubectl apply -f https://github.com/kubernetes/ingress-nginx/blob/master/deploy/static/provider/cloud/deploy.yaml
but the problem is that this provides a very non-configurable version with a lot of items on it.但问题是这提供了一个非常不可配置的版本,上面有很多项目。
Any idea?任何想法? I don't want to start to edit and customize
deploy.yaml
in the current form as it's super ugly.我不想以当前的形式开始编辑和自定义
deploy.yaml
,因为它非常丑陋。 It is an option but anyone has any better idea?这是一个选择,但有人有更好的主意吗?
I know that I can use help, and that's a current production version, but for some reason, I need to try to move to kubectl apply -f
我知道我可以使用帮助,这是当前的生产版本,但由于某种原因,我需要尝试转到
kubectl apply -f
Thanks in advance.提前致谢。
Have a look at Kustomize看看 Kustomize
https://kubernetes.io/blog/2018/05/29/introducing-kustomize-template-free-configuration-customization-for-kubernetes/ https://kubernetes.io/blog/2018/05/29/introducing-kustomize-template-free-configuration-customization-for-kubernetes/
https://github.com/kubernetes-sigs/kustomize/tree/master/examples/helloWorld https://github.com/kubernetes-sigs/kustomize/tree/master/examples/helloWorld
it was made exactly for your use case.它完全适合您的用例。
I would suggest using helm3 for installing packages (which allows configuration with maintability as main aim).我建议使用 helm3 来安装软件包(它允许以可维护性为主要目标的配置)。 You can see helm package for nginx-ingress (https://github.com/helm/charts/tree/master/stable/nginx-ingress ) and configure the parameters also.
您可以看到 helm package 用于 nginx-ingress (https://github.com/helm/charts/tree/master/stable/nginx-ingress ) 并配置参数。
Note there are multiple version of helm for nginx-ingress.请注意,nginx-ingress 有多个版本的 helm。 You can choose which works for you the best (one if community maintained and other is nginx maintained).
您可以选择最适合您的(如果社区维护,另一个是 nginx 维护)。
Edit: - helm template can be used to spit out yaml file which can be used with kubectl to apply directly.编辑: - helm 模板可用于吐出 yaml 文件,该文件可与 kubectl 一起使用以直接应用。 Moreover helm3 can directly work with kubectl without any server side component.
此外,helm3 可以直接与 kubectl 一起使用,无需任何服务器端组件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.