507091ec8b
`cluster_name` defaults to `dns_domain` value (see [here][1] and [here][2]) but they could have different values. `dns_domain` should be used here instead of `cluster_name` because the DNS resolution is configured to use `dns_domain`. [1]:0ef7af76bc/roles/kubespray-defaults/defaults/main.yaml (L104)
[2]:1afdb05ea9/inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml (L196)
36 lines
1.1 KiB
Django/Jinja
36 lines
1.1 KiB
Django/Jinja
---
|
|
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: registry-proxy
|
|
namespace: {{ registry_namespace }}
|
|
labels:
|
|
k8s-app: registry-proxy
|
|
version: v{{ registry_proxy_image_tag }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
k8s-app: registry-proxy
|
|
version: v{{ registry_proxy_image_tag }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
k8s-app: registry-proxy
|
|
kubernetes.io/name: "registry-proxy"
|
|
version: v{{ registry_proxy_image_tag }}
|
|
spec:
|
|
priorityClassName: {% if registry_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
|
|
serviceAccountName: registry-proxy
|
|
containers:
|
|
- name: registry-proxy
|
|
image: {{ registry_proxy_image_repo }}:{{ registry_proxy_image_tag }}
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
env:
|
|
- name: REGISTRY_HOST
|
|
value: registry.{{ registry_namespace }}.svc.{{ dns_domain }}
|
|
- name: REGISTRY_PORT
|
|
value: "{{ registry_port }}"
|
|
ports:
|
|
- name: registry
|
|
containerPort: 80
|
|
hostPort: {{ registry_port }}
|