registry: service add clusterIP, nodePort, loadBalancer support (#8291)

* registry: service add clusterIP, nodePort, loadBalancer support

* modify camelcase name to underscore

* Add registry service type compatibility check
This commit is contained in:
zhengtianbao
2021-12-15 02:18:19 -06:00
committed by GitHub
parent 4daa824b3c
commit aa9b8453a0
3 changed files with 52 additions and 0 deletions

View File

@@ -8,10 +8,25 @@ metadata:
k8s-app: registry
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/name: "KubeRegistry"
{% if registry_service_annotations %}
annotations:
{{ registry_service_annotations | to_nice_yaml(indent=2, width=1337) | indent(width=4) }}
{% endif %}
spec:
selector:
k8s-app: registry
type: {{ registry_service_type }}
{% if registry_service_type == "ClusterIP" and registry_service_cluster_ip != "" %}
clusterIP: {{ registry_service_cluster_ip }}
{% endif %}
{% if registry_service_type == "LoadBalancer" and registry_service_loadbalancer_ip != "" %}
loadBalancerIP: {{ registry_service_loadbalancer_ip }}
{% endif %}
ports:
- name: registry
port: {{ registry_port }}
protocol: TCP
targetPort: {{ registry_port }}
{% if registry_service_type == "NodePort" and registry_service_nodeport != "" %}
nodePort: {{ registry_service_nodeport }}
{% endif %}