Browse Source

Creado MiRegistry y probado en Nginx

main
Celestino Rey 2 years ago
parent
commit
04ca2c3911
10 changed files with 3477 additions and 1 deletions
  1. +3455
    -0
      MiRegistry/DeployYourPrivateDockerRegistryasaPodinKubernetes.html
  2. +2
    -0
      MiRegistry/prueba.sh
  3. +1
    -0
      MiRegistry/step-01.sh
  4. +4
    -0
      MiRegistry/step-02.sh
  5. +2
    -0
      MiRegistry/step-03.sh
  6. +2
    -0
      MiRegistry/step-04.sh
  7. +2
    -0
      MiRegistry/step-05.sh
  8. +2
    -0
      MiRegistry/step-06.sh
  9. +3
    -0
      MiRegistry/step-07.sh
  10. +4
    -1
      Nginx/miweb-deployment.yaml

+ 3455
- 0
MiRegistry/DeployYourPrivateDockerRegistryasaPodinKubernetes.html
File diff suppressed because it is too large
View File


+ 2
- 0
MiRegistry/prueba.sh View File

@ -0,0 +1,2 @@
kubectl run nginx-pod --image=docker-registry:32000/minginx:2.0 --overrides='{ "apiVersion": "v1", "spec": { "imagePullSecrets": [{"name": "reg-cred-secret"}] } }'

+ 1
- 0
MiRegistry/step-01.sh View File

@ -1,3 +1,4 @@
# Crear certifidado TLS
# mkdir -p /registry && cd "$_"
# mkdir certs
openssl req -x509 -newkey rsa:4096 -days 365 -nodes -sha256 -keyout certs/tls.key -out certs/tls.crt -subj "/CN=docker-registry" -addext "subjectAltName = DNS:docker-registry"

+ 4
- 0
MiRegistry/step-02.sh View File

@ -0,0 +1,4 @@
# Crear htpasswd para autenticación de usuario
sudo docker run --rm --entrypoint htpasswd registry:2.6.2 -Bbn creylopez Rey-1176
echo "Copia la salida y pegala en /registry/auth/htpasswd"

+ 2
- 0
MiRegistry/step-03.sh View File

@ -0,0 +1,2 @@
# creando un secret
kubectl create secret tls certs-secret --cert=/registry/certs/tls.crt --key=/registry/certs/tls.key

+ 2
- 0
MiRegistry/step-04.sh View File

@ -0,0 +1,2 @@
# Create auth-secret
kubectl create secret generic auth-secret --from-file=/registry/auth/htpasswd

+ 2
- 0
MiRegistry/step-05.sh View File

@ -0,0 +1,2 @@
# persistent volume
kubectl apply -f registry-pv.yaml

+ 2
- 0
MiRegistry/step-06.sh View File

@ -0,0 +1,2 @@
# Crea el pod
kubectl create -f registry-deployment.yaml

+ 3
- 0
MiRegistry/step-07.sh View File

@ -0,0 +1,3 @@
# crear secret con el usuario y la clave
kubectl create secret docker-registry reg-cred-secret --docker-server=docker-registry:32000 --docker-username=creylopez --docker-password=Rey-1176

+ 4
- 1
Nginx/miweb-deployment.yaml View File

@ -47,7 +47,8 @@ spec:
spec:
containers:
- name: nginx
image: linuxserver/nginx
#image: linuxserver/nginx
image: docker-registry:32000/minginx:2.0
#image: httpd
ports:
- containerPort: 80
@ -57,6 +58,8 @@ spec:
#mountPath: /config/www
mountPath: /config
#mountPath: /usr/local/apache2/htdocs
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: nginx-www-folder
persistentVolumeClaim:


Loading…
Cancel
Save