Skip to content

Commit

Permalink
Adds service account name to each druid node optionally (#164)
Browse files Browse the repository at this point in the history
* Adds service account to each druid node optionally

* Use controller-gen v0.11.2
  • Loading branch information
saithal-confluent authored Jun 9, 2024
1 parent 643c4bf commit f7fa84e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apis/druid/v1alpha1/druid_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ type DruidNodeSpec struct {
// Operator deploys the sidecar container based on these properties.
// +optional
AdditionalContainer []AdditionalContainer `json:"additionalContainer,omitempty"`

// ServiceAccountName Kubernetes native `serviceAccountName` specification.
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

// ZookeeperSpec IGNORED (Future API): In order to make Druid dependency setup extensible from within Druid operator.
Expand Down
4 changes: 4 additions & 0 deletions chart/crds/druid.apache.org_druids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5949,6 +5949,10 @@ spec:
type: string
type: object
type: object
serviceAccountName:
description: ServiceAccountName Kubernetes native `serviceAccountName`
specification.
type: string
services:
description: Services Overrides services at top level.
items:
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/druid.apache.org_druids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5949,6 +5949,10 @@ spec:
type: string
type: object
type: object
serviceAccountName:
description: ServiceAccountName Kubernetes native `serviceAccountName`
specification.
type: string
services:
description: Services Overrides services at top level.
items:
Expand Down
2 changes: 1 addition & 1 deletion controllers/druid/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ func makePodSpec(nodeSpec *v1alpha1.DruidNodeSpec, m *v1alpha1.Druid, nodeSpecUn
TerminationGracePeriodSeconds: nodeSpec.TerminationGracePeriodSeconds,
Volumes: getVolume(nodeSpec, m, nodeSpecUniqueStr),
SecurityContext: firstNonNilValue(nodeSpec.PodSecurityContext, m.Spec.PodSecurityContext).(*v1.PodSecurityContext),
ServiceAccountName: m.Spec.ServiceAccount,
ServiceAccountName: firstNonEmptyStr(nodeSpec.ServiceAccountName, m.Spec.ServiceAccount),
PriorityClassName: firstNonEmptyStr(nodeSpec.PriorityClassName, m.Spec.PriorityClassName),
}

Expand Down

0 comments on commit f7fa84e

Please sign in to comment.