Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- docker
- gorm
- Produce
- loadbalance
- kafka-connect
- 쿠버네티스
- Kubernetes
- kibana
- k8s
- Consumer
- minikube
- gin
- broker
- Helm
- create topic
- consumer group
- Kafka Connect
- tls disable
- gortsplib
- Kafka
- Message
- kafka broker
- http
- eck
- go test
- Elk
- Golang
- go
- ElasticSearch
- topic
Archives
- Today
- Total
개발자의 개발괴발
Deploy Elasticsearch and Kibana with Helm 본문
반응형
앞서 elastic-operator와 elasticsearch를 minikube에 배포해봤다.
elastic-operator는 helm으로 elasticsearch는 yaml을 통해서 직접 배포했는데 elasticsearch도 helm을 통해 배포할 수가 있었다.
심지어 helm 배포 한번으로 elasticsearch와 kibana를 한번에 배포할 수 있다.(여기참고)
Helm으로 elasticsearch와 kibana 배포하기
먼저 helm repo를 추가한다.
$ helm repo add elastic https://helm.elastic.co
"elastic" already exists with the same configuration, skipping
$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "metallb" chart repository
...Successfully got an update from the "elastic" chart repository
...Successfully got an update from the "istio" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
배포해보자.
# Install an eck-managed Elasticsearch and Kibana using the default values, which deploys the quickstart examples.
helm install es-kb-quickstart elastic/eck-stack -n elastic-stack --create-namespace
참고할 사항은 operator와 stack이 다른 namespace로 배포되었다.(같은 namespace여도 상관 없다.)
$ k get pod -n elastic-stack
NAME READY STATUS RESTARTS AGE
elasticsearch-es-default-0 1/1 Running 0 60s
es-kb-quickstart-eck-kibana-kb-5d85498bdb-9k8qk 1/1 Running 0 60s
배포가 잘 되었다.
마찬가지로 API를 날려 정상설치되었는지 확인해보자.
$ k port-forward elasticsearch-es-default-0 -n elastic-stack 9200:9200
Forwarding from 127.0.0.1:9200 -> 9200
Forwarding from [::1]:9200 -> 9200
포트포워딩을 하고
$ k get secret elasticsearch-es-elastic-user -n elastic-stack -o go-template='{{.data.elastic | base64decode}}'
4Nktb4eDL5LB05hV25Xnr502
$ PASSWORD=$(kubectl get secret elasticsearch-es-elastic-user -n elastic-stack -o go-template='{{.data.elastic | base64decode}}')
$ curl -u "elastic:$PASSWORD" "http://localhost:9200"
curl: (52) Empty reply from server
응답이 정상은 아닌것 같다.
ES에서 로그를 확인해보니
{
"@timestamp": "2025-04-25T12:26:33.483Z",
"log.level": "WARN",
"message": "received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:50908}",
"ecs.version": "1.2.0",
"service.name": "ES_ECS",
"event.dataset": "elasticsearch.server",
"process.thread.name": "elasticsearch[elasticsearch-es-default-0][transport_worker][T#1]",
"log.logger": "org.elasticsearch.http.netty4.Netty4HttpServerTransport",
"elasticsearch.cluster.uuid": "jkAtwwMATvqROuPhcqXhyg",
"elasticsearch.node.id": "cseIWRj5QNKYu59C7Z-t6g",
"elasticsearch.node.name": "elasticsearch-es-default-0",
"elasticsearch.cluster.name": "elasticsearch"
}
https 채널에 http로 요청이 와서 그런것 같다.
tls를 disable하고 다시 배포해보자.
yaml 파일은 여기를 참고했다.
# es-values.yaml
---
eck-elasticsearch:
# Name of the Elasticsearch resource.
#
fullnameOverride: quickstart
# Version of Elasticsearch.
#
version: 9.0.0
http:
tls:
selfSignedCertificate:
disabled: true # TLS 비활성화
nodeSets:
- name: default
count: 1
config:
# Comment out when setting the vm.max_map_count via initContainer, as these are mutually exclusive.
# For production workloads, it is strongly recommended to increase the kernel setting vm.max_map_count to 262144
# and leave node.store.allow_mmap unset.
# ref: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html
#
node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
# Adjust to your storage class name
#
# storageClassName: local-storage
eck-kibana:
# Name of the Kibana resource.
#
fullnameOverride: quickstart
# Version of Kibana.
#
version: 9.0.0
spec:
# Count of Kibana replicas to create.
#
count: 1
# Reference to ECK-managed Elasticsearch resource, ideally from {{ "elasticsearch.fullname" }}
#
elasticsearchRef:
name: quickstart
# namespace: default
http:
service:
spec:
# Type of service to deploy for Kibana.
# This deploys a load balancer in a cloud service provider, where supported.
#
type: LoadBalancer
# tls:
# selfSignedCertificate:
# subjectAltNames:
# - ip: 1.2.3.4
# - dns: kibana.example.com
podTemplate:
spec:
containers:
- name: kibana
env:
- name: NODE_OPTIONS
value: "--max-old-space-size=2048"
resources:
requests:
memory: 1Gi
cpu: 0.5
limits:
memory: 2.5Gi
cpu: 2
위와같이 설정했으면 helm upgrade를 하자.
helm upgrade es-kb-quickstart elastic/eck-stack -n elastic-stack --values es-values.yaml
재기동이 되었으면 다시 curl을 날려보자.
$ PASSWORD=$(kubectl get secret quickstart-es-elastic-user -n elastic-stack -o go-template='{{.data.elastic | base64decode}}')
$ curl -u "elastic:$PASSWORD" "http://localhost:9200"
{
"name" : "quickstart-es-default-0",
"cluster_name" : "quickstart",
"cluster_uuid" : "1Ktu0WXvQeS3vljk0D2SBw",
"version" : {
"number" : "9.0.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "112859b85d50de2a7e63f73c8fc70b99eea24291",
"build_date" : "2025-04-08T15:13:46.049795831Z",
"build_snapshot" : false,
"lucene_version" : "10.1.0",
"minimum_wire_compatibility_version" : "8.18.0",
"minimum_index_compatibility_version" : "8.0.0"
},
"tagline" : "You Know, for Search"
}
제대로된 응답이 온 것 같다.
(kibana는 아직 잘 몰라 나중에 내용을 추가하겠다.)
반응형
'개발 > ELK' 카테고리의 다른 글
Kibana에 접근하기 (1) | 2025.04.26 |
---|---|
Deploy Elasticsearch on minikube (0) | 2025.04.25 |