
Service Account Configuration
Create ServiceAccount resources
before creating the
HumioCluster resource. Then
configure HumioCluster to use them
rather than relying on the Humio Operator to create and manage the
ServiceAccounts and bindings.
These can be configured for the
initServiceAccountName,
authServiceAccountName, and
serviceAccountName fields in the
HumioCluster resource. They may be
configured to use a shared
ServiceAccount or separate
ServiceAccounts. It is recommended
to keep these separate unless otherwise required.
Separate service accounts
The following example configures all three fields to use different
ServiceAccount resources.
To do this, create the
ServiceAccount,
ClusterRole,
ClusterRoleBinding for the
initServiceAccount:
apiVersion: v1
kind: ServiceAccount
metadata:
name: humio-init
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: humio-init
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: humio-init
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: humio-init
subjects:
- kind: ServiceAccount
name: humio-init
namespace: default
Followed by the ServiceAccount,
Role,
RoleBinding for the
authServiceAccount:
apiVersion: v1
kind: ServiceAccount
metadata:
name: humio-auth
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: humio-auth
namespace: default
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- create
- update
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: humio-auth
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: humio-auth
subjects:
- kind: ServiceAccount
name: humio-auth
namespace: default
And finally the ServiceAccount for
the main LogScale container.
Note
If using IRSA, configure the appropriate annotations.
apiVersion: v1
kind: ServiceAccount
metadata:
name: humio
namespace: default
Now include the following in the
HumioCluster resource so it will
use the ServiceAccounts:
apiVersion: core.humio.com/v1alpha1
kind: HumioCluster
metadata:
name: example-humiocluster
spec:
humioServiceAccountName: humio
initServiceAccountName: humio-init
authServiceAccountName: humio-auth