Skip to content

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

@Thnai

Description

@Thnai

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.
f0d5ba0#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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions