我想进行设置,使我的dns指向我的EKS集群,而我的EKS集群指向api.server.com/static
将S3和api.server.com/api上的文件添加到我的tomcat部署中。
我很好奇这是否可行以及如何实现。
答案 0 :(得分:1)
是的,您可以添加指向外部域名的“ externalName”类型的服务。这必须是FQDN,而不是URL,您需要向入口添加路由逻辑。
---
apiVersion: v1
kind: Service
metadata:
name: external
namespace: default
labels:
app: external
spec:
type: ExternalName # <-- this is the service type for external resources
externalName: s3.amazon.fqdn # <-- put your external domain here
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: external
namespace: default
nginx.ingress.kubernetes.io/rewrite-target: / # <-- your routing logic?
spec:
rules:
- http:
paths:
- path: /static # <-- your routing logic
backend:
serviceName: external # <-- your service name
servicePort: 80