kubespray/roles/kubernetes-apps/registry/templates/registry-svc.yml.j2

33 lines
1016 B
Plaintext
Raw Normal View History

---
apiVersion: v1
kind: Service
metadata:
2018-02-09 15:47:57 +08:00
name: registry
namespace: {{ registry_namespace }}
labels:
2018-02-09 15:47:57 +08:00
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:
2018-02-09 15:47:57 +08:00
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:
2018-02-09 15:47:57 +08:00
- name: registry
port: {{ registry_port }}
2018-02-09 15:47:57 +08:00
protocol: TCP
targetPort: {{ registry_port }}
{% if registry_service_type == "NodePort" and registry_service_nodeport != "" %}
nodePort: {{ registry_service_nodeport }}
{% endif %}