Merge pull request #76958 from yujuhong/docker-logs

GCE/Windows: Configure Docker to rotate container logs
k3s-v1.15.3
Kubernetes Prow Robot 2019-04-23 20:28:12 -07:00 committed by GitHub
commit c669b216dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -115,6 +115,7 @@ try {
InstallAndStart-LoggingAgent
Create-DockerRegistryKey
Configure-Dockerd
DownloadAndInstall-KubernetesBinaries
Create-NodePki
Create-KubeletKubeconfig

View File

@ -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.