简体   繁体   English

使用 Kubernetes 和 Rancher 旋转本地数据库

[英]Spin a local database with Kubernetes and Rancher

How do you change the cockroachdb YAML configuration from Rancher catalog that it will just您如何更改 Rancher 目录中的 cockroachdb YAML 配置,它只会

  • Use local disk (testing on a local computer)使用本地磁盘(在本地计算机上测试)
  • Just use 1GB of disk space (should be enough for testing)只需使用 1GB 的磁盘空间(应该足够测试)

Here's the complete YAML这是完整的 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

Storage Size存储大小

It looks like Storage and store.persistentVolume.size can both be set to 1Gi if you are looking for one gigabyte of storage.如果您正在寻找 1 GB 的存储空间,看起来Storagestore.persistentVolume.size都可以设置为1Gi

Local Storage本地存储

Then, I would check if you have a storageClass by running kubectl get storageClass .然后,我会通过运行kubectl get storageClass检查您是否有 storageClass。 Many times, cluters come with the local-path-provisioner storageClass.很多时候,clusters 都伴随着local-path-provisioner storageClass。 If you have that, I would try setting store.persistentVolume.storageClass to the name of the local path proversion storageClass you have installed on your system.如果你有,我会尝试将store.persistentVolume.storageClass设置为你在系统上安装的本地路径保护 storageClass 的名称。 If you don't have that or an alternative, I would consider installing it.如果您没有那个或替代方案,我会考虑安装它。

More Info更多信息

I'm not certain, but it's possible that it is using this helm chart to install the database.我不确定,但它可能正在使用这个掌舵图来安装数据库。 This section of the chart deals with the volume claim managment, so I would look here if you need to do more troubleshooting: https://github.com/cockroachdb/helm-charts/blob/master/cockroachdb/templates/statefulset.yaml#L376图表的这一部分处理卷声明管理,因此如果您需要进行更多故障排除,我会在这里查看: 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