splunk / splunk-operator

Splunk Operator for Kubernetes
Other
210 stars 115 forks source link

Splunk Operator: why force ClusterIP and ignore k8s default field in service template #1211

Open Thnai opened 1 year ago

Thnai commented 1 year ago

Please select the type of request

Bug

Tell us more

Describe the request I am trying to change the default service type for the operator by modifying the CRD template

Expected behavior the added default value is beeing used to create new services of the modified kind

Reproduction/Testing steps i added "default: NodePort" to serviceTemplate/properties/spec/properties/type restarted the operator pod

Proposed changes(optional) looking at the operator code i found this codeblock

    if spec.ServiceTemplate.Spec.Type == "" {
        spec.ServiceTemplate.Spec.Type = corev1.ServiceTypeClusterIP
    }

however i dont understand the purpose of it, if no type is specified, k8s defaults to ClusterIP anyway using git blame i backtracked why it was added. https://github.com/splunk/splunk-operator/commit/f0d5ba08eb623cf5a1bbb9da60052a4399940c58#diff-57923b610c6cabf2ed47c4c3b44b4b365366b4949242100ff5c9856e02562424

however the commit message does not give more information. So why does the operator force ClusterIP and thereby disables the ability to use the "default" field in the template?

vivekr-splunk commented 1 year ago

Hello @Thnai we will look into the issue and get back to you