使用helm创建elastic

2 篇文章 0 订阅
coding: https://gitee.com/pangfaheng/devops-coding/tree/master/kubernets/elastic
git: https://github.com/elastic/helm-charts

1. env

1.1 K8S SERVER

os: centos7(3.10.0-1160.el7.x86_64)
helm: v3.7.0
k8s: 3 master; 3 node
    kubelet-1.18.14 kubeadm-1.18.14 kubectl-1.18.14    
docker: containerd.io-1.2.13 docker-ce-19.03.11 docker-ce-cli-19.03.11 

1.2 NFS SERVER

[root@nfs-server-01 ~]# ip a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"|awk -F '/' '{print $1}'
192.1.0.21
[root@nfs-server-01 ~]# cat /etc/export0
/data  *(rw,sync,no_root_squash)
[root@nfs-server-01 ~]# ps aux|grep nfs
root        960  0.0  0.0      0     0 ?        S<   13:40   0:00 [nfsd4_callbacks]
root        969  0.0  0.0      0     0 ?        S    13:40   0:00 [nfsd]
root        970  0.0  0.0      0     0 ?        S    13:40   0:00 [nfsd]
root        971  0.0  0.0      0     0 ?        S    13:40   0:00 [nfsd]
root        972  0.0  0.0      0     0 ?        S    13:40   0:00 [nfsd]
root        973  0.0  0.0      0     0 ?        S    13:40   0:00 [nfsd]
root        974  0.0  0.0      0     0 ?        S    13:40   0:00 [nfsd]
root        975  0.0  0.0      0     0 ?        S    13:40   0:01 [nfsd]
root        976  0.0  0.0      0     0 ?        S    13:40   0:04 [nfsd]
root      13291  0.0  0.0 112816   960 pts/0    S+   19:21   0:00 grep --color=auto nfs

1.3 elastic version

tag: 7.14.0

1.4 namespace

kubectl create namespace elastic

2. create nfs-client-provisioner

2.1 get yaml

helm inspect values stable/nfs-client-provisioner

2.2 modify the nfs server, nfs path, name of nfs-client.yaml

replicaCount: 3
strategyType: Recreate
image:
  repository: quay.io/external_storage/nfs-client-provisioner
  tag: v3.1.0-k8s1.11
  pullPolicy: IfNotPresent
nfs:
  # here
  server: 192.1.0.21
  path: /data
  mountOptions:
storageClass:
  create: true
  defaultClass: false
  # here
  name: nfs-client
  allowVolumeExpansion: true
  reclaimPolicy: Delete
  archiveOnDelete: true
  accessModes: ReadWriteOnce
rbac:
  create: true
podSecurityPolicy:
  enabled: false
serviceAccount:
  create: true
  name:
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}

2.3. install and uninstall

# install
helm install -n elastic nfs-client stable/nfs-client-provisioner -f nfs-client.yaml

# watch
helm list -n elastic

# upgrade
helm upgrade [RELEASE] [CHART] [flags]
helm upgrade -n elastic -f nfs-client.yaml nfs-client stable/nfs-client-provisioner

# uninstall
helm uninstall -n elastic nfs-client

在这里插入图片描述

3 create elasticsearch

3.1 get elasticsearch.yaml

helm repo add elastic https://helm.elastic.co
helm show values elastic/elasticsearch > values.yaml

3.2 add storageClassName of values.yaml

# The storageClassName must be consistent with nfs-client-provisioner's name
volumeClaimTemplate:
  storageClassName: "nfs-client"
  accessModes: ["ReadWriteOnce"]
  resources:
    requests:
      storage: 30Gi

3.3 install and uninstall

helm install elasticsearch -n elastic -f values.yaml elastic/elasticsearch
helm uninstall elasticsearch -n elastic

在这里插入图片描述

4 create kibana

4.1 get kibana values.yaml

helm show values elastic/kibana > values.yaml

4.2 modify kibana values.yaml

# modify images 
image: "docker.io/library/kibana"

# modify kibanaConfig
kibanaConfig: 
  kibana.yml: |
    i18n.locale: "zh-CN"

# modify service
service:
  type: NodePort
  port: 5601
  nodePort: 30601
  labels: {}
  annotations:
    {}
  loadBalancerSourceRanges:
    []
  httpPortName: http

4.3 install and uninstall

helm install kibana -n elastic -f values.yaml elastic/kibana
helm uninstall kibana -n elastic

在这里插入图片描述
在这里插入图片描述

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值