jx step helm 是否应该应用 create/produce 一个 helm 版本

Should jx step helm apply create/produce a helm release

我正在为 jx​​、kubernetes 和 helm 苦苦挣扎。我 运行 jx 上的 Jenkinsfile 在 env 目录中执行命令:

sh 'jx step helm build'
sh 'jx step helm apply'

它成功完成并部署 pods/creates 部署等。但是,掌舵列表是空的。

当我执行类似 helm install ...helm upgrade --install ... 的操作时,它会创建一个版本,并且 helm 列表会显示。

这是正确的行为吗?

更多详情:

EKS 安装有:

eksctl create cluster --region eu-west-2 --name integration --version 1.12 \
--nodegroup-name integration-nodes \
--node-type t3.large \
--nodes 3 \
--nodes-min 1 \
--nodes-max 10 \
--node-ami auto \
--full-ecr-access \
--vpc-cidr "172.20.0.0/16"

然后我使用一些 kubectly apply 命令设置入口(外部和内部)(不会共享文件)。然后我设置路由和vpc相关的东西。

JX 安装有:

jx install --provider=eks --ingress-namespace='internal-ingress-nginx' \
--ingress-class='internal-nginx' \
--ingress-deployment='nginx-internal-ingress-controller' \
--ingress-service='internal-ingress-nginx' --on-premise \
--external-ip='#########' \
--git-api-token=######### \
--git-username=######### --no-default-environments=true

安装详情:

? Select Jenkins installation type: Static Jenkins Server and Jenkinsfiles
? Would you like wait and resolve this address to an IP address and use it for the domain? No
? Domain ###########
? Cloud Provider eks
? Would you like to register a wildcard DNS ALIAS to point at this ELB address?  Yes
? Your custom DNS name: ###########
? Would you like to enable Long Term Storage? A bucket for provider eks will be created No
? local Git user for GitHub server: ###########
? Do you wish to use GitHub as the pipelines Git server: Yes
? A local Jenkins X versions repository already exists, pull the latest? Yes
? A local Jenkins X cloud environments repository already exists, recreate with latest? Yes
? Pick default workload build pack:  Kubernetes Workloads: Automated CI+CD with GitOps Promotion

然后我设置 helm:

kubectl apply -f tiller-rbac-config.yaml
helm init --service-account tiller

其中 tiller-rbac-config.yaml 是:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system

helm 版本说:

Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}

jx 版本说:

NAME               VERSION
jx                 2.0.258
jenkins x platform 2.0.330
Kubernetes cluster v1.12.6-eks-d69f1b
helm client        Client: v2.13.1+g618447c
git                git version 2.17.1
Operating System   Ubuntu 18.04.2 LTS

应用程序以这种方式导入:

jx import --branches="devel" --org ##### --disable-updatebot=true --git-api-token=##### --url git@github.com:#####.git

环境是这样创建的:

jx create env --git-url=##### --name=integration --label=Integration --domain=##### --namespace=jx-integration --promotion=Auto --git-username=##### --git-private --branches="master|devel|test"

查看变更日志,似乎从 2.0.246.

版本开始,无舵机模式已成为默认模式

在 Helm v2 中,Helm 依赖于名为 Tiller 的服务器端组件。 Jenkins X tillerless 模式意味着不使用 Helm 安装图表,Helm 客户端仅用于模板化和生成 Kubernetes 清单。但是,这些清单通常是使用 kubectl 应用的,而不是 helm/tiller.

结果是 Helm 不会知道这个 installations/releases,因为它们是由 kubectl 制作的。所以这就是为什么您不会使用 Helm 获得发布列表的原因。这是预期的行为,如 you can read on the Jenkins X docs.

What --no-tiller means is to switch helm to use template mode which means we no longer internally use helm install mychart to install a chart, we actually use helm template mychart instead which generates the YAML using the same helm charts and the standard helm confiugration management via --set and values.yaml files.

Then we use kubectl apply to apply the YAML.

James Strachan 在评论中提到,使用无舵机模式时,you can view your deployments using jx step helm list