...
코드 블럭 |
---|
[root@m-k8s gitea]# cd ~
# git 인증서 검증 비활성화
[root@m-k8s ~]# git config --global http.sslVerify false
# git 유저 정보 설정
[root@m-k8s ~]# git config --global user.name "gitea-admin"
[root@m-k8s ~]# git config --global user.email "gitea@local.domain"
[root@m-k8s ~]# git clone http://192.168.1.152:3000/gitea_admin/my_application.git
Cloning into 'my_application'...
warning: You appear to have cloned an empty repository
[root@m-k8s ~]# cd my_application
[root@m-k8s my_application]# vi mynginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: mynginx-deployment
labels:
app: mynginx
spec:
replicas: 3
selector:
matchLabels:
app: mynginx
template:
metadata:
labels:
app: mynginx
spec:
containers:
- name: mynginx
image: 192.168.1.202/library/myimage:latest ## 다음번 lb ip 예측 (gitea ip +1)
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: mynginx-service
spec:
selector:
app: mynginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
========================================================================
touch README.md
git init
git checkout -b main
git add README.md
git commit -m "first commit"
git remote add origin http://192.168.1.152:3000/gitea_admin/my_application.git
git push -u origin main
=====================================================================
[root@m-k8s my_application]# git add .
[root@m-k8s my_application]# git status
[root@m-k8s my_application]# git commit -m "myngnix manifest upload"
[master (root-commit) e7be4fc] myngnix manifest upload
1 file changed, 34 insertions(+)
[root@m-k8s my_application]# git push origin main
Username for 'http://192.168.1.201:3000': gitea_admin
Password for 'http://gitea_admin@192.168.1.201:3000':
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 454 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://192.168.1.201:3000/gitea_admin/my_application.git
* [new branch] master -> master |
...
Harbor Helm Charts 다운로드 및 설치
helm install harbor -n harbor -f values.yaml .
코드 블럭 |
---|
[root@m-k8s ~]# helm repo add harbor https://helm.goharbor.io [root@m-k8s ~]# helm repo list NAME URL prometheus-community https://prometheus-community.github.io/helm-charts gitea-charts https://dl.gitea.com/charts/ harbor https://helm.goharbor.io [root@m-k8s ~]# helm pull harbor/harbor [root@m-k8s ~]# tar xvfz harbor-1.14.2.tgz [root@m-k8s ~]# cd harbor [root@m-k8s harbor]# vi values.yaml expose: type: loadBalancer // Ingress -> loadBalancer tls: enabled: false // true -> False loadBalancer: name: harbor IP: "192.168.1.155" // IP 지정 persistence: enabled: false // true -> false externalURL: http://192.168.1.155 // URL 지정 ======================================================= [root@m-k8s harbor]# kubectl create ns harbor [root@m-k8s harbor]# helm install harbor -n harbor -f values.yaml . [root@m-k8s harbor]# kubectl get all -n harbor NAME READY STATUS RESTARTS AGE pod/harbor-core-657496664d-xqf5r 1/1 Running 0 84s pod/harbor-database-0 1/1 Running 0 84s pod/harbor-jobservice-78666596dd-ntjcf 1/1 Running 3 (51s ago) 84s pod/harbor-nginx-5b76d7588d-k4mv9 1/1 Running 0 84s pod/harbor-portal-68bcb5dd4c-rbdl2 1/1 Running 0 84s pod/harbor-redis-0 1/1 Running 0 84s pod/harbor-registry-695b7468f8-gdmmz 2/2 Running 0 84s pod/harbor-trivy-0 1/1 Running 0 84s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/harbor LoadBalancer 10.97.176.227 192.168.1.155 80:30022/TCP 9m49s 84s service/harbor-core ClusterIP 10.97.130.242 <none> 80/TCP 84s service/harbor-database ClusterIP 10.111.247.242 <none> 5432/TCP 84s service/harbor-jobservice ClusterIP 10.96.71.100 <none> 80/TCP 84s service/harbor-portal ClusterIP 10.96.111.107 <none> 80/TCP 84s service/harbor-redis ClusterIP 10.106.39.229 <none> 6379/TCP 84s service/harbor-registry ClusterIP 10.111.118.33 <none> 5000/TCP,8080/TCP 84s service/harbor-trivy ClusterIP 10.97.214.78 <none> 8080/TCP 84s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/harbor-core 1/1 1 1 84s deployment.apps/harbor-jobservice 1/1 1 1 84s deployment.apps/harbor-nginx 1/1 1 1 84s deployment.apps/harbor-portal 1/1 1 1 84s deployment.apps/harbor-registry 1/1 1 1 84s NAME DESIRED CURRENT READY AGE replicaset.apps/harbor-core-657496664d 1 1 1 84s replicaset.apps/harbor-jobservice-78666596dd 1 1 1 84s replicaset.apps/harbor-nginx-5b76d7588d 1 1 1 84s replicaset.apps/harbor-portal-68bcb5dd4c 1 1 1 84s replicaset.apps/harbor-registry-695b7468f8 1 1 1 84s NAME READY AGE statefulset.apps/harbor-database 1/1 84s statefulset.apps/harbor-redis 1/1 84s statefulset.apps/harbor-trivy 1/1 84s |
브라우저에서 접속 후 로그인
코드 블럭 |
---|
[root@m-k8s harbor]# cat values.yaml | grep harborAdminPassword: harborAdminPassword: "Harbor12345" |
...