我有一个 GKE/GCE 入口文件,它有 2 个主机。
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-ingress
spec:
rules:
- host: myfirstdomain # <-------- override this via kustomize
http:
paths:
- path: /abc
backend:
serviceName: abc
servicePort: abc
- path: /def
backend:
serviceName: def
servicePort: def
- path: /ghi
backend:
serviceName: ghi
servicePort: ghi
- host: myseconddomain # <-------- override this via kustomize
http:
paths:
- backend:
serviceName: xyz
servicePort: xyz
Run Code Online (Sandbox Code Playgroud)
我想host通过 kustomize声明这些值,以便我可以host为不同的环境指定不同的值。
我的开发环境覆盖补丁文件如下所示:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-ingress …Run Code Online (Sandbox Code Playgroud) overlay kubernetes google-kubernetes-engine kubernetes-ingress kustomize