Merge pull request #76958 from yujuhong/docker-logs
GCE/Windows: Configure Docker to rotate container logs
This commit is contained in:
commit
c669b216dd
@ -115,6 +115,7 @@ try {
|
|||||||
InstallAndStart-LoggingAgent
|
InstallAndStart-LoggingAgent
|
||||||
|
|
||||||
Create-DockerRegistryKey
|
Create-DockerRegistryKey
|
||||||
|
Configure-Dockerd
|
||||||
DownloadAndInstall-KubernetesBinaries
|
DownloadAndInstall-KubernetesBinaries
|
||||||
Create-NodePki
|
Create-NodePki
|
||||||
Create-KubeletKubeconfig
|
Create-KubeletKubeconfig
|
||||||
|
@ -1058,6 +1058,21 @@ function Create-DockerRegistryKey {
|
|||||||
Remove-Item -Force -Recurse ${tmp_dir}
|
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
|
# 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
|
# module; it was put here temporarily to avoid disrupting the file layout in
|
||||||
# the K8s release machinery.
|
# the K8s release machinery.
|
||||||
|
Loading…
Reference in New Issue
Block a user