Skip to content

Instantly share code, notes, and snippets.

@alicek106
Last active May 1, 2021 02:21
Show Gist options
  • Save alicek106/c01f8dcb0d8b562a2dc0a761dce59a42 to your computer and use it in GitHub Desktop.
Save alicek106/c01f8dcb0d8b562a2dc0a761dce59a42 to your computer and use it in GitHub Desktop.
prometheus-simple.yaml
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
labels:
owner: alicek106
name: prometheus
namespace: default
spec:
alerting:
alertmanagers:
- name: alice-alertmanager
namespace: default
port: 9093
image: quay.io/prometheus/prometheus:v2.16.0
nodeSelector:
kubernetes.io/os: linux
# podMonitorNamespaceSelector: {}
# podMonitorSelector: {}
replicas: 2
resources:
limits:
cpu: "0.5"
memory: 500Mi
requests:
cpu: "0.5"
memory: 500Mi
ruleSelector:
matchLabels:
owner: alicek106
role: alert-rules
securityContext:
fsGroup: 2000
runAsNonRoot: true
runAsUser: 1000
serviceAccountName: prometheus
serviceMonitorNamespaceSelector: {}
serviceMonitorSelector: {}
storage:
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: gp2
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: default
@Jivvon
Copy link

Jivvon commented Apr 30, 2021

너무 잘 봤습니다!! 항상 감사합니다 👍

ServiceAccount를 생성하는 부분이 본문의 앞쪽에서 아래의 명령어로 설치하는 것과 같은데, 혹시 따로 추가하신 이유가 있을까요?

$ kubectl apply -f prometheus-operator/example/rbac/prometheus/prometheus-service-account.yaml

@alicek106
Copy link
Author

작성한지 좀 된 글이라 정확하게 기억나지는 않습니다만..

rbac/prometheus/prometheus-service-account.yaml 은 Prometheus 커스텀 리소스로부터 생성될 스테이트풀셋이 사용할 서비스 어카운트입니다. https://gist.githubusercontent.com/alicek106/c01f8dcb0d8b562a2dc0a761dce59a42/raw/f636ae258813bbf5ebd6560c804cbaf1d40c4810/prometheus-simple.yaml 에 보시면 serviceAccountName에 prometheus라는 이름의 서비스 어카운트를 넣어주고 있습니다.

이걸 질문하신게 맞는지 모르겠습니다 ^^;; 다른게 궁금하시면 또 멘션주세요 @Jivvon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment