환경구성

EKS 1.28

기존에 설치 되어 있는 Prometheus : https://tistory-cloud.tistory.com/59


작업 내용

 

1. prometheus-operator-crd 설치

2. kube-prometheus-stack 설치

 


상세 작업 내용

 

 

1. prometheus-operator-crd 설치

  • Thanos 사용을 위한 prometheus-operator 설치
#chart : prometheus-operator-crds
git clone https://github.com/prometheus-community/helm-charts

경로 : helm-charts/charts/prometheus-operator-crds

helm install -f prometheus-operator-crds values.yaml ./

 

2. kube-prometheus-stack 설치

#chart: kube-prometheus-stack
git clone https://github.com/prometheus-community/helm-charts
경로 : helm-charts/charts/kube-prometheus-stack

 

  • chart.yaml 에서 dependencies 수정
#Chart.yaml 에서 아래와 같이 dependencies 를 주석처리
#
dependencies:
  #  - name: crds
  #  version: "0.0.0"
  #  condition: crds.enabled
      #  - name: kube-state-metrics
      #version: "5.14.*"
      #repository: https://prometheus-community.github.io/helm-charts
      #condition: kubeStateMetrics.enabled
      #  - name: prometheus-node-exporter
      #version: "4.23.*"
      #repository: https://prometheus-community.github.io/helm-charts
      #condition: nodeExporter.enabled
      #  - name: grafana
      #version: "6.60.*"
      #repository: https://grafana.github.io/helm-charts
      #condition: grafana.enabled
      #- name: prometheus-windows-exporter
      #repository: https://prometheus-community.github.io/helm-charts
      #version: "0.1.*"
      #condition: windowsMonitoring.enabled
helm dependency update

 

 

Thanos

Thanos - Highly available Prometheus setup with long term storage capabilities

thanos.io

objstore.yaml 생성

수정내용
	buket <버켓명>
	endpoint <s3.ap-northeast-2.amazonaws.com>
	region <ap-northeast-2>
	access_key <key>
	secret_key <key>
    
--------------------------------------

type: S3
config:
  bucket: ""
  endpoint: ""
  region: ""
  aws_sdk_auth: false
  access_key: ""
  insecure: false
  signature_version2: false
  secret_key: ""
  session_token: ""
  put_user_metadata: {}
  http_config:
    idle_conn_timeout: 1m30s
    response_header_timeout: 2m
    insecure_skip_verify: false
    tls_handshake_timeout: 10s
    expect_continue_timeout: 1s
    max_idle_conns: 100
    max_idle_conns_per_host: 100
    max_conns_per_host: 0
    tls_config:
      ca_file: ""
      cert_file: ""
      key_file: ""
      server_name: ""
      insecure_skip_verify: false
    disable_compression: false
  trace:
    enable: false
  list_objects_version: ""
  bucket_lookup_type: auto
  part_size: 67108864
  sse_config:
    type: ""
    kms_key_id: ""
    kms_encryption_context: {}
    encryption_key: ""
  sts_endpoint: ""
prefix: ""

 

  • 시크릿 생성
kubectl create secret generic objstore-secret \
  --from-file=objstore.yaml \
  --namespace default
  • values.yaml 수정
사용하지않는 컴포넌트 미사용으로 설정
사용하는경우 개인적으로 수정해서 사용하면 됨

EX)
		#239 alertmanager false
		#900 grafana false
		#1866 kubestatemetrics false
        
        3442 thanos secret setting <아래 사진참고>

 

  • helm install
helm install kube-prometheus-stack -f values.yaml ./

 

 

 

※참고자료

Prometheus Install : https://tistory-cloud.tistory.com/59

Prometheus Operater : https://tistory-cloud.tistory.com/60

Prometheus Thanos 연동 : https://tistory-cloud.tistory.com/61

+ Recent posts