Merge "Add heat ingress"
This commit is contained in:
commit
d421fc1107
@ -11,4 +11,8 @@ data:
|
|||||||
configDir: /etc/keystone
|
configDir: /etc/keystone
|
||||||
heat:
|
heat:
|
||||||
configDir: /etc/heat
|
configDir: /etc/heat
|
||||||
|
ingress:
|
||||||
|
host:
|
||||||
|
api: "h-api.vexxhost.com"
|
||||||
|
api-cfn: "h-api-cfn.vexxhost.com"
|
||||||
chronyd: {}
|
chronyd: {}
|
@ -46,3 +46,18 @@ def create_or_resume(name, spec, **_):
|
|||||||
utils.create_or_update('heat/deployment.yml.j2',
|
utils.create_or_update('heat/deployment.yml.j2',
|
||||||
name=name, spec=spec, component='engine',
|
name=name, spec=spec, component='engine',
|
||||||
config_hash=config_hash)
|
config_hash=config_hash)
|
||||||
|
if "ingress" in spec:
|
||||||
|
utils.create_or_update('heat/ingress.yml.j2',
|
||||||
|
name=name, spec=spec)
|
||||||
|
|
||||||
|
|
||||||
|
@kopf.on.update('orchestration.openstack.org', 'v1alpha1', 'heats')
|
||||||
|
def update(name, spec, **_):
|
||||||
|
"""Update a heat
|
||||||
|
|
||||||
|
This function updates the deployment for heat if there are any
|
||||||
|
changes that happen within it.
|
||||||
|
"""
|
||||||
|
if "ingress" in spec:
|
||||||
|
utils.create_or_update('horizon/ingress.yml.j2',
|
||||||
|
name=name, spec=spec)
|
||||||
|
54
openstack_operator/templates/heat/ingress.yml.j2
Normal file
54
openstack_operator/templates/heat/ingress.yml.j2
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2020 VEXXHOST, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: heat
|
||||||
|
namespace: openstack
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
spec:
|
||||||
|
{% if spec.ingress.host is defined %}
|
||||||
|
rules:
|
||||||
|
{% if spec.ingress.host.api is defined %}
|
||||||
|
- host: {{ spec.ingress.host.api }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
backend:
|
||||||
|
serviceName: heat-api
|
||||||
|
servicePort: 80
|
||||||
|
{% endif %}
|
||||||
|
{% if spec.ingress.host["api-cfn"] is defined %}
|
||||||
|
- host: {{ spec.ingress.host["api-cfn"] }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
backend:
|
||||||
|
serviceName: heat-api-cfn
|
||||||
|
servicePort: 80
|
||||||
|
{% endif %}
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
{% if spec.ingress.host.api is defined %}
|
||||||
|
- {{ spec.ingress.host.api }}
|
||||||
|
{% endif %}
|
||||||
|
{% if spec.ingress.host["api-cfn"] is defined %}
|
||||||
|
- {{ spec.ingress.host["api-cfn"] }}
|
||||||
|
{% endif %}
|
||||||
|
secretName: heat-tls
|
||||||
|
{% endif %}
|
Loading…
x
Reference in New Issue
Block a user