mirror of https://github.com/k3s-io/k3s
Merge pull request #76958 from yujuhong/docker-logs
GCE/Windows: Configure Docker to rotate container logsk3s-v1.15.3
commit
c669b216dd
|
@ -115,6 +115,7 @@ try {
|
|||
InstallAndStart-LoggingAgent
|
||||
|
||||
Create-DockerRegistryKey
|
||||
Configure-Dockerd
|
||||
DownloadAndInstall-KubernetesBinaries
|
||||
Create-NodePki
|
||||
Create-KubeletKubeconfig
|
||||
|
|
|
@ -1058,6 +1058,21 @@ function Create-DockerRegistryKey {
|
|||
Remove-Item -Force -Recurse ${tmp_dir}
|
||||
}
|
||||
|
||||
# Configure Docker daemon and restart the service.
|
||||
function Configure-Dockerd {
|
||||
Set-Content "C:\ProgramData\docker\config\daemon.json" @'
|
||||
{
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "1m",
|
||||
"max-file": "5"
|
||||
}
|
||||
}
|
||||
'@
|
||||
|
||||
Restart-Service Docker
|
||||
}
|
||||
|
||||
# TODO(pjh): move the Stackdriver logging agent code below into a separate
|
||||
# module; it was put here temporarily to avoid disrupting the file layout in
|
||||
# the K8s release machinery.
|
||||
|
|
Loading…
Reference in New Issue