k8s에 설치되는 에코시스들의 경우 초기 마스터 비밀번호 설정이 다 제각각이다.....ㅡ,.ㅡㅋ
gitlab의 경우는 gitlab-rails 를 통해 설정한다.
k8s 내부 컨테이너 콘솔로 접근후에
gitlab-rails console -e producion => gitlab rails 접근
진입 후 아래 명령어로 수정 (비번에 ' 싱글 쿼텐션 이거 넣었음)
user 라는 변수에 1번 root 계정을 지정 후 해당 객체의 비번을 갱신하는 형태임
user = User.where(id:1).first
user.password='[원하는 비번]'
user.password_confirmation='[원하는비번]'
user.save
일단 gitlab을 설치 yml은 아래와 같다.
전제조건은 스토리지클래스가 준비가 되어야 되고 외부 이미지 다운이 가능해야 된다
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitlab-data
namespace: gitlab
spec:
storageClassName: [스토리지클래스명]
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitlab-config
namespace: gitlab
spec:
storageClassName: [스토리지클래스명]
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitlab
namespace: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: gitlab
template:
metadata:
labels:
app: gitlab
spec:
containers:
- image: gitlab/gitlab-ce
name: gitlab
ports:
- containerPort: 80
- containerPort: 443
- containerPort: 22
volumeMounts:
- mountPath: /etc/gitlab
name: gitlab-config-volume
- mountPath: /var/opt/gitlab
name: gitlab-data-volume
volumes:
- name: gitlab-config-volume
persistentVolumeClaim:
claimName: gitlab-config
- name: gitlab-data-volume
persistentVolumeClaim:
claimName: gitlab-data
---
apiVersion: v1
kind: Service
metadata:
name: gitlab-service
namespace: gitlab
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
nodePort: 30001
- port: 443
targetPort: 443
protocol: TCP
name: httpd
- port: 22
targetPort: 22
protocol: TCP
name: ssh
selector:
app: gitlab
'k8s' 카테고리의 다른 글
k8s harbor 비번 주의 사항 (0) | 2023.04.18 |
---|---|
k8s namespace 삭제시 pv 디렉토리 archived 모드로 자동 변경 (0) | 2023.04.15 |
k8s공식 gpg 키 서버 500에러 대처법(Google Cloud public signing key 500 error) (0) | 2023.02.27 |
istio-injection 확인 명령어 (0) | 2023.02.07 |
metallb k8s버전업에 따른 변경점 및 Load balancer is being provisioned with MetalLB(service load 는 되어도 kind: L2Advertisement 이거 없으면 안됨) (0) | 2023.02.06 |