c12s-kubespray/roles/kubernetes-apps/registry/templates/registry-rs.yml.j2

53 lines
1.5 KiB
Text
Raw Normal View History

---
2018-02-09 07:47:57 +00:00
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: registry
2018-02-09 07:47:57 +00:00
namespace: {{ registry_namespace }}
labels:
2018-02-09 07:47:57 +00:00
k8s-app: registry
version: v{{ registry_image_tag }}
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
spec:
replicas: 1
selector:
2018-02-09 07:47:57 +00:00
matchLabels:
k8s-app: registry
version: v{{ registry_image_tag }}
template:
metadata:
labels:
2018-02-09 07:47:57 +00:00
k8s-app: registry
version: v{{ registry_image_tag }}
kubernetes.io/cluster-service: "true"
spec:
{% if kube_version is version('v1.11.1', '>=') %}
priorityClassName: {% if registry_namespace == 'kube-system' %}system-cluster-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
{% endif %}
serviceAccountName: registry
containers:
- name: registry
image: {{ registry_image_repo }}:{{ registry_image_tag }}
2018-02-09 07:47:57 +00:00
imagePullPolicy: {{ k8s_image_pull_policy }}
env:
- name: REGISTRY_HTTP_ADDR
value: :5000
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /var/lib/registry
volumeMounts:
2018-02-09 07:47:57 +00:00
- name: registry-pvc
mountPath: /var/lib/registry
ports:
- containerPort: 5000
name: registry
protocol: TCP
volumes:
2018-02-09 07:47:57 +00:00
- name: registry-pvc
{% if registry_storage_class != none %}
persistentVolumeClaim:
claimName: registry-pvc
{% else %}
emptyDir: {}
2018-02-09 07:47:57 +00:00
{% endif %}