Skip to content

Commit

Permalink
Add docker-registry example package
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed Feb 26, 2024
1 parent 6b704e6 commit 231d93d
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/docker-registry/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: docker-registry
namespace: argocd
labels:
env: dev
spec:
project: default
source:
repoURL: cnoe://docker-registry/manifests
targetRevision: HEAD
path: "."
destination:
server: "https://kubernetes.default.svc"
namespace: kube-system
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
7 changes: 7 additions & 0 deletions examples/docker-registry/manifests/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: docker-registry
labels:
kubernetes.io/metadata.name: docker-registry
spec:
24 changes: 24 additions & 0 deletions examples/docker-registry/manifests/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: docker-registry-pv
namespace: docker-registry
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /tmp/repository
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: docker-registry-pvc
namespace: docker-registry
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
49 changes: 49 additions & 0 deletions examples/docker-registry/manifests/registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: v1
kind: Secret
metadata:
name: docker-registry-auth
namespace: docker-registry
type: Opaque
data:
htpasswd: aWRwYnVpbGRlcjokMnkkMDUkOGhTQUdWY2hCZ2hXb1A1Q0tULllkLkU5NGoxVXV2OHVJa3BWc2lxWW83OHBSTnJXUWUySkMKCg==
---
apiVersion: v1
kind: Pod
metadata:
name: docker-registry-pod
namespace: docker-registry
labels:
app: registry
spec:
containers:
- name: registry
image: registry:2.6.2
volumeMounts:
- name: registry-vol
mountPath: "/var/lib/registry"
env:
- name: REGISTRY_AUTH
value: "htpasswd"
- name: REGISTRY_AUTH_HTPASSWD_REALM
value: "Registry Realm"
- name: REGISTRY_AUTH_HTPASSWD_PATH
value: "/auth/htpasswd"
volumes:
- name: registry-vol
persistentVolumeClaim:
claimName: docker-registry-pvc
- name: auth-vol
secret:
secretName: docker-registry-auth
---
apiVersion: v1
kind: Service
metadata:
name: docker-registry
namespace: docker-registry
spec:
selector:
app: registry
ports:
- port: 5000
targetPort: 5000

0 comments on commit 231d93d

Please sign in to comment.