How to (re) use an existing static IP address when creating a TLS Ingress Resource?

I create an input resource (tls enabled) using the following configurations:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-app-apis
spec:
  tls:
  - secretName: tls-secret
  backend:
    serviceName: my-web-service
    servicePort: 80

A new static IP address is provided each time. Is it possible to reuse an existing one?

(I am using Kubernetes running on GKE)

+4
source share
2 answers

You can specify the IP address in the annotation on Ingress (it looks like you specify it by name, not by IP address). This is only matched by the GCE controller, so don't expect it to work anywhere other than GCE / GKE.

https://github.com/kubernetes/contrib/blob/master/ingress/controllers/gce/controller/utils.go#L48

- :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: myingress
 annotations:
   "kubernetes.io/ingress.global-static-ip-name": my-ip-name
spec:
  ...
+4

Source: https://habr.com/ru/post/1655654/


All Articles