Create service catalog in K8s

Change-Id: Ia95ab404e6ce6ada2e1a8539da6bcd92bad61398
This commit is contained in:
Mohammed Naser 2020-08-19 08:59:56 -05:00
parent b46a756d48
commit 0b8ebbe7ae
3 changed files with 71 additions and 0 deletions

View File

@ -56,6 +56,11 @@ function configure_mutnauq {
}
export -f configure_mutnauq
function create_mutnauq_accounts {
# NOTE(mnaser): We'll have to drop all uses of this at some point
create_service_user "neutron"
}
function init_mutnauq {
echo noop
}

View File

@ -44,3 +44,14 @@ def create_or_resume(spec, **_):
utils.create_or_update('neutron/service.yml.j2')
identity.ensure_application_credential(name="neutron")
url = None
if "ingress" in spec:
utils.create_or_update('neutron/ingress.yml.j2', spec=spec)
url = spec["ingress"]["host"]
if "endpoint" not in spec:
spec["endpoint"] = True
if spec["endpoint"]:
identity.ensure_service(name="neutron", service_type="network",
url=url, desc="Neutron Service")

View File

@ -0,0 +1,55 @@
---
# 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: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: neutron
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:
- host: {{ spec.ingress.host }}
http:
paths:
- path: /
backend:
serviceName: neutron
servicePort: 80
tls:
- hosts:
- {{ spec.ingress.host }}
secretName: neutron-tls
{% else %}
rules:
{% for v in spec.ingress %}
- host: {{ v.host }}
http:
paths:
- path: /
backend:
serviceName: neutron
servicePort: 80
{% endfor %}
tls:
- hosts:
{% for v in spec.ingress %}
- {{ v.host }}
{% endfor %}
secretName: neutron-tls
{% endif %}