Browse Source

Creo yaml de registry local

politica
Celestino Rey 1 year ago
parent
commit
ca23d02275
5 changed files with 103 additions and 1 deletions
  1. +1
    -1
      JugarAlPadel/K8S/Makefile.local
  2. +12
    -0
      Registry/Makefile
  3. +7
    -0
      Registry/namespace.yaml
  4. +14
    -0
      Registry/pv-local-registry.yaml
  5. +69
    -0
      Registry/registry-deployment.yaml

+ 1
- 1
JugarAlPadel/K8S/Makefile.local View File

@ -1,5 +1,5 @@
export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
export REGISTRY=localhost:5000
export REGISTRY=localhost:30500
#export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.32


+ 12
- 0
Registry/Makefile View File

@ -0,0 +1,12 @@
# limpia todo
all: clean install
install:
-kubectl create -f namespace.yaml
-kubectl create -f pv-local-registry.yaml
-kubectl create -f registry-deployment.yaml
clean:
-kubectl delete -f registry-deployment.yaml
-kubectl delete -f pv-local-registry.yaml
-kubectl delete -f namespace.yaml

+ 7
- 0
Registry/namespace.yaml View File

@ -0,0 +1,7 @@
###################################################
# Namespace Vehículos
###################################################
apiVersion: v1
kind: Namespace
metadata:
name: registry

+ 14
- 0
Registry/pv-local-registry.yaml View File

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

+ 69
- 0
Registry/registry-deployment.yaml View File

@ -0,0 +1,69 @@
apiVersion: v1
kind: Service
metadata:
name: registry
namespace: registry
labels:
io.kompose.service: registry
spec:
type: NodePort
ports:
- name: registry
port: 5000
protocol: TCP
nodePort: 30500
targetPort: 5000
selector:
io.kompose.service: registry
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: registry-claim0
name: registry-claim0
namespace: registry
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry-deployment
namespace: registry
labels:
k8s-app: registry
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: registry
strategy:
type: Recreate
template:
metadata:
labels:
io.kompose.service: registry
spec:
containers:
- env:
- name: REGISTRY_STORAGE_DELETE_ENABLED
value: "true"
image: registry:2.7
name: registry
ports:
- containerPort: 5000
imagePullPolicy: Always
volumeMounts:
- mountPath: /var/lib/registry
name: registry-claim0
volumes:
- name: registry-claim0
persistentVolumeClaim:
claimName: registry-claim0

Loading…
Cancel
Save