티스토리 뷰

준비

- monitoring 네임스페이스

- helm 설치

 

Git Clone

$ git clone https://github.com/prometheus-community/helm-charts
$ cd helm-charts/charts/kube-prometheus-stack

 

Helm dependency upgrade

$ helm dependencies update

 

values.yaml 수정

그라파나와 프로메테우스의 service 타입을 clusterIp에서 nodePort로 변경

# values.yaml 
grafana:
  service:
    enabled: true
    type: NodePort
    port: 80
    targetPort: 3000
    nodePort: 31030
    portName: service
    
  service:
    annotations: {}
    labels: {}
    clusterIP: ""

    ## Port for Prometheus Service to listen on
    ##
    port: 9090

    ## To be used with a proxy extraContainer port
    targetPort: 9090

    ## List of IP addresses at which the Prometheus server service is available
    ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
    ##
    externalIPs: []

    ## Port to expose on each node
    ## Only used if service.type is 'NodePort'
    ##
    nodePort: 30090

    ## Loadbalancer IP
    ## Only use if service.type is "LoadBalancer"
    loadBalancerIP: ""
    loadBalancerSourceRanges: []
    ## Service type
    ##
    #type: ClusterIP
    type: NodePort

    sessionAffinity: ""

 

Helm 파일 설치

$ cd helm-charts/charts/kube-prometheus-stack
$ helm install kube-prometheus-stack . --namespace monitoring

 

에러해결 node exporter bind: address already in use

cd /helm-charts/charts/prometheus-node-exporter

vim values.yaml
#service port를 9100에서 9101으로 수정하고, 그에 맞춰 targetport도 수정
service:
  type: ClusterIP
  port: 9101
  targetPort: 9101
  nodePort:
  portName: metrics
  listenOnAllInterfaces: true
  annotations:
    prometheus.io/scrape: "true"

이렇게 수정한 후

cd /helm-charts/charts/kube-prometheus-stack
vim Chart.yaml

#dependency 차트를 다음과 같이 수정한 로컬 value로 변경
- name: prometheus-node-exporter
  version: "2.5.*"
  repository: "file://../../charts//prometheus-node-exporter"
  condition: nodeExporter.enabled

마지막으로 upgrade

helm dependencies update
helm upgrade kube-prometheus-stack . --namespace monitoring
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함