Browse Source

Generic Services, external ip & nodeport

Refactor the services to be more generic and sharable. Add the
external vip in case you need that, and allow node port to be
used.

Partially implements: blueprint external-ips

Change-Id: I2f98e01d069a2686dd8023fa1491475d026b97b0
changes/52/363152/4 0.2.0
Kevin Fox 6 years ago
parent
commit
150ec195bd
  1. 18
      etc/kolla-kubernetes/service_resources.yml
  2. 19
      services/common/generic-service.yml.j2
  3. 11
      services/nova/nova-service-compute.yml.j2
  4. 11
      services/nova/nova-service-metadata.yml.j2

18
etc/kolla-kubernetes/service_resources.yml

@ -216,10 +216,20 @@ kolla-kubernetes:
pv:
pvc:
svc:
- name: nova-service-compute
template: services/nova/nova-service-compute.yml.j2
- name: nova-service-metadata
template: services/nova/nova-service-metadata.yml.j2
- name: nova-api
template: services/common/generic-service.yml.j2
vars:
port_name: nova_api_port
service: nova
type: api
name: nova-api
- name: nova-metadata
template: services/common/generic-service.yml.j2
vars:
port_name: nova_metadata_port
service: nova
type: metadata
name: nova-metadata
bootstrap:
- name: nova-compute-bootstrap-job
template: services/nova/nova-compute-bootstrap-job.yml.j2

19
services/common/generic-service.yml.j2

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ global[kolla_kubernetes.template.vars.port_name] }}
targetPort: {{ global[kolla_kubernetes.template.vars.port_name] }}
name: {{ kolla_kubernetes.template.vars.name }}
{%- if global[kolla_kubernetes.template.vars.port_name + '_nodeport'] is defined %}
nodePort: {{ global[kolla_kubernetes.template.vars.port_name + '_nodeport'] }}
type: NodePort
{%- else %}
externalIPs:
- {{ kolla_kubernetes_external_vip }}
{%- endif %}
selector:
service: {{ kolla_kubernetes.template.vars.service }}
type: {{ kolla_kubernetes.template.vars.type }}
metadata:
name: {{ kolla_kubernetes.template.vars.name }}

11
services/nova/nova-service-compute.yml.j2

@ -1,11 +0,0 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ nova_api_port }}
name: nova-api
selector:
service: nova
type: api
metadata:
name: nova-api

11
services/nova/nova-service-metadata.yml.j2

@ -1,11 +0,0 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ nova_metadata_port }}
name: nova-metadata
selector:
service: nova
type: api
metadata:
name: nova-metadata
Loading…
Cancel
Save