Skip to content

Commit

Permalink
Support custom secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
DebakelOrakel committed Aug 9, 2024
1 parent d5f42de commit 1f09f6b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ parameters:
K8S-Logging.Parser: "On"
K8S-Logging.Exclude: "On"

# Add additional secrets
secrets: {}

# Add volumes to the pod spec
extraVolumes: []
extraVolumeMounts: []
Expand Down
16 changes: 16 additions & 0 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,24 @@ local configmap = kube.ConfigMap(params.configMapName) {
},
};

local secret = kube.Secret(instanceName) {
metadata+: {
labels+: {
'app.kubernetes.io/name': 'fluent-bit',
'app.kubernetes.io/instance': instanceName,
'app.kubernetes.io/component': 'fluent-bit',
'app.kubernetes.io/managed-by': 'commodore',
},
},
stringData: {
[s]: params.secrets[s]
for s in std.objectFields(params.secrets)
},
};

{
[if params.createNamespace then '00_namespace']: kube.Namespace(params.namespace),
[if std.length(params.secrets) > 0 then '10_custom_secret']: secret,
'10_custom_config': configmap,
[if params.monitoring.enabled then '20_service_monitor']:
kube._Object('monitoring.coreos.com/v1', 'ServiceMonitor', 'fluent-bit') {
Expand Down

0 comments on commit 1f09f6b

Please sign in to comment.