简体   繁体   English

掌舵升级时出现集群类型错误

[英]Getting cluster type error on helm upgrade

Trying to do:试图做:

helm upgrade --namespace keycloak -f k8s/sandbox/values.yaml keycloak codecentric/keycloak

Getting:得到:

UPGRADE FAILED: cannot patch "keycloak-http" with kind Service: Service "keycloak-http" is invalid: [spec.ports[0].nodePort: Forbidden: may not be used when `type` is 'ClusterIP', spec.ports[1].nodePort: Forbidden: may not be used when `type` is 'ClusterIP']

However, initial values is NodePort, not ClusterIP:但是,初始值NodePort,而不是 ClusterIP:

service:
  # Annotations for headless and HTTP Services
  annotations: {}
  # Additional labels for headless and HTTP Services
  labels: {}
  # key: value
  # The Service type
  type: NodePort

Also kubectl edit shows type: NodePort kubectl edit 还显示类型:NodePort

spec:
  clusterIP: <SomeIP>
  externalTrafficPolicy: Cluster
  ports:
  - name: http
    nodePort: 31062
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 31258
    port: 8443
    protocol: TCP
    targetPort: https
  - name: http-management
    nodePort: 32113
    port: 9990
    protocol: TCP
    targetPort: http-management
  selector:
    app.kubernetes.io/instance: keycloak
    app.kubernetes.io/name: keycloak
  sessionAffinity: None
  type: NodePort

Here is the keycloak-http service from helm template .这是来自helm template的 keycloak-http 服务。 For some reason it says ClusterIp, but both the inital values.yaml says NodePort and also kubectl edit service keycloak-http say it is NodePort:出于某种原因,它说 ClusterIp,但两个初始值。yaml 说 NodePort 并且 kubectl edit service keycloak-http 说它是 NodePort:

# Source: keycloak/templates/service-http.yaml
apiVersion: v1
kind: Service
metadata:
  name: keycloak-http
  labels:
    helm.sh/chart: keycloak-10.1.0
    app.kubernetes.io/name: keycloak
    app.kubernetes.io/instance: keycloak
    app.kubernetes.io/version: "12.0.4"
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: http
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 80
      targetPort: http
      protocol: TCP
    - name: https
      port: 8443
      targetPort: https
      protocol: TCP
    - name: http-management
      port: 9990
      targetPort: http-management
      protocol: TCP
  selector:
    app.kubernetes.io/name: keycloak
    app.kubernetes.io/instance: keycloak

Any ideas?有任何想法吗?

Please delete the service manually and perform the helm upgrade again请手动删除服务并重新执行helm升级

I pulled the repository and tried changing the values.yaml to NodePort and this works fine for me.我拉出存储库并尝试将values.yaml更改为NodePort ,这对我来说很好。 The template that was printed had NodePort instead of ClusterIP .打印的模板有NodePort而不是ClusterIP This means that you might be doing something wrong or perhaps using some wrong values file.这意味着您可能做错了什么,或者可能使用了一些错误的值文件。

Now the error itself is there because you can't change the service type like that and Kubernetes won't allow it because NodePort has additional parameter included in the service template:现在错误本身就在那里,因为您不能像那样更改服务类型,并且 Kubernetes 不允许它,因为NodePort在服务模板中包含其他参数:

"ports": [
            {
                "name": "http",
                "nodePort": 30240,
                "port": 8888,
                "protocol": "TCP",
                "targetPort": "http"
            }

While this is the ClusterIP:虽然这是 ClusterIP:

"ports": [
            {
                "name": "http",
                "port": 8888,
                "protocol": "TCP",
                "targetPort": "http"
            }

There are couple of possible workaround for this issue when you attempt to change service like that:当您尝试像这样更改服务时,有几个可能的解决方法来解决此问题:

  • Install new version of the helm chart with a different release name使用不同的发布名称安装新版本的 helm chart
  • Manually change the service type with kubectl edit svc使用kubectl edit svc手动更改服务类型
  • Delete the existing release and install new version of the chart with the same release name删除现有版本并安装具有相同版本名称的图表的新版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 helm upgrade --install:错误:Kubernetes集群无法访问 - helm upgrade --install: Error: Kubernetes cluster unreachable “错误:转发端口:需要升级请求” kubernetes集群的掌舵错误 - “Error: forwarding ports: Upgrade request required” Error in helm of a kubernetes cluster Helm 2 和 Helm 3 在同一个集群中? - Helm 2 an Helm 3 in the same cluster? Terraform 和 Helm3:错误:Kubernetes 集群无法访问 - Terraform and Helm3: Error: Kubernetes cluster unreachable Kubernetes 集群上的 Helm 安装或升级发布失败:服务器找不到请求的资源或升级失败:没有部署的发布 - Helm install or upgrade release failed on Kubernetes cluster: the server could not find the requested resource or UPGRADE FAILED: no deployed releases 使用Azure DevOps Pipeline的AKS Kubernetes-头盔升级错误 - AKS Kubernetes with Azure DevOps Pipeline - helm upgrade error “ helm upgrade --name”导致“错误:未知标志:-name” - `helm upgrade --name` results in “Error: unknown flag: --name” 更新时舵错误:升级失败:补丁列表中的顺序 - helm error when updating: UPGRADE FAILED: The order in patch list 掌舵升级:错误:找不到准备好的舵柄吊舱 - helm upgrade: Error: could not find a ready tiller pod Helm 升级错误。 atlassian-jira-软件入口 - Helm upgrade error. atlassian-jira-software ingress
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM