创建Helm图表以扩展现有图表

时间:2019-03-29 13:59:31

标签: kubernetes gitlab kubernetes-helm

我正在使用https://gitlab.com/charts/gitlab在Openshift集群上部署图表中包含的某些组件。现在,我只想部署随附的Prometheus图表。我完成了此工作,并具有特定的values.yaml配置。

我想扩展Gitlab掌舵图表,为此,我将其添加为自己的图表的要求。每当我将前一个values.yaml添加为值的一部分时,都会出现问题。

部署上游Gitlab图表可用于:

global:
  registry:
    enabled: false
  # Disabling minio still requires to disable gitlab.minio or it will complain about "A valid backups.objectStorage.config.secret is needed"
  minio:
    enabled: false
  ingress:
    enabled: false
    configureCertmanager: false

nginx-ingress:
  enabled: false
registry:
  enabled: false
certmanager:
  install: false
  rbac:
    create: false
...

将包括配置在内的图表部署为子图表不起作用

global:
  registry:
    enabled: false
  # Disabling minio still requires to disable gitlab.minio or it will complain about "A valid backups.objectStorage.config.secret is needed"
  minio:
    enabled: false
  ingress:
    enabled: false
    configureCertmanager: false


test:
  nginx-ingress:
    enabled: false

  registry:
    enabled: false
  certmanager:
    install: false
    rbac:
      create: false
  ...

我添加了Gitlab上游图表作为要求:

dependencies:
- name: gitlab
  # Upgrade manually. Check https://gitlab.com/charts/gitlab/blob/master/requirements.yaml for the new Prometheus chart version.
  version: 1.7.1
  repository: https://charts.gitlab.io/
  alias: test

似乎没有完全检查我的配置,因此这会创建serviceAccount没有权限的对象,从而导致该过程失败。即使直接禁用Gitlab图表并正确禁用了certmanager,它仍会尝试创建与from socket import * from time import ctime import select import sys HOST = '' PORT = 21567 BUFSIZE = 2048 ADDR = (HOST, PORT) answerServer = socket(AF_INET, SOCK_STREAM) answerServer.bind(ADDR) answerServer.listen(5) askReceive = [answerServer, sys.stdin] while True: print("waiting for connection...") askClnt, addr = answerServer.accept() print('...connecting from', addr) askReceive.append(askClnt) while True: readyInput, readyOutput, readyException = select.select(askReceive, [], `[]) for inData in readyInput: if inData == askClnt: data = askClnt.recv(BUFSIZE) if not data: break print(data.decode('utf-8')) else: data = input('> ') if not data: break askClnt.send(bytes('[%s] %s' % (ctime(), data), 'utf-8')) askClnt.close() answerServer.close() #Full duplex in python 3.7.2 相关的对象。

1 个答案:

答案 0 :(得分:1)

找到了。子图表的要求条件必须在values.yaml的第一级上指定。

如果A以B作为子图需求,则要指定B需求条件,必须将其设置为A级别:

global:
  registry:
    enabled: false
  # Disabling minio still requires to disable gitlab.minio or it will complain about "A valid backups.objectStorage.config.secret is needed"
  minio:
    enabled: false
  ingress:
    enabled: false
    configureCertmanager: false


test:
  nginx-ingress:
    enabled: false

  registry:
    enabled: false
  ...

certmanager:
  install: false
  rbac:
    create: false
  ...