Dynamic wildcard subdomain ingress for Kubernetes

前端 未结 2 1249
萌比男神i
萌比男神i 2020-12-28 15:32

I\'m currently using Kubernetes on GKE to serve the various parts of my product on different subdomains with the Ingress resource. For example: api.mydomain.com

相关标签:
2条回答
  • 2020-12-28 16:01

    There certainly isn't anything like wildcard domains available in kubernetes, but you might be able to get want you want using Helm

    With helm, you can template variables inside your manifests, so you can have the name of your branch be in the helm values file

    From there, you can have gitlab-ci do the helm installation in a build pipeline and if you configure your chart correctly, you can specify a helm argument of the pipeline name.

    There's a great blog post about this kind of workflow here - hopefully this'll get your where you need to go.

    0 讨论(0)
  • 2020-12-28 16:07

    Services are available locally as

    my-svc.svc.cluster.local
    

    You can write a simple NGINX proxy which can forward which can parse the subdomain and proxy pass it to http://$service as long as the subdomain and service name matches as in this case.

    0 讨论(0)
提交回复
热议问题