Skip to content

Instantly share code, notes, and snippets.

@initialed85
Created October 17, 2022 16:21
Show Gist options
  • Save initialed85/1db5af337fed4ad9784fee725f551fb5 to your computer and use it in GitHub Desktop.
Save initialed85/1db5af337fed4ad9784fee725f551fb5 to your computer and use it in GitHub Desktop.
Modified kube-registry.yaml from rook/deploy/examples/csi/cephfs
# this modification adds a service w/ a LoadBalancer presence on port 5000
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cephfs-pvc
namespace: kube-system
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 8Gi
storageClassName: rook-cephfs
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-registry
namespace: kube-system
labels:
k8s-app: kube-registry
kubernetes.io/cluster-service: "true"
spec:
replicas: 3
selector:
matchLabels:
k8s-app: kube-registry
template:
metadata:
labels:
k8s-app: kube-registry
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: registry
image: registry:2
imagePullPolicy: Always
resources:
limits:
cpu: 100m
memory: 100Mi
env:
# Configuration reference: https://docs.docker.com/registry/configuration/
- name: REGISTRY_HTTP_ADDR
value: :5000
- name: REGISTRY_HTTP_SECRET
value: "Ple4seCh4ngeThisN0tAVerySecretV4lue"
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /var/lib/registry
volumeMounts:
- name: image-store
mountPath: /var/lib/registry
ports:
- containerPort: 5000
name: registry
protocol: TCP
livenessProbe:
httpGet:
path: /
port: registry
readinessProbe:
httpGet:
path: /
port: registry
volumes:
- name: image-store
persistentVolumeClaim:
claimName: cephfs-pvc
readOnly: false
---
apiVersion: v1
kind: Service
metadata:
name: kube-registry
namespace: kube-system
spec:
selector:
k8s-app: kube-registry
ports:
- name: registry
protocol: TCP
port: 5000
targetPort: 5000
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment