Manage the Universal Forwarder admin password
Set up the admin password for the Universal Forwarder, then rotate it as needed for stateless or durable storage modes.
The chart manages the admin password through a Kubernetes Secret by default. You can customize the Secret key, provide your own Secret, or rotate the password later for stateless or durable storage modes.
Set up the admin password
The chart manages the admin password through a Kubernetes Secret unless you override it.
-
Chart-managed Secret (default).
CODEhelm install my-uf ./helm-chart/splunk-universalforwarder \ --set splunkConfig.forwardServer=indexer.example.com:9997 \ --set splunkConfig.password=MySecurePassword1 \ --set splunkConfig.splunkGeneralTerms=<value-from-splunk-general-terms-acceptance-page>The chart creates a Secret with two keys:
password: the plaintext password, b64-encoded- default.yml: the Ansible config blob that includes
splunk.password
Both are consumed at startup. The UF sets the admin password declaratively through the Splunk REST API (
SPLUNK_DECLARATIVE_ADMIN_PASSWORD=true).Important: The chart fails at render time ifsplunkConfig.password="changeme"and noexistingSecretis provided. This prevents the most common misconfiguration where the default password leaves remote login turned off. -
Custom Secret key. If your Secret stores the password under a key other than
password, setsplunkConfig.passwordKey:CODE--set splunkConfig.passwordKey=splunk-admin-passwordThe chart's
SPLUNK_PASSWORDenvironment variable and thesecretKeyRefuse this key name. -
Bring your own Secret. Use
splunkConfig.existingSecretto skip chart-managed Secret creation and provide your own.Create the Secret manually.
CODEkubectl create secret generic my-uf-secret \ --namespace my-namespace \ --from-literal=password=MySecurePassword1 \ --from-literal=default.yml='splunk: password: "MySecurePassword1" forward_servers: - indexer.example.com s2s_port: "9997" kvstore: disabled: 1 'Reference the Secret when you install the chart.
CODEhelm install my-uf ./helm-chart/splunk-universalforwarder \ --set splunkConfig.forwardServer=indexer.example.com:9997 \ --set splunkConfig.existingSecret=my-uf-secret \ --set splunkConfig.splunkGeneralTerms=<value-from-splunk-general-terms-acceptance-page>The chart skips Secret creation entirely and mounts the named Secret. It also skips the password validation guard when
existingSecretis set.
Rotate the password
How you rotate the admin password depends on the storage mode.
-
Stateless mode (
storage.emptyDir: true, the default). The pod restarts from scratch and picks up the new password automatically.Upgrade the release with the new password value.
CODEhelm upgrade my-uf ./helm-chart/splunk-universalforwarder \ --namespace my-namespace \ --set splunkConfig.forwardServer=indexer.example.com:9997 \ --set splunkConfig.password=NewSecurePassword1 \ --set splunkConfig.splunkGeneralTerms=<value-from-splunk-general-terms-acceptance-page>The pod restarts and the Universal Forwarder authenticates with the new password.
-
Durable mode (
storage.emptyDir: false). Password rotation requires removing the old PVCs so Splunk reinitializes with the new credential, because the old passwd hash is stored on the PVC.Uninstall the release. Helm deletes the durable-mode PVCs automatically.
CODEhelm uninstall my-uf --namespace my-namespaceWait for the PVCs to finish terminating before reinstalling.
CODEkubectl wait --for=delete \ pvc/my-uf-splunk-universalforwarder-etc \ pvc/my-uf-splunk-universalforwarder-var \ --timeout=10m \ --namespace my-namespaceConfirm that neither PVC is returned.
CODEkubectl get pvc \ my-uf-splunk-universalforwarder-etc \ my-uf-splunk-universalforwarder-var \ --ignore-not-found \ --namespace my-namespaceReinstall the chart with the new password.
CODEhelm install my-uf ./helm-chart/splunk-universalforwarder \ --namespace my-namespace \ --set storage.emptyDir=false \ --set updateStrategy.type=Recreate \ --set splunkConfig.forwardServer=indexer.example.com:9997 \ --set splunkConfig.password=NewSecurePassword1 \ --set splunkConfig.splunkGeneralTerms=<value-from-splunk-general-terms-acceptance-page>Splunk reinitializes on the newly created PVCs and the Universal Forwarder authenticates with the new password.