Skip to content

Commit

Permalink
Assign the name for the endpoint port. (#146)
Browse files Browse the repository at this point in the history
In Kubernetes 1.6 each port defined by a service should have a name. The same, apparently, applies to the endpoints connected to those services.
  • Loading branch information
Oleksii Kliukin authored and CyberDem0n committed Apr 12, 2017
1 parent f2fa96c commit 2be341a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgres-appliance/callback_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def change_pod_role_label(namespace, new_role):

def change_endpoints(namespace, cluster):
ip = os.environ.get('POD_IP', socket.gethostbyname(socket.gethostname()))
body = json.dumps({'subsets': [{'addresses': [{'ip': ip}], 'ports': [{'port': 5432, 'protocol': 'TCP'}]}]})
body = json.dumps({'subsets': [{'addresses': [{'ip': ip}], 'ports': [{'name': 'postgresql', 'port': 5432, 'protocol': 'TCP'}]}]})
api_patch(namespace, 'endpoints', cluster, 'service endpoints', body)


Expand Down

0 comments on commit 2be341a

Please sign in to comment.