Created
May 23, 2021 11:22
-
-
Save rbuisson/e20716952ba8918fb9fcb47d20a24ca2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: registry | |
labels: | |
app: registry | |
spec: | |
selector: | |
matchLabels: | |
app: registry | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: registry | |
spec: | |
nodeSelector: | |
role: database | |
containers: | |
- name: registry | |
image: registry:2 | |
imagePullPolicy: IfNotPresent | |
resources: | |
requests: | |
cpu: 100m | |
memory: 200Mi | |
env: | |
- name: REGISTRY_HTTP_ADDR | |
value: :5000 | |
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY | |
value: /var/lib/registry | |
volumeMounts: | |
- name: image-store | |
mountPath: /var/lib/registry | |
ports: | |
- containerPort: 5000 | |
name: registry | |
protocol: TCP | |
volumes: | |
- name: image-store | |
persistentVolumeClaim: | |
claimName: {{ registry_volume_prefix }}-pvc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: storage.k8s.io/v1 | |
kind: StorageClass | |
metadata: | |
name: registry-storage | |
provisioner: kubernetes.io/no-provisioner | |
reclaimPolicy: Retain | |
--- | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: {{ registry_volume_prefix }}-pv | |
spec: | |
capacity: | |
storage: {{ registry_storage_capacity }} | |
volumeMode: Filesystem | |
accessModes: | |
- ReadWriteOnce | |
persistentVolumeReclaimPolicy: Delete | |
storageClassName: registry-storage | |
local: | |
path: {{ registry_folder }} | |
nodeAffinity: | |
required: | |
nodeSelectorTerms: | |
- matchExpressions: | |
- key: role | |
operator: In | |
values: | |
- database | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: {{ registry_volume_prefix }}-pvc | |
labels: | |
app: registry | |
spec: | |
storageClassName: registry-storage | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: {{ registry_storage_capacity }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mirrors: | |
{{ registry_load_balancer_ip }}: | |
endpoint: | |
- http://{{ registry_load_balancer_ip }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: registry-service | |
spec: | |
loadBalancerIP: {{ registry_load_balancer_ip }} | |
type: LoadBalancer | |
selector: | |
app: registry | |
ports: | |
- name: http | |
protocol: TCP | |
port: 80 | |
targetPort: 5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment