Browse Source

Creación del registry local

main
Celestino Rey 1 year ago
parent
commit
29d36332c3
15 changed files with 167 additions and 19 deletions
  1. +1
    -1
      NginxConf202311/README.md
  2. +1
    -9
      PGO/creaTodo.sh
  3. +1
    -8
      PGO/paraTodo.sh
  4. +1
    -1
      PGO/pv-local-pg.yaml
  5. +7
    -0
      mypdr/README.md
  6. +5
    -0
      mypdr/creaTodo.sh
  7. +1
    -0
      mypdr/inspeccionarSecret.sh
  8. +5
    -0
      mypdr/paraTodo.sh
  9. +28
    -0
      mypdr/pv-local-registry.yaml
  10. +8
    -0
      mypdr/reg-secret.yaml
  11. +14
    -0
      mypdr/registry-claim0-persistentvolumeclaim.yaml
  12. +14
    -0
      mypdr/registry-claim1-persistentvolumeclaim.yaml
  13. +59
    -0
      mypdr/registry-deployment.yaml
  14. +21
    -0
      mypdr/registry-service.yaml
  15. +1
    -0
      mypdr/registry.password

+ 1
- 1
NginxConf202311/README.md View File

@ -10,7 +10,7 @@ En es mismo fichero hay que poner el puerto **NodePort** que tiene asociado nues
Se guarda el fichero y se crea un enlace simbólico en **/etc/nginx/sites-enabled**
ln -s /etc/nginx/sites-available/calibre.conf /etc/nginx/sites-enable
ln -s /etc/nginx/sites-available/calibre.conf /etc/nginx/sites-enabled
y se reinicia nginx


+ 1
- 9
PGO/creaTodo.sh View File

@ -1,15 +1,7 @@
kubectl create namespace postgres
kubectl create -f pv-local-pg.yaml
kubectl create -f pvc-pg.yaml
kubectl create -f postgres-configmap.yaml
kubectl create -f postgres-deployment.yaml
kubectl create -f postgres-service.yaml
# pgadmin
#kubectl create -f pv-local-pgadmin.yaml
#kubectl create -f pvc-pgadmin.yaml
#kubectl create -f pgadmin-secret.yaml
#kubectl create -f pgadmin-service.yaml
#kubectl create -f pgadmin-deployment.yaml
#kubectl create -f pgadmin-configmap.yaml
kubectl create -f pv-local-phppgadmin.yaml
kubectl create -f phppgadmin-deployment.yaml
watch kubectl get all -n postgres

+ 1
- 8
PGO/paraTodo.sh View File

@ -3,11 +3,4 @@ kubectl delete -f postgres-deployment.yaml
kubectl delete -f postgres-configmap.yaml
kubectl delete -f pvc-pg.yaml
kubectl delete -f pv-local-pg.yaml
#kubectl delete -f pgadmin-configmap.yaml
#kubectl delete -f pgadmin-secret.yaml
#kubectl delete -f pgadmin-service.yaml
#kubectl delete -f pgadmin-deployment.yaml
#kubectl delete -f pvc-pgadmin.yaml
#kubectl delete -f pv-local-pgadmin.yaml
kubectl delete -f phppgadmin-deployment.yaml
kubectl delete -f pv-local-phppgadmin.yaml
kubectl delete ns postgres

+ 1
- 1
PGO/pv-local-pg.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/cluster/postgres/postgres-db"
path: "/mnt/Externo/postgres/postgres-db"

+ 7
- 0
mypdr/README.md View File

@ -0,0 +1,7 @@
# instruciones para levantar el registry
https://gcore.com/learning/4-easy-steps-to-set-up-a-private-docker-registry-on-ubuntu/
# instrucciones para crear el Secret y usarlo en los pods
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

+ 5
- 0
mypdr/creaTodo.sh View File

@ -0,0 +1,5 @@
kubectl create -f pv-local-registry.yaml
kubectl create -f registry-claim0-persistentvolumeclaim.yaml
kubectl create -f registry-claim1-persistentvolumeclaim.yaml
kubectl create -f registry-deployment.yaml
kubectl create -f registry-service.yaml

+ 1
- 0
mypdr/inspeccionarSecret.sh View File

@ -0,0 +1 @@
kubectl get secret myregistrykey --output="jsonpath={.data.\.dockerconfigjson}" | base64 --decode

+ 5
- 0
mypdr/paraTodo.sh View File

@ -0,0 +1,5 @@
kubectl delete -f registry-service.yaml
kubectl delete -f registry-deployment.yaml
kubectl delete -f registry-claim1-persistentvolumeclaim.yaml
kubectl delete -f registry-claim0-persistentvolumeclaim.yaml
kubectl delete -f pv-local-registry.yaml

+ 28
- 0
mypdr/pv-local-registry.yaml View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mypdr-main-folder
labels:
app: mypdr
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/mypdr/main"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mypdr-a2auth-folder
labels:
app: mypdr
spec:
capacity:
storage: 10Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/mypdr/a2auth"

+ 8
- 0
mypdr/reg-secret.yaml View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: myregistrykey
# namespace: awesomeapps
data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbEpsZVMweE1UYzIiCgkJfQoJfQp9
type: kubernetes.io/dockerconfigjson

+ 14
- 0
mypdr/registry-claim0-persistentvolumeclaim.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: registry-claim0
name: registry-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

+ 14
- 0
mypdr/registry-claim1-persistentvolumeclaim.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: registry-claim1
name: registry-claim1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
status: {}

+ 59
- 0
mypdr/registry-deployment.yaml View File

@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: registry
name: registry
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: registry
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: registry
spec:
containers:
- env:
- name: REGISTRY_AUTH
value: htpasswd
- name: REGISTRY_AUTH_HTPASSWD_PATH
value: /a2auth/registry.password
- name: REGISTRY_AUTH_HTPASSWD_REALM
value: Registry
- name: REGISTRY_HTTP_SECRET
value: SomeRandomStringToUse
- name: REGISTRY_STORAGE_DELETE_ENABLED
value: ‘true’
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /main
image: registry:2
name: registry
ports:
- containerPort: 5000
resources: {}
volumeMounts:
- mountPath: /main
name: registry-claim0
- mountPath: /a2auth
name: registry-claim1
restartPolicy: Always
volumes:
- name: registry-claim0
persistentVolumeClaim:
claimName: registry-claim0
- name: registry-claim1
persistentVolumeClaim:
claimName: registry-claim1
status: {}

+ 21
- 0
mypdr/registry-service.yaml View File

@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.26.0 (40646f47)
creationTimestamp: null
labels:
io.kompose.service: registry
name: registry
spec:
type: NodePort
ports:
- name: "5010"
port: 5010
nodePort: 30342
targetPort: 5000
selector:
io.kompose.service: registry
status:
loadBalancer: {}

+ 1
- 0
mypdr/registry.password View File

@ -0,0 +1 @@
creylopez:$2y$05$WhvZdhVr.Xwz.j/M61fMTu2ea8yAf5bPjPvQadT12kuzZaJw2Gwri

Loading…
Cancel
Save