Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ARM
k8s
Kured
Commits
c8a3a6ff
Unverified
Commit
c8a3a6ff
authored
Oct 27, 2021
by
Christian Kotzbauer
Committed by
GitHub
Oct 27, 2021
Browse files
Merge pull request #455 from span/jsonlogging
Support json logformatter
parents
c196d4e9
b108aa4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c8a3a6ff
...
...
@@ -115,6 +115,7 @@ Flags:
--slack-username string slack username for reboot notfications (default "kured")
--start-time string schedule reboot only after this time of day (default "0:00")
--time-zone string use this timezone for schedule inputs (default "UTC")
--log-format string log format specified as text or json, defaults to "text"
```
### Reboot Sentinel File & Period
...
...
cmd/kured/main.go
View file @
c8a3a6ff
...
...
@@ -64,6 +64,7 @@ var (
messageTemplateReboot
string
podSelectors
[]
string
rebootCommand
string
logFormat
string
rebootDays
[]
string
rebootStart
string
...
...
@@ -164,6 +165,9 @@ func main() {
rootCmd
.
PersistentFlags
()
.
BoolVar
(
&
annotateNodes
,
"annotate-nodes"
,
false
,
"if set, the annotations 'weave.works/kured-reboot-in-progress' and 'weave.works/kured-most-recent-reboot-needed' will be given to nodes undergoing kured reboots"
)
rootCmd
.
PersistentFlags
()
.
StringVar
(
&
logFormat
,
"log-format"
,
"text"
,
"use text or json log format"
)
if
err
:=
rootCmd
.
Execute
();
err
!=
nil
{
log
.
Fatal
(
err
)
}
...
...
@@ -623,6 +627,10 @@ func parseRebootCommand(rebootCommand string) []string {
}
func
root
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
if
logFormat
==
"json"
{
log
.
SetFormatter
(
&
log
.
JSONFormatter
{})
}
log
.
Infof
(
"Kubernetes Reboot Daemon: %s"
,
version
)
nodeID
:=
os
.
Getenv
(
"KURED_NODE_ID"
)
...
...
kured-ds.yaml
View file @
c8a3a6ff
...
...
@@ -75,3 +75,4 @@ spec:
# - --time-zone=UTC
# - --annotate-nodes=false
# - --lock-release-delay=30m
# - --log-format=text
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment