首页 > 其他 > 详细

阿里云pv 使用

时间:2021-09-23 10:13:30      阅读:23      评论:0      收藏:0      [点我收藏+]

环境阿里云托管版本 aks

创建pv

控制台直接创建 storageclass 是disk 使用时要注意

技术分享图片

 

 

 配置elk使用 pv

apiVersion: elasticsearch.k8s.elastic.co/v1beta1
kind: Elasticsearch
metadata:
  name: elasticsearch-7x6x2
  namespace: devops
spec:
  image: elasticsearch:7.6.2
  version: 7.6.2
  nodeSets:
  - name: node
    count: 1
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data 
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
        storageClassName: disk
    config:
      node.master: true
      node.data: true
      node.ingest: true
      thread_pool.write.queue_size: 3000
      xpack.security.enabled: "false"
    podTemplate:
      metadata:
        labels:
          es: "7"
          elk: "true"
      spec:
        nodeSelector:
          role: "devops"
        initContainers:
        - name: sysctl
          securityContext:
            privileged: true
          command: [sh, -c, sysctl -w vm.max_map_count=262144]
        containers:
        - name: elasticsearch
          env:
          - name: xpack.security.enabled
            value: "false"
          - name: READINESS_PROBE_PROTOCOL
            value: http
          - name: ES_JAVA_OPTS
            value: -Xms8000m -Xmx8000m
          resources:
            requests:
              memory: 8Gi
              cpu: 1
            limits:
              memory: 10Gi
              cpu: 8
          readinessProbe:
            httpGet:
              path: /
              port: 9200
            failureThreshold: 3
            initialDelaySeconds: 60
            periodSeconds: 50
            successThreshold: 1
            timeoutSeconds: 60
  http:
    tls:
      selfSignedCertificate:
        disabled: true

删除pvc 后手动释放pv

NAME                     CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS     CLAIM                                                     STORAGECLASS   REASON   AGE
d-2ze66d31yjlwualzz9se   100Gi      RWO            Retain           Released   devops/elasticsearch-data-elasticsearch-7x6x2-es-node-0   disk                    43m


###### 手动删除 claimRef 进行二次利用

spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 100Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: elasticsearch-data-elasticsearch-7x6x2-es-node-0
    namespace: devops
    resourceVersion: "202011"
    uid: 5ad5f9a6-79a5-47e0-9edc-205cad5c1713

 

阿里云pv 使用

原文:https://www.cnblogs.com/leleyao/p/15305272.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!