-
레지스트리 서버 만들기CICD 2024. 6. 13. 12:37
- 레지스트리 서버 만들기 (aio vm)
nano kube-registry.yaml -------------------------------------------------------------- --- apiVersion: v1 kind: Namespace metadata: name: kube-registry --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: kube-registry name: kube-registry namespace: kube-registry spec: replicas: 1 selector: matchLabels: app: kube-registry strategy: {} template: metadata: labels: app: kube-registry spec: containers: - image: docker.io/opensuse/registry name: registry ports: - containerPort: 5000 --- apiVersion: v1 kind: Service metadata: creationTimestamp: null labels: app: kube-registry name: kube-registry namespace: kube-registry spec: ports: - port: 5000 protocol: TCP nodePort: 30500 selector: app: kube-registry type: NodePort --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: registry-ingress namespace: kube-registry annotations: nginx.ingress.kubernetes.io/rewrite-target: / spec: rules: - host: registry.local http: paths: - path: / pathType: Prefix backend: service: name: kube-registry port: number: 30500 -------------------------------------------------------------- kubectl apply -f kube-registry.yaml kubectl get pod -nkube-registry //> NAME READY STATUS RESTARTS AGE //> kube-registry-5f854ff58b-bpwbf 1/1 Running 0 11m kubectl get svc -nkube-registry //> NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE //> kube-registry NodePort 10.90.123.146 <none> 5000:30500/TCP 10m dnf install buildah skopeo nano Containerfile -------------------------------------------------------------- FROM quay.io/startx/php:latest COPY ip-v3.php /app -------------------------------------------------------------- nano ip-v3.php -------------------------------------------------------------- <?php $ip_server = $_SERVER['SERVER_ADDR']; $hostname_server = gethostname(); echo "this PHP APP version is v3"; echo $ip_server; echo $hostname_server; ?> -------------------------------------------------------------- buildah bud -f Containerfile -t registry.local:30500/app/php-ip:v3 buildah push --tls-verify=false registry.local:30500/app/php-ip:v3 skopeo list-tags --tls-verify=false docker://registry.local:30500/app/php-ip
'CICD' 카테고리의 다른 글
쿠버네티스 용어 정리 (0) 2024.06.14 테크톤 (0) 2024.06.12 pod, deploment, replicaset (0) 2024.06.11 pod, application container (0) 2024.06.11 쿠버네티스 (0) 2024.06.10