K8S 部署安装Elastic Cloud 服务

不管现实多么惨不忍睹,都要持之以恒地相信,这只是黎明前短暂的黑暗而已。不要惶恐眼前的难关迈不过去,不要担心此刻的付出没有回报,别再花时间等待天降好运。真诚做人,努力做事!你想要的,岁月都会给你。K8S 部署安装Elastic Cloud 服务,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

Elastic Cloud On K8S ECK

K8S 部署安装Elastic Cloud 服务

image-20221118174010946

文件信息

image-20220815105323623

安装crds

  • 文件参考官方

安装operator

  • 文件参考官方
kubectl apply -f 002.operator.yaml

image-20220808145815952

image-20220808145740213

查看operator日志

kubectl -n elastic-system logs -f statefulset.apps/elastic-operator

image-20220808145716338

image-20220808145643365

image-20220808145508684

使用ECK部署ES

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: lit
  namespace: elastic-system
spec:
  version: 8.3.3
  image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3 #指定镜像
  auth:
    fileRealm:
    - secretName: kubesphere-elasticsearch-realm-secret # 通过Kubernetes secret添加自定义用户和密码
  http:
    tls:
      selfSignedCertificate:
        disabled: true # 关闭tls
  nodeSets:
  - name: lit 
    count: 3 # 部署集群节点数
    config:
      node.store.allow_mmap: false
    volumeClaimTemplates: # 存储配置
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
        storageClassName: alicloud-nas

  • 番外示例

[root@Master 002.ElasticCloud]# cat 003.ElasticSearch-Cluster.sh 
cat <<EOF | kubectl apply -f -
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: lit-eck
spec:
  version: 8.3.3
  nodeSets:
  - name: default
    count: 3
    config:
      node.store.allow_mmap: false
EOF




[root@Master 002.ElasticCloud]# cat es1.yaml 
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: lit
  namespace: elastic-system
spec:
  version: 8.3.3
  image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3 #指定镜像
  auth:
    fileRealm:
    - secretName: kubesphere-elasticsearch-realm-secret # 通过Kubernetes secret添加自定义用户和密码
  http:
    tls:
      selfSignedCertificate:
        disabled: true # 关闭tls
  nodeSets:
  - name: lit 
    count: 3 # 部署集群节点数
    config:
      node.store.allow_mmap: false
    volumeClaimTemplates: # 存储配置
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
        storageClassName: alicloud-nas

获取yaml文件

#   由已经启动的StatefulSet获取出的yaml文件:
# kubectl get statefulsets.apps -n elastic-system lit-es-lit -o yaml

apiVersion: apps/v1
kind: StatefulSet
metadata:
  creationTimestamp: "2022-08-10T02:34:08Z"
  generation: 1
  labels:
    common.k8s.elastic.co/template-hash: "2038917924"
    common.k8s.elastic.co/type: elasticsearch
    elasticsearch.k8s.elastic.co/cluster-name: lit
    elasticsearch.k8s.elastic.co/statefulset-name: lit-es-lit
  name: lit-es-lit
  namespace: elastic-system
  ownerReferences:
  - apiVersion: elasticsearch.k8s.elastic.co/v1
    blockOwnerDeletion: true
    controller: true
    kind: Elasticsearch
    name: lit
    uid: 47379a1b-ddcb-4552-9909-0e4253441691
  resourceVersion: "41911788"
  uid: e166e637-d67a-4a97-9aed-02dd0754da38
spec:
  podManagementPolicy: Parallel
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      common.k8s.elastic.co/type: elasticsearch
      elasticsearch.k8s.elastic.co/cluster-name: lit
      elasticsearch.k8s.elastic.co/statefulset-name: lit-es-lit
  serviceName: lit-es-lit
  template:
    metadata:
      annotations:
        co.elastic.logs/module: elasticsearch
        elasticsearch.k8s.elastic.co/config-hash: "3117001397"
      creationTimestamp: null
      labels:
        common.k8s.elastic.co/type: elasticsearch
        elasticsearch.k8s.elastic.co/cluster-name: lit
        elasticsearch.k8s.elastic.co/http-scheme: http
        elasticsearch.k8s.elastic.co/node-data: "true"
        elasticsearch.k8s.elastic.co/node-data_cold: "true"
        elasticsearch.k8s.elastic.co/node-data_content: "true"
        elasticsearch.k8s.elastic.co/node-data_frozen: "true"
        elasticsearch.k8s.elastic.co/node-data_hot: "true"
        elasticsearch.k8s.elastic.co/node-data_warm: "true"
        elasticsearch.k8s.elastic.co/node-ingest: "true"
        elasticsearch.k8s.elastic.co/node-master: "true"
        elasticsearch.k8s.elastic.co/node-ml: "true"
        elasticsearch.k8s.elastic.co/node-remote_cluster_client: "true"
        elasticsearch.k8s.elastic.co/node-transform: "true"
        elasticsearch.k8s.elastic.co/node-voting_only: "false"
        elasticsearch.k8s.elastic.co/statefulset-name: lit-es-lit
        elasticsearch.k8s.elastic.co/version: 8.3.3
    spec:
      affinity:
        podAntiAffinity:
          

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/160273.html

(0)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!