Convert Memcached to work without HostNetwork=True

Memcached needs to be configured to listen to 0.0.0.0 in the Kolla
config for this to work -- this is OK because we're only exposing the
Memcached port internally to the cluster.  That still needs to be done.

I ran some tests and HostNetwork=True doesn't allow for the k8s
service discovery mechanism to work.  However, I also ran some tests
and a container with HostNetwork=True is still able to connect to
Memcached's service -- Kubernetes creates the illusion of an SDN using
iptables rules on the base node.  Thus, we're going to move faster on
the k8s side if we default to HostNetwork=false and use
HostNetwork=true when necessary (for example: Neutron).

Change-Id: I0858f78aac84c64e2640614b7e82f9c39de6daf7
Partially-implements: blueprint kolla-kubernetes-service-discovery
Partially-implements: blueprint remove-net-hostremove-net-host
This commit is contained in:
Ken Wronkiewicz 2016-06-07 15:48:06 -07:00
parent df3e8703b6
commit 5e676fae0d
2 changed files with 6 additions and 3 deletions

View File

@ -7,9 +7,8 @@ spec:
template:
metadata:
labels:
service: memcached
service: memcached
spec:
hostNetwork: True
containers:
- image: "{{ memcached_image_full }}"
name: memcached
@ -19,6 +18,9 @@ spec:
env:
- name: KOLLA_CONFIG_STRATEGY
value: {{ config_strategy }}
ports:
- containerPort: {{ memcached_port }}
name: memcached
volumes:
- name: memcached-config
configMap:

View File

@ -3,7 +3,8 @@ kind: Service
spec:
ports:
- port: {{ memcached_port }}
name: memcached
selector:
name: memcached
service: memcached
metadata:
name: memcached