This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.4.14. 이벤트 리스너로 Webhook 보안
관리자는 이벤트 리스너를 사용하여 Webhook를 보호할 수 있습니다. 네임스페이스를 생성한 후 네임스페이스에 operator.tekton.dev/enable-annotation=enabled 레이블을 추가하여 Eventlistener 리소스의 HTTPS를 활성화합니다. 그런 다음 재암호화 TLS 종료를 사용하여 Trigger 리소스 및 보안 경로를 생성합니다.
Red Hat OpenShift Pipelines에서 트리거는 Eventlistener 리소스에 대한 비보안 HTTP 및 보안 HTTPS 연결을 모두 지원합니다. HTTPS는 클러스터 내부 및 외부의 연결을 보호합니다.
Red Hat OpenShift Pipelines는 네임스페이스의 레이블을 감시하는 tekton-operator-proxy-webhook Pod를 실행합니다. 네임스페이스에 라벨을 추가하면 Webhook에서 EventListener 오브젝트에 service.beta.openshift.io/serving-cert-secret-name=<secret_name> 주석을 설정합니다. 이를 통해 시크릿과 필수 인증서를 생성합니다.
service.beta.openshift.io/serving-cert-secret-name=<secret_name>
service.beta.openshift.io/serving-cert-secret-name=<secret_name>
또한 생성된 시크릿을 Eventlistener pod 마운트하여 요청을 보호할 수 있습니다.
4.14.1. OpenShift 경로와의 보안 연결 제공 링크 복사링크가 클립보드에 복사되었습니다!
재암호화 TLS 종료로 경로를 생성합니다.
oc create route reencrypt --service=<svc-name> --cert=tls.crt --key=tls.key --ca-cert=ca.crt --hostname=<hostname>
$ oc create route reencrypt --service=<svc-name> --cert=tls.crt --key=tls.key --ca-cert=ca.crt --hostname=<hostname>
또는 재암호화된 TLS 종료 YAML 파일을 만들어 보안 경로를 만들 수도 있습니다.
보안 경로를 생성하기 위해 TLS 종료 YAML을 재암호화하는 예
oc create route reencrypt --help 명령을 실행하여 더 많은 옵션을 표시할 수 있습니다.
4.14.2. 보안 HTTPS 연결을 사용하여 샘플 EventListener 리소스 생성 링크 복사링크가 클립보드에 복사되었습니다!
이 섹션에서는 pipelines-tutorial 예제를 사용하여 보안 HTTPS 연결을 사용하여 샘플 EventListener 리소스 생성을 만드는 방법을 보여줍니다.
절차
pipelines-tutorial 리포지토리에서 사용 가능한 YAML 파일에서
TriggerBinding리소스를 생성합니다.oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/01_binding.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/01_binding.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow pipelines-tutorial 리포지토리에서 직접
TriggerTemplate리소스를 생성합니다.oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/02_template.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/02_template.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow pipelines-tutorial 리포지토리에서 직접
Trigger리소스를 생성합니다.oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/03_trigger.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/03_trigger.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 보안 HTTPS 연결을 사용하여
EventListener리소스를 생성합니다.Eventlistener리소스에 대한 보안 HTTPS 연결을 활성화하려면 레이블을 추가합니다.oc label namespace <ns-name> operator.tekton.dev/enable-annotation=enabled
$ oc label namespace <ns-name> operator.tekton.dev/enable-annotation=enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow pipelines-tutorial 리포지토리에서 사용 가능한 YAML 파일에서
EventListener리소스를 생성합니다.oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/04_event_listener.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/04_event_listener.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 재암호화 TLS 종료로 경로를 생성합니다.
oc create route reencrypt --service=<svc-name> --cert=tls.crt --key=tls.key --ca-cert=ca.crt --hostname=<hostname>
$ oc create route reencrypt --service=<svc-name> --cert=tls.crt --key=tls.key --ca-cert=ca.crt --hostname=<hostname>Copy to Clipboard Copied! Toggle word wrap Toggle overflow