首页 > 解决方案 > 无法在 stackstorm HA(K8) 上安装包

问题描述

我一直在尝试在单节点 K8 集群上使用这些链接安装自定义包。

https://github.com/StackStorm/st2packs-dockerfiles/

https://github.com/stackstorm/stackstorm-ha

Stackstorm 已使用默认仪表板成功安装,但是当我尝试构建自定义包和 helm upgrade 时,它​​不起作用。

这是我的 stackstorm 包目录和图像 Dockerfile:

/home/manisha.tanwar/st2packs-dockerfiles # ll st2packs-image/packs/st2_chef/
total 28
drwxr-xr-x. 4 manisha.tanwar domain users 4096 Apr 28 16:11 actions
drwxr-xr-x. 2 manisha.tanwar domain users 4096 Apr 28 16:11 aliases
-rwxr-xr-x. 1 manisha.tanwar domain users  211 Apr 28 16:11 pack.yaml
-rwxr-xr-x. 1 manisha.tanwar domain users   65 Apr 28 16:11 README.md
-rwxr-xr-x. 1 manisha.tanwar domain users  293 Apr 28 17:47 requirements.txt
drwxr-xr-x. 2 manisha.tanwar domain users 4096 Apr 28 16:11 rules
drwxr-xr-x. 2 manisha.tanwar domain users 4096 Apr 28 16:11 sensors

/home/manisha.tanwar/st2packs-dockerfiles # cat st2packs-image/Dockerfile

ARG PACKS="file:///tmp/stackstorm-st2"
FROM stackstorm/st2packs:builder AS builder

COPY packs/st2_chef /tmp/stackstorm-st2/
RUN ls -la /tmp/stackstorm-st2
RUN git config --global http.sslVerify false

# Install custom packs
RUN /opt/stackstorm/st2/bin/st2-pack-install ${PACKS}

###########################
# Minimize the image size. Start with alpine:3.8,
# and add only packs and virtualenvs from builder.
FROM stackstorm/st2packs:runtime

使用命令创建图像 docker build -t st2_chef:v0.0.2 st2packs-image

然后我改变了 values.yaml 如下:

  packs:
    configs:
      packs.yaml: |
        ---
        # chef pack
    image:
      name: st2_chef
      tag: 0.0.1
      pullPolicy: Always

并运行 helm upgrade <release-name>. ,但它没有在仪表板和 cmd 上显示任何内容。

请帮忙,我们计划从独立的 stackstorm 升级到 Stackstorm HA,我需要为此完成 POC。

提前致谢!!

标签: kuberneteskubernetes-helm

解决方案


在社区的帮助下让它工作。如果有人想关注,这是链接:

https://github.com/StackStorm/stackstorm-ha/issues/128

我没有使用 docker registery 来推送图像并在 helm 配置中使用它。

将 values.yaml 更新为:

  packs:
    # Custom StackStorm pack configs. Each record creates a file in '/opt/stackstorm/configs/'
    # https://docs.stackstorm.com/reference/pack_configs.html#configuration-file
    configs:
      core.yaml: |
        ---
    image:
      # Uncomment the following block to make the custom packs image available to the necessary pods
      #repository: your-remote-docker-registry.io
      repository: manishatanwar
      name: st2_nagios
      tag: "0.0.1"
      pullPolicy: Always

推荐阅读