Skip to content

Commit

Permalink
fix deployments without config file
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
  • Loading branch information
Issif committed Jan 16, 2024
1 parent 1e4dba4 commit 9242141
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
18 changes: 9 additions & 9 deletions configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
defaultListPort int = 2803
DefaultRulesFile string = "/etc/falco-talon/rules.yaml"
defaultWatchRules bool = true
defaultPrintAllEvents bool = true
defaultPrintAllEvents bool = false
)

type Configuration struct {
Expand All @@ -39,14 +39,14 @@ func init() {

func CreateConfiguration(configFile string) *Configuration {
v := viper.New()
v.SetDefault("ListenAddress", defaultListenAddress)
v.SetDefault("ListenPort", defaultListPort)
v.SetDefault("RulesFiles", []string{DefaultRulesFile})
v.SetDefault("KubeConfig", "")
v.SetDefault("Logformat", "color")
v.SetDefault("DefaultNotifiers", []string{})
v.SetDefault("WatchRules", defaultWatchRules)
v.SetDefault("PrintAllEvents", defaultPrintAllEvents)
v.SetDefault("listen_address", defaultListenAddress)
v.SetDefault("listen_port", defaultListPort)
v.SetDefault("rules_files", []string{DefaultRulesFile})
v.SetDefault("kubeconfig", "")
v.SetDefault("log_format", "color")
v.SetDefault("default_notifiers", []string{})
v.SetDefault("watch_rules", defaultWatchRules)
v.SetDefault("print_all_events", defaultPrintAllEvents)

v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.AutomaticEnv()
Expand Down
6 changes: 3 additions & 3 deletions deployment/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["server", "-c", "/etc/config/config.yaml", "-r", "/etc/falco-talon/rules/rules.yaml"]
args: ["server", "-c", "/etc/falco-talon/config.yaml", "-r", "/etc/falco-talon/rules.yaml"]
ports:
- name: http
containerPort: 2803
Expand All @@ -61,10 +61,10 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: "rules"
mountPath: "/etc/falco-talon/rules/"
mountPath: "/etc/falco-talon/"
readOnly: true
- name: "config"
mountPath: "/etc/falco-talon/config/"
mountPath: "/etc/falco-talon/"
readOnly: true
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
8 changes: 5 additions & 3 deletions deployment/helm/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ metadata:
name: {{ include "falco-talon.name" . }}-config
stringData:
config.yaml: |
watchRules: {{ default true .Values.watchRules }}
printAllEvents: {{ default false .Values.printAllEvents }}
defaultNotifiers:
listen_address: {{ default "0.0.0.0" .Values.listenAddress }}
listen_port: {{ default 2803 .Values.listenPort }}
watch_rules: {{ default true .Values.watchRules }}
print_all_events: {{ default false .Values.printAllEvents }}
default_notifiers:
{{- range .Values.defaultNotifiers }}
- {{ . -}}
{{ end }}
Expand Down
5 changes: 4 additions & 1 deletion deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ priorityClassName: ""

podAnnotations: {}

# listenAddress: 0.0.0.0
# listenPort: 2803

service:
type: ClusterIP
port: 2803
Expand Down Expand Up @@ -84,7 +87,7 @@ printAllEvents: false # print in stdout all received events, not only those whic

notifiers:
slack:
# webhookurl: "https://hooks.slack.com/services/XXXX"
# webhook_url: "https://hooks.slack.com/services/XXXX"
# icon: "" # default: "https://upload.wikimedia.org/wikipedia/commons/2/26/Circaetus_gallicus_claw.jpg"
# username: "" # default: "Falco Talon"
footer: "" # default: "https://github.com/Issif/falco-talon"
Expand Down

0 comments on commit 9242141

Please sign in to comment.