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

64 lines
1.8 KiB
Plaintext
Raw Normal View History

---
2018-02-09 15:47:57 +08:00
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: registry
2018-02-09 15:47:57 +08:00
namespace: {{ registry_namespace }}
labels:
2018-02-09 15:47:57 +08:00
k8s-app: registry
version: v{{ registry_image_tag }}
addonmanager.kubernetes.io/mode: Reconcile
spec:
{% if registry_storage_class != "" and registry_storage_access_mode == "ReadWriteMany" %}
replicas: {{ registry_replica_count }}
{% else %}
replicas: 1
{% endif %}
selector:
2018-02-09 15:47:57 +08:00
matchLabels:
k8s-app: registry
version: v{{ registry_image_tag }}
template:
metadata:
labels:
2018-02-09 15:47:57 +08:00
k8s-app: registry
version: v{{ registry_image_tag }}
spec:
priorityClassName: {% if registry_namespace == 'kube-system' %}system-cluster-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
serviceAccountName: registry
securityContext:
fsGroup: 1000
runAsUser: 1000
containers:
- name: registry
image: {{ registry_image_repo }}:{{ registry_image_tag }}
2018-02-09 15:47:57 +08:00
imagePullPolicy: {{ k8s_image_pull_policy }}
env:
- name: REGISTRY_HTTP_ADDR
value: :{{ registry_port }}
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /var/lib/registry
volumeMounts:
2018-02-09 15:47:57 +08:00
- name: registry-pvc
mountPath: /var/lib/registry
ports:
- containerPort: {{ registry_port }}
name: registry
protocol: TCP
livenessProbe:
httpGet:
path: /
port: {{ registry_port }}
readinessProbe:
httpGet:
path: /
port: {{ registry_port }}
volumes:
2018-02-09 15:47:57 +08:00
- name: registry-pvc
{% if registry_storage_class != "" %}
2018-02-09 15:47:57 +08:00
persistentVolumeClaim:
claimName: registry-pvc
{% else %}
emptyDir: {}
2018-02-09 15:47:57 +08:00
{% endif %}