簡體   English   中英

使用 Kubernetes 和 Rancher 旋轉本地數據庫

[英]Spin a local database with Kubernetes and Rancher

您如何更改 Rancher 目錄中的 cockroachdb YAML 配置,它只會

  • 使用本地磁盤(在本地計算機上測試)
  • 只需使用 1GB 的磁盤空間(應該足夠測試)

這是完整的 YAML

clusterDomain: cluster.local
conf:
  attrs: []
  cache: 25%
  cluster-name: ''
  disable-cluster-name-verification: false
  http-port: 8080
  join: []
  locality: ''
  logtostderr: INFO
  max-disk-temp-storage: 0
  max-offset: 500ms
  max-sql-memory: 25%
  port: 26257
  single-node: false
  sql-audit-dir: ''
image:
  credentials: {}
  pullPolicy: IfNotPresent
  repository: cockroachdb/cockroach
  tag: v20.1.3
ingress:
  annotations: {}
  enabled: false
  hosts: []
  labels: {}
  paths:
    - /
  tls: []
init:
  affinity: {}
  annotations: {}
  labels:
    app.kubernetes.io/component: init
  nodeSelector: {}
  resources: {}
  tolerations: []
labels: {}
networkPolicy:
  enabled: false
  ingress:
    grpc: []
    http: []
service:
  discovery:
    annotations: {}
    labels:
      app.kubernetes.io/component: cockroachdb
  ports:
    grpc:
      external:
        name: grpc
        port: 26257
      internal:
        name: grpc-internal
        port: 26257
    http:
      name: http
      port: 8080
  public:
    annotations: {}
    labels:
      app.kubernetes.io/component: cockroachdb
    type: ClusterIP
statefulset:
  annotations: {}
  args: []
  budget:
    maxUnavailable: 1
  env: []
  labels:
    app.kubernetes.io/component: cockroachdb
  nodeAffinity: {}
  nodeSelector: {}
  podAffinity: {}
  podAntiAffinity:
    type: soft
    weight: 100
  podManagementPolicy: Parallel
  priorityClassName: ''
  replicas: 3
  resources: {}
  secretMounts: []
  tolerations: []
  updateStrategy:
    type: RollingUpdate
storage:
  hostPath: ''
  persistentVolume:
    annotations: {}
    enabled: true
    labels: {}
    size: 100Gi
    storageClass: ''
tls:
  certs:
    clientRootSecret: cockroachdb-root
    nodeSecret: cockroachdb-node
    provided: false
    tlsSecret: false
  enabled: false
  init:
    image:
      credentials: {}
      pullPolicy: IfNotPresent
      repository: cockroachdb/cockroach-k8s-request-cert
      tag: '0.4'
  serviceAccount:
    create: true
    name: ''
Storage: 100Gi

存儲大小

如果您正在尋找 1 GB 的存儲空間,看起來Storagestore.persistentVolume.size都可以設置為1Gi

本地存儲

然后,我會通過運行kubectl get storageClass檢查您是否有 storageClass。 很多時候,clusters 都伴隨着local-path-provisioner storageClass。 如果你有,我會嘗試將store.persistentVolume.storageClass設置為你在系統上安裝的本地路徑保護 storageClass 的名稱。 如果您沒有那個或替代方案,我會考慮安裝它。

更多信息

我不確定,但它可能正在使用這個掌舵圖來安裝數據庫。 圖表的這一部分處理卷聲明管理,因此如果您需要進行更多故障排除,我會在這里查看: https://github.com/cockroachdb/helm-charts/blob/master/cockroachdb/templates/statefulset.yaml #L376

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM