Code Monkey home page Code Monkey logo

Comments (3)

gjenkins8 avatar gjenkins8 commented on June 26, 2024

Can you show the Service objects the chart is creating for the 1.1 and 1.4 releases please.

It is confusing to me why Helm stored e.g the ClusterIP in the 1.4 release manifest. Helm should only be storing the object as rendered by the chart. Unless the chart specified all these fields. Which also is confusing to me as I didn't think Kubernetes allowed changing the ClusterIP (from a client) once created.

Do you see the same on a modern version of Kubernetes?

from helm.

yangchnet avatar yangchnet commented on June 26, 2024

@gjenkins8
In the chart template of openkruise, the definition of Service kruise-webhook-service is as follows:

{{- define "webhookServiceSpec" -}}
{{- $service := lookup "v1" "Service" .Values.installation.namespace "kruise-webhook-service" -}}
{{- if $service -}}
{{ if $service.spec.clusterIP -}}
clusterIP: {{ $service.spec.clusterIP }}
{{- end }}
{{ if $service.spec.clusterIPs -}}
clusterIPs:
  {{ $service.spec.clusterIPs }}
{{- end }}
{{ if $service.spec.ipFamilyPolicy -}}
ipFamilyPolicy: {{ $service.spec.ipFamilyPolicy }}
{{- end }}
{{ if $service.spec.ipFamilies -}}
ipFamilies:
  {{ $service.spec.ipFamilies }}
{{- end }}
{{ if $service.spec.type -}}
type: {{ $service.spec.type }}
{{- end }}
{{ if $service.spec.ipFamily -}}
ipFamily: {{ $service.spec.ipFamily }}
{{- end }}
{{- end -}}
ports:
- port: 443
  targetPort: {{ .Values.manager.webhook.port }}
selector:
  control-plane: controller-manager
{{- end -}}

Pay attention here:{{- $service := lookup "v1" "Service" .Values.installation.namespace "kruise-webhook-service" -}}

The lookup will find the currently existing kruise-webhook-service from the cluster and populate its properties into the template.

So the following happened:

  • On first deployment, kruise-webhook-service does not exist in the cluster, so the ClusterIP is not populated.
  • On the n-th(n>1) release, kruise-webhook-service already exists in the cluster, so the ClusterIP is populated into the template.

In kubernetes1.28, helm sent the same patch:

{
    "spec": {
        "clusterIP": null,
        "clusterIPs": null,
        "ipFamilies": null,
        "ipFamilyPolicy": null,
        "type": null
    }
}

but no error is returned.

from helm.

yangchnet avatar yangchnet commented on June 26, 2024

I have found that this is a known Kubernetes bug(in 1.21.X): kubernetes/kubernetes#91459 (comment), and has been fixed in version 1.22.0-beta.2:https://github.com/kubernetes/kubernetes/pull/103532/files.

So, let's close this issue.

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.