4.10. Redis를 사용하여 보안 통신 구성
Red Hat OpenShift GitOps와 함께 TLS(Transport Layer Security) 암호화를 사용하면 Argo CD 구성 요소와 Redis 캐시 간의 통신을 보호하고 전송 시 중요한 데이터를 보호할 수 있습니다.
다음 구성 중 하나를 사용하여 Redis와의 통신을 보호할 수 있습니다.
-
autotls설정을 활성화하여 TLS 암호화에 적절한 인증서를 발급합니다. -
키 및 인증서 쌍으로
argocd-operator-redis-tls시크릿을 생성하여 TLS 암호화를 수동으로 구성합니다.
두 구성 모두 HA(고가용성)를 활성화하거나 사용하지 않고 사용할 수 있습니다.
사전 요구 사항
-
cluster-admin권한이 있는 클러스터에 액세스할 수 있습니다. - OpenShift Container Platform 웹 콘솔에 액세스할 수 있습니다.
- Red Hat OpenShift GitOps Operator가 클러스터에 설치되어 있습니다.
4.10.1. autotls가 활성화된 Redis의 TLS 구성
새 또는 기존 Argo CD 인스턴스에서 autotls 설정을 활성화하여 Redis에 대한 TLS 암호화를 구성할 수 있습니다. 이 구성은 argocd-operator-redis-tls 시크릿을 자동으로 프로비저닝하고 추가 단계가 필요하지 않습니다. 현재 OpenShift Container Platform은 지원되는 유일한 시크릿 공급자입니다.
기본적으로 autotls 설정은 비활성화되어 있습니다.
프로세스
- OpenShift Container Platform 웹 콘솔에 로그인합니다.
autotls가 활성화된 Argo CD 인스턴스를 생성합니다.- 웹 콘솔의 관리자 화면에서 왼쪽 탐색 패널을 사용하여 Administration → CustomResourceDefinitions 로 이동합니다.
-
argocds.argoproj.io를 검색하고ArgoCDCRD(사용자 정의 리소스 정의)를 클릭합니다. - CustomResourceDefinition 세부 정보 페이지에서 Instances 탭을 클릭한 다음 Create ArgoCD 를 클릭합니다.
다음 예와 유사한 YAML을 편집하거나 교체합니다.
autotls가 활성화된 Argo CD CR의 예
apiVersion: argoproj.io/v1alpha1 kind: ArgoCD metadata: name: argocd 1 namespace: openshift-gitops 2 spec: redis: autotls: openshift 3 ha: enabled: true 4
작은 정보또는 다음 명령을 실행하여 기존 Argo CD 인스턴스에서
autotls설정을 활성화할 수 있습니다.$ oc patch argocds.argoproj.io <instance-name> --type=merge -p '{"spec":{"redis":{"autotls":"openshift"}}}'- 생성을 클릭합니다.
Argo CD Pod가 준비되어 실행 중인지 확인합니다.
$ oc get pods -n <namespace> 1- 1
- Argo CD 인스턴스가 실행 중인 네임스페이스를 지정합니다(예:
openshift-gitops).
HA가 비활성화된 출력 예
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 26s argocd-redis-84b77d4f58-vp6zm 1/1 Running 0 37s argocd-repo-server-5b959b57f4-znxjq 1/1 Running 0 37s argocd-server-6b8787d686-wv9zh 1/1 Running 0 37s
참고HA 지원 TLS 구성에는 작업자 노드가 3개 이상인 클러스터가 필요합니다. HA 구성으로 Argo CD 인스턴스를 활성화한 경우 출력이 표시되는 데 몇 분이 걸릴 수 있습니다.
HA가 활성화된 출력 예
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 10m argocd-redis-ha-haproxy-669757fdb7-5xg8h 1/1 Running 0 10m argocd-redis-ha-server-0 2/2 Running 0 9m9s argocd-redis-ha-server-1 2/2 Running 0 98s argocd-redis-ha-server-2 2/2 Running 0 53s argocd-repo-server-576499d46d-8hgbh 1/1 Running 0 10m argocd-server-9486f88b7-dk2ks 1/1 Running 0 10m
argocd-operator-redis-tls보안이 생성되었는지 확인합니다.$ oc get secrets argocd-operator-redis-tls -n <namespace> 1- 1
- Argo CD 인스턴스가 실행 중인 네임스페이스를 지정합니다(예:
openshift-gitops).
출력 예
NAME TYPE DATA AGE argocd-operator-redis-tls kubernetes.io/tls 2 30s
시크릿은
kubernetes.io/tls유형이어야 하며 크기는2여야 합니다.
4.10.2. autotls가 비활성화된 상태로 Redis의 TLS 구성
키 및 인증서 쌍으로 argocd-operator-redis-tls 시크릿을 생성하여 Redis에 대한 TLS 암호화를 수동으로 구성할 수 있습니다. 또한 적절한 Argo CD 인스턴스에 속해 있음을 나타내려면 시크릿에 주석을 달아야 합니다. 인증서 및 보안을 생성하는 단계는 HA(고가용성)가 활성화된 인스턴스에 따라 다릅니다.
프로세스
- OpenShift Container Platform 웹 콘솔에 로그인합니다.
Argo CD 인스턴스를 생성합니다.
- 웹 콘솔의 관리자 화면에서 왼쪽 탐색 패널을 사용하여 Administration → CustomResourceDefinitions 로 이동합니다.
-
argocds.argoproj.io를 검색하고ArgoCDCRD(사용자 정의 리소스 정의)를 클릭합니다. - CustomResourceDefinition 세부 정보 페이지에서 Instances 탭을 클릭한 다음 Create ArgoCD 를 클릭합니다.
다음 예와 유사한 YAML을 편집하거나 교체합니다.
autotls가 비활성화된 ArgoCD CR의 예
apiVersion: argoproj.io/v1alpha1 kind: ArgoCD metadata: name: argocd 1 namespace: openshift-gitops 2 spec: ha: enabled: true 3
- 생성을 클릭합니다.
Argo CD Pod가 준비되어 실행 중인지 확인합니다.
$ oc get pods -n <namespace> 1- 1
- Argo CD 인스턴스가 실행 중인 네임스페이스를 지정합니다(예:
openshift-gitops).
HA가 비활성화된 출력 예
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 26s argocd-redis-84b77d4f58-vp6zm 1/1 Running 0 37s argocd-repo-server-5b959b57f4-znxjq 1/1 Running 0 37s argocd-server-6b8787d686-wv9zh 1/1 Running 0 37s
참고HA 지원 TLS 구성에는 작업자 노드가 3개 이상인 클러스터가 필요합니다. HA 구성으로 Argo CD 인스턴스를 활성화한 경우 출력이 표시되는 데 몇 분이 걸릴 수 있습니다.
HA가 활성화된 출력 예
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 10m argocd-redis-ha-haproxy-669757fdb7-5xg8h 1/1 Running 0 10m argocd-redis-ha-server-0 2/2 Running 0 9m9s argocd-redis-ha-server-1 2/2 Running 0 98s argocd-redis-ha-server-2 2/2 Running 0 53s argocd-repo-server-576499d46d-8hgbh 1/1 Running 0 10m argocd-server-9486f88b7-dk2ks 1/1 Running 0 10m
HA 구성에 따라 다음 옵션 중 하나를 사용하여 Redis 서버에 대한 자체 서명 인증서를 생성합니다.
HA가 비활성화된 Argo CD 인스턴스의 경우 다음 명령을 실행합니다.
$ openssl req -new -x509 -sha256 \ -subj "/C=XX/ST=XX/O=Testing/CN=redis" \ -reqexts SAN -extensions SAN \ -config <(printf "\n[SAN]\nsubjectAltName=DNS:argocd-redis.<namespace>.svc.cluster.local\n[req]\ndistinguished_name=req") \ 1 -keyout /tmp/redis.key \ -out /tmp/redis.crt \ -newkey rsa:4096 \ -nodes \ -sha256 \ -days 10- 1
- Argo CD 인스턴스가 실행 중인 네임스페이스를 지정합니다(예:
openshift-gitops).
출력 예
Generating a RSA private key ...............++++ ............................++++ writing new private key to '/tmp/redis.key'
HA가 활성화된 Argo CD 인스턴스의 경우 다음 명령을 실행합니다.
$ openssl req -new -x509 -sha256 \ -subj "/C=XX/ST=XX/O=Testing/CN=redis" \ -reqexts SAN -extensions SAN \ -config <(printf "\n[SAN]\nsubjectAltName=DNS:argocd-redis-ha-haproxy.<namespace>.svc.cluster.local\n[req]\ndistinguished_name=req") \ 1 -keyout /tmp/redis-ha.key \ -out /tmp/redis-ha.crt \ -newkey rsa:4096 \ -nodes \ -sha256 \ -days 10- 1
- Argo CD 인스턴스가 실행 중인 네임스페이스를 지정합니다(예:
openshift-gitops).
출력 예
Generating a RSA private key ...............++++ ............................++++ writing new private key to '/tmp/redis-ha.key'
다음 명령을 실행하여 생성된 인증서 및 키를
/tmp디렉토리에서 사용할 수 있는지 확인합니다.$ cd /tmp
$ ls
HA가 비활성화된 출력 예
... redis.crt redis.key ...
HA가 활성화된 출력 예
... redis-ha.crt redis-ha.key ...
HA 구성에 따라 다음 옵션 중 하나를 사용하여
argocd-operator-redis-tls시크릿을 생성합니다.HA가 비활성화된 Argo CD 인스턴스의 경우 다음 명령을 실행합니다.
$ oc create secret tls argocd-operator-redis-tls --key=/tmp/redis.key --cert=/tmp/redis.crt
HA가 활성화된 Argo CD 인스턴스의 경우 다음 명령을 실행합니다.
$ oc create secret tls argocd-operator-redis-tls --key=/tmp/redis-ha.key --cert=/tmp/redis-ha.crt
출력 예
secret/argocd-operator-redis-tls created
Argo CD CR에 속함을 나타내기 위해 보안에 주석을 답니다.
$ oc annotate secret argocd-operator-redis-tls argocds.argoproj.io/name=<instance-name> 1- 1
- Argo CD 인스턴스의 이름을 지정합니다(예:
argocd).
출력 예
secret/argocd-operator-redis-tls annotated
Argo CD Pod가 준비되어 실행 중인지 확인합니다.
$ oc get pods -n <namespace> 1- 1
- Argo CD 인스턴스가 실행 중인 네임스페이스를 지정합니다(예:
openshift-gitops).
HA가 비활성화된 출력 예
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 26s argocd-redis-84b77d4f58-vp6zm 1/1 Running 0 37s argocd-repo-server-5b959b57f4-znxjq 1/1 Running 0 37s argocd-server-6b8787d686-wv9zh 1/1 Running 0 37s
참고HA 구성으로 Argo CD 인스턴스를 활성화한 경우 출력이 표시되는 데 몇 분이 걸릴 수 있습니다.
HA가 활성화된 출력 예
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 10m argocd-redis-ha-haproxy-669757fdb7-5xg8h 1/1 Running 0 10m argocd-redis-ha-server-0 2/2 Running 0 9m9s argocd-redis-ha-server-1 2/2 Running 0 98s argocd-redis-ha-server-2 2/2 Running 0 53s argocd-repo-server-576499d46d-8hgbh 1/1 Running 0 10m argocd-server-9486f88b7-dk2ks 1/1 Running 0 10m