繁体   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