需要反代域名的话,可以考虑 externalName的svc方式,参考demo
kind: Service apiVersion: v1 metadata: name: osstest namespace: default spec: type: ExternalName externalName: du****hen.oss-cn-shenzhen.aliyuncs.com --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: oss-ingress annotations: kubernetes.io/ingress.class: "nginx" spec: rules: - host: os****.cn http: paths: - path: / backend: serviceName: osstest servicePort: 80
2,看一眼创建出来的资源
3,oss上绑定对应的域名(ingress的host域名),注意需要备案,同时需要将该域名解析到ingress对应的公网slb地址上
4,curl访问测试