- operator 설치 (수동설치)
- 프로젝트 생성
$ oc new-project <your-project-name>
- 프로젝트 이동
$ oc project <your-project-name>
- git 소스 다운로드
$ git clone https://github.com/RedisLabs/redis-enterprise-k8s-docs
- scc 적용 (git 소스로 폴더 이동 후 진행)
$ oc apply -f openshift/scc.yaml securitycontextconstraints.security.openshift.io "redis-enterprise-scc" configured
- Operator permission 설정
$ oc adm policy add-scc-to-user redis-enterprise-scc system:serviceaccount:<my-project>:redis-enterprise-operator $ oc adm policy add-scc-to-user redis-enterprise-scc system:serviceaccount:<my-project>:<rec>
- operator 배포
$ oc apply -f openshift.bundle.yaml
→ oc get deployment로 배포 확인
NAME READY UP-TO-DATE AVAILABLE AGE redis-enterprise-operator 1/1 1 1 0m36s
- 프로젝트 생성
- Redis Enterprise Cluster (REC) custom resource 생성
- rec resource file 이용→ git source 의 openshift/rec_rhecl.yaml 사용
- rec 파일 수정
기존 파일 수정 apiVersion: app.redislabs.com/v1kind: RedisEnterpriseClustermetadata: name: recspec: # Add fields here nodes: 3 redisEnterpriseImageSpec: repository: registry.connect.redhat.com/redislabs/redis-enterprise versionTag: 6.2.10-90.rhel7-openshift redisEnterpriseServicesRiggerImageSpec: repository: registry.connect.redhat.com/redislabs/services-manager bootstrapperImageSpec: repository: registry.connect.redhat.com/redislabs/redis-enterprise-operator apiVersion: app.redislabs.com/v1kind: RedisEnterpriseClustermetadata: name: recspec: # Add fields here nodes: 3 redisEnterpriseImageSpec: repository: ecrdev.clouz.io/registry.connect.redhat.com/redislabs/redis-enterprise versionTag: 6.2.8-64.rhel7-openshift redisEnterpriseServicesRiggerImageSpec: repository: ecrdev.clouz.io/registry.connect.redhat.com/redislabs/services-manager bootstrapperImageSpec: repository: ecrdev.clouz.io/registry.connect.redhat.com/redislabs/redis-enterprise-operator → 이미지 주소 수정 및 ecr에 넣어서 사용
- rec 파일 적용 (rec_rhel.yaml)
$ oc apply -f rec_rhecl.yaml
- 상태 확인
$ oc get po NAME READY STATUS RESTARTS AGE rec-test-0 2/2 Running 257 (21h ago) 36h rec-test-1 2/2 Running 4 (21h ago) 21h rec-test-2 2/2 Running 2 (21h ago) 21h rec-test-services-rigger-6fd587c78d-rczg7 1/1 Running 0 42h redis-enterprise-operator-cc9f58fc7-4mw76 2/2 Running 10 (2d1h ago) 2d2h
→ 에러 발생하여 pod이 안올라오는데 해결 후 services-rigger, rec-test-0, rec statefulset 올라옴
- admin console 접속
- service 확인
$ oc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE admission ClusterIP 172.130.240.81 <none> 443/TCP 5d20h rec-test ClusterIP None <none> 9443/TCP,8001/TCP,8070/TCP 44h rec-test-prom ClusterIP None <none> 8070/TCP 44h rec-test-ui ClusterIP 172.130.87.247 <none> 8443/TCP 44h
- route 생성
$ oc expose svc rec-test-ui route.route.openshift.io/rec-test-ui exposed
→ 하지만 접속이 잘 되지 않음→ tls 옵션 문제, passthrough로 설정
oc create route passthrough <route 이름> --service=rec-test-ui --port=8443
→ passthrough 옵션 이용해서 route 생성
- route 편집
spec: host: rec-test-ui-redis-enterprise.d3.clouz.io to: kind: Service name: rec-test-ui weight: 100 port: targetPort: ui tls: termination: passthrough insecureEdgeTerminationPolicy: Redirect wildcardPolicy: None
→ tls 옵션 추가
- service 확인
Trouble Shotting
- rec crd 추가 후 올라온 pod 에러
Readiness probe failed: Traceback (most recent call last): File "/opt/redislabs/mount/health_check.py", line 24, in <module> file_handler = handlers.TimedRotatingFileHandler('/var/opt/redislabs/log/readiness_check.log', File "/opt/redislabs/lib/python3.9/logging/handlers.py", line 208, in __init__ BaseRotatingHandler.__init__(self, filename, 'a', encoding=encoding, File "/opt/redislabs/lib/python3.9/logging/handlers.py", line 58, in __init__ logging.FileHandler.__init__(self, filename, mode=mode, File "/opt/redislabs/lib/python3.9/logging/__init__.py", line 1146, in __init__ StreamHandler.__init__(self, self._open()) File "/opt/redislabs/lib/python3.9/logging/__init__.py", line 1175, in _open return open(self.baseFilename, self.mode, encoding=self.encoding, PermissionError: [Errno 13] Permission denied: '/var/opt/redislabs/log/readiness_check.log'
→ pod 올라 온 노드에 들어가서 일단 폴더 권한 1001:1001로 설정하니 log 파일 생성되어 pod 올라옴
$ df |grep csi
172.30.249.100:/csishare-csivol-1e2dcc98b9 12058624 2352384 9706240 20% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-1e2dcc98b9/globalmount
172.30.249.100:/csishare-csivol-f0c88861d7 12058624 1603328 10455296 14% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-f0c88861d7/globalmount
172.30.249.100:/csishare-csivol-006af47a4a 4718592 1583616 3134976 34% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-006af47a4a/globalmount
172.30.249.100:/csishare-csivol-cc6bc1b5b0 4718592 1792256 2926336 38% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-cc6bc1b5b0/globalmount
172.30.249.100:/csishare-csivol-0c72deb9e2 12058624 1594624 10464000 14% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-0c72deb9e2/globalmount
172.30.249.100:/csishare-csivol-21fd1dd6cf 3670016 1587200 2082816 44% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-21fd1dd6cf/globalmount
172.30.249.100:/csishare-csivol-c71b2f980e 6815744 1582336 5233408 24% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-c71b2f980e/globalmount
172.30.249.100:/csishare-csivol-3944eeed52 3670016 1582336 2087680 44% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-3944eeed52/globalmount
172.30.249.100:/csishare-csivol-f583b1de27 6815744 1624576 5191168 24% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-f583b1de27/globalmount
172.30.249.100:/csishare-csivol-282e1df81b 22544384 1582080 20962304 8% /var/lib/kubelet/plugins/kubernetes.io/csi/pv/csivol-282e1df81b/globalmount
172.30.249.100:/csishare-csivol-282e1df81b/logs 22544384 1582080 20962304 8% /var/lib/kubelet/pods/e7b355bd-2d76-4a16-8315-f50cf1740bc8/volume-subpaths/csivol-282e1df81b/redis-enterprise-node/3
→ df |grep csi 명령어를 통해 폴더 위치 확인
→ /var/lib/kubelet/pods/e7b355bd-2d76-4a16-8315-f50cf1740bc8/volume-subpaths/csivol-282e1df81b/redis-enterprise-node/3 이 폴더의 권한 1001로 설정
댓글 영역