2.12.2.2. 기본 인증을 위한 샘플 YAML
다음은 openshift-monitoring 네임스페이스에 rw-basic-auth 라는 Secret 오브젝트에 대한 샘플 기본 인증 설정을 보여줍니다.
apiVersion: v1
kind: Secret
metadata:
name: rw-basic-auth
namespace: openshift-monitoring
stringData:
user: <basic_username>
password: <basic_password>
type: Opaque
다음 샘플은 openshift-monitoring 네임스페이스에서 rw-basic-auth 라는 Secret 오브젝트를 사용하는 basicAuth 원격 쓰기 구성을 보여줍니다. 끝점에 대한 인증 자격 증명을 이미 설정했다고 가정합니다.
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
prometheusK8s:
remoteWrite:
- url: "https://basicauth.example.com/api/write"
basicAuth:
username:
name: rw-basic-auth
key: user
password:
name: rw-basic-auth
key: password