Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker-registry example package #156

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://manifests
targetRevision: HEAD
path: "."
destination:
server: "https://kubernetes.default.svc"
namespace: kube-system
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
22 changes: 22 additions & 0 deletions examples/docker-registry/kind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: "kindest/node:v1.27.3"
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
system-reserved: memory=4Gi
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 443
hostPort: 8443
protocol: TCP
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.cnoe.localtest.me:8443"]
endpoint = ["https://registry.cnoe.localtest.me"]
[plugins."io.containerd.grpc.v1.cri".registry.configs."registry.cnoe.localtest.me".tls]
insecure_skip_verify = 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
77 changes: 77 additions & 0 deletions examples/docker-registry/manifests/registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: v1
kind: Secret
metadata:
name: docker-registry-auth
namespace: docker-registry
type: Opaque
data:
# Username: idpbuilder Password: idpbuilder
htpasswd: aWRwYnVpbGRlcjokMnkkMTEkVkVoa09aRE90SFZFbDJUMnFobGVwZXBGc3NMOTMvZlhoRzNaTHFyN1QvblpjajJKeXFoNWU=
---
apiVersion: v1
kind: Pod
metadata:
name: docker-registry-pod
namespace: docker-registry
labels:
app: registry
spec:
containers:
- name: registry
image: registry:2.8.3
volumeMounts:
- name: registry-vol
mountPath: "/var/lib/registry"
- name: auth-vol
mountPath: "/auth/"
# Uncomment the following to enable registry basic auth
# 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:
type: NodePort
selector:
app: registry
ports:
- port: 5000
targetPort: 5000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
name: docker-registry
namespace: docker-registry
spec:
ingressClassName: nginx
rules:
- host: registry.cnoe.localtest.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: docker-registry
port:
number: 5000
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ data:
locations:
# Examples from a public GitHub repository.
- type: url
target: https://gitea.cnoe.localtest.me:8443/giteaAdmin/idpbuilder-localdev-backstage-entities/src/branch/main/catalog-info.yaml
target: https://gitea.cnoe.localtest.me:8443/giteaAdmin/idpbuilder-localdev-backstage-templates-entities/raw/branch/main/catalog-info.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase this is already fix in main
ea9c56e

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is the cherry-pick of that exact commit to this branch I needed it to make sure things were working correctly. The merge to main should be noOp here. Happy to remove it if that is more appropriate.

## Uncomment these lines to add an example org
# - type: url
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
Expand Down
Loading