1

I have two container deployed in kubernates, each container has stateful application which is tightly coupled with container IP & I need to have communication between two (application is not trusting service ip). Therefore I need to assign static IP to container. Could anyone help me here ? Thanks in advance

Vishnu
  • 97
  • 1
  • 13

1 Answers1

1

A static IP cannot be assigned to a Pod.

Withing StatefulSet, you can refer to a stable network ID

If you are using GKE for your cluster, it supports loadBalancerIP. So, at some point, you can rely on this service. Just mark the auto-assigned IP as static first.

apiVersion: v1
kind: Service
spec:
  type: LoadBalancer
  loadBalancerIP: 10.10.10.10
A_Suh
  • 3,727
  • 6
  • 22
  • Thanks for answer . I tried with type: ClusterIP ClusterIP: None it worked for me & now both containers are communicating properly . – Vishnu Mar 20 '19 at 05:20
  • A tiny deamonset job with curl could accomplish updating the dns ip entry. combined with maintenance windows, the level of disruption should be minimal if not non existent. From experience, disruptive updates happen within 10 minutes of the start of the maintenance window. There is a type of job that only runs once per node boot. – Ray Foss Sep 12 '21 at 20:18