Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions capz/run-capz-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ main() {
export CAPI_VERSION="${CAPI_VERSION:-"v1.7.2"}"
export HELM_VERSION=v3.15.2
export TOOLS_BIN_DIR="${TOOLS_BIN_DIR:-$SCRIPT_ROOT/tools/bin}"
export CONTAINERD_LOGGER="${CONTAINERD_LOGGER:-""}"

# other config
export ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
Expand Down Expand Up @@ -319,9 +320,10 @@ EOF
kubectl apply -f "${CAPZ_DIR}"/templates/test/ci/patches/windows-kubeproxy-ci.yaml
kubectl rollout restart ds -n kube-system kube-proxy-windows
fi

# apply additional helper manifests (logger etc)
kubectl apply -f "${CAPZ_DIR}"/templates/addons/windows/containerd-logging/containerd-logger.yaml
if [[ -n "$CONTAINERD_LOGGER" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now optional but is the intention to continue running the containerd logger?
IIRC it also logs ETW events for HCS which can be useful in debugging which containerd doesn't log.
@jsturtevant WDYT of these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the intent is to remove this logger pod if we have can have containerd log to files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll potentially miss some etw events from HCS / Windows.
Are we OK with that?

kubectl apply -f "${CAPZ_DIR}"/templates/addons/windows/containerd-logging/containerd-logger.yaml
fi
kubectl apply -f "${CAPZ_DIR}"/templates/addons/windows/csi-proxy/csi-proxy.yaml
kubectl apply -f "${CAPZ_DIR}"/templates/addons/metrics-server/metrics-server.yaml
}
Expand Down
42 changes: 40 additions & 2 deletions capz/templates/gmsa-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,46 @@ spec:
}
Write-Output "Extracting new containerd binaries"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
# Check if kube-log-runner.exe exists
if (Test-Path $kubeloggerPath) {
Write-Output "Recreating containerd service with kube-log-runner..."
$logPath = "\var\log\containerd"
# Check if directory exists
if (-Not (Test-Path -Path $logPath -PathType Container)) {
Write-Host "Creating log directory: $logPath"
New-Item -ItemType Directory -Path $logPath -Force | Out-Null
} else {
Write-Host "Log directory already exists: $logPath"
}
$ContainerdCommandLine = 'c:\k\kube-log-runner.exe --log-file=/var/log/containerd/containerd.log "c:\Program Files\containerd\containerd.exe" --register-service'
Write-Output "Containerd command line: $ContainerdCommandLine"
# Stop and delete the existing containerd service
Stop-Service -Name 'containerd' -Force -ErrorAction SilentlyContinue
$null = sc.exe delete containerd
# Wait for service to be fully deleted
$serviceCreated = $false
for ($i = 0; $i -lt 20; $i++) {
$service = Get-Service -Name containerd -ErrorAction SilentlyContinue
if ($null -eq $service) {
Write-Host "containerd service deleted successfully, recreating with kubelogger"
cmd.exe /c $ContainerdCommandLine
Start-Service Containerd
Write-Output "Successfully started containerd service with kubelogger"
$serviceCreated = $true
break
}
else {
Write-Host "Waiting for containerd service to be fully deleted... (attempt $($i + 1)/20)"
}
Start-Sleep -Seconds 1
}
if (-not $serviceCreated) {
Write-Error "Failed to delete containerd service after 20 attempts"
}
} else {
Write-Output "Starting containerd service without kube-log-runner..."
Start-Service containerd
}
}
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
Expand Down
42 changes: 40 additions & 2 deletions capz/templates/gmsa-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,46 @@ spec:
}
Write-Output "Extracting new containerd binaries"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
# Check if kube-log-runner.exe exists
if (Test-Path $kubeloggerPath) {
Write-Output "Recreating containerd service with kube-log-runner..."
$logPath = "\var\log\containerd"
# Check if directory exists
if (-Not (Test-Path -Path $logPath -PathType Container)) {
Write-Host "Creating log directory: $logPath"
New-Item -ItemType Directory -Path $logPath -Force | Out-Null
} else {
Write-Host "Log directory already exists: $logPath"
}
$ContainerdCommandLine = 'c:\k\kube-log-runner.exe --log-file=/var/log/containerd/containerd.log "c:\Program Files\containerd\containerd.exe" --register-service'
Write-Output "Containerd command line: $ContainerdCommandLine"
# Stop and delete the existing containerd service
Stop-Service -Name 'containerd' -Force -ErrorAction SilentlyContinue
$null = sc.exe delete containerd
# Wait for service to be fully deleted
$serviceCreated = $false
for ($i = 0; $i -lt 20; $i++) {
$service = Get-Service -Name containerd -ErrorAction SilentlyContinue
if ($null -eq $service) {
Write-Host "containerd service deleted successfully, recreating with kubelogger"
cmd.exe /c $ContainerdCommandLine
Start-Service Containerd
Write-Output "Successfully started containerd service with kubelogger"
$serviceCreated = $true
break
}
else {
Write-Host "Waiting for containerd service to be fully deleted... (attempt $($i + 1)/20)"
}
Start-Sleep -Seconds 1
}
if (-not $serviceCreated) {
Write-Error "Failed to delete containerd service after 20 attempts"
}
} else {
Write-Output "Starting containerd service without kube-log-runner..."
Start-Service containerd
}
}
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
Expand Down
42 changes: 40 additions & 2 deletions capz/templates/shared-image-gallery-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,46 @@ spec:
}
Write-Output "Extracting new containerd binaries"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
# Check if kube-log-runner.exe exists
if (Test-Path $kubeloggerPath) {
Write-Output "Recreating containerd service with kube-log-runner..."
$logPath = "\var\log\containerd"
# Check if directory exists
if (-Not (Test-Path -Path $logPath -PathType Container)) {
Write-Host "Creating log directory: $logPath"
New-Item -ItemType Directory -Path $logPath -Force | Out-Null
} else {
Write-Host "Log directory already exists: $logPath"
}
$ContainerdCommandLine = 'c:\k\kube-log-runner.exe --log-file=/var/log/containerd/containerd.log "c:\Program Files\containerd\containerd.exe" --register-service'
Write-Output "Containerd command line: $ContainerdCommandLine"
# Stop and delete the existing containerd service
Stop-Service -Name 'containerd' -Force -ErrorAction SilentlyContinue
$null = sc.exe delete containerd
# Wait for service to be fully deleted
$serviceCreated = $false
for ($i = 0; $i -lt 20; $i++) {
$service = Get-Service -Name containerd -ErrorAction SilentlyContinue
if ($null -eq $service) {
Write-Host "containerd service deleted successfully, recreating with kubelogger"
cmd.exe /c $ContainerdCommandLine
Start-Service Containerd
Write-Output "Successfully started containerd service with kubelogger"
$serviceCreated = $true
break
}
else {
Write-Host "Waiting for containerd service to be fully deleted... (attempt $($i + 1)/20)"
}
Start-Sleep -Seconds 1
}
if (-not $serviceCreated) {
Write-Error "Failed to delete containerd service after 20 attempts"
}
} else {
Write-Output "Starting containerd service without kube-log-runner..."
Start-Service containerd
}
}
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
Expand Down
42 changes: 40 additions & 2 deletions capz/templates/windows-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,46 @@ spec:
}
Write-Output "Extracting new containerd binaries"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
# Check if kube-log-runner.exe exists
if (Test-Path $kubeloggerPath) {
Write-Output "Recreating containerd service with kube-log-runner..."
$logPath = "\var\log\containerd"
# Check if directory exists
if (-Not (Test-Path -Path $logPath -PathType Container)) {
Write-Host "Creating log directory: $logPath"
New-Item -ItemType Directory -Path $logPath -Force | Out-Null
} else {
Write-Host "Log directory already exists: $logPath"
}
$ContainerdCommandLine = 'c:\k\kube-log-runner.exe --log-file=/var/log/containerd/containerd.log "c:\Program Files\containerd\containerd.exe" --register-service'
Write-Output "Containerd command line: $ContainerdCommandLine"
# Stop and delete the existing containerd service
Stop-Service -Name 'containerd' -Force -ErrorAction SilentlyContinue
$null = sc.exe delete containerd
# Wait for service to be fully deleted
$serviceCreated = $false
for ($i = 0; $i -lt 20; $i++) {
$service = Get-Service -Name containerd -ErrorAction SilentlyContinue
if ($null -eq $service) {
Write-Host "containerd service deleted successfully, recreating with kubelogger"
cmd.exe /c $ContainerdCommandLine
Start-Service Containerd
Write-Output "Successfully started containerd service with kubelogger"
$serviceCreated = $true
break
}
else {
Write-Host "Waiting for containerd service to be fully deleted... (attempt $($i + 1)/20)"
}
Start-Sleep -Seconds 1
}
if (-not $serviceCreated) {
Write-Error "Failed to delete containerd service after 20 attempts"
}
} else {
Write-Output "Starting containerd service without kube-log-runner..."
Start-Service containerd
}
}
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
Expand Down
42 changes: 40 additions & 2 deletions capz/templates/windows-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,46 @@ spec:
}
Write-Output "Extracting new containerd binaries"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
# Check if kube-log-runner.exe exists
if (Test-Path $kubeloggerPath) {
Write-Output "Recreating containerd service with kube-log-runner..."
$logPath = "\var\log\containerd"
# Check if directory exists
if (-Not (Test-Path -Path $logPath -PathType Container)) {
Write-Host "Creating log directory: $logPath"
New-Item -ItemType Directory -Path $logPath -Force | Out-Null
} else {
Write-Host "Log directory already exists: $logPath"
}
$ContainerdCommandLine = 'c:\k\kube-log-runner.exe --log-file=/var/log/containerd/containerd.log "c:\Program Files\containerd\containerd.exe" --register-service'
Write-Output "Containerd command line: $ContainerdCommandLine"
# Stop and delete the existing containerd service
Stop-Service -Name 'containerd' -Force -ErrorAction SilentlyContinue
$null = sc.exe delete containerd
# Wait for service to be fully deleted
$serviceCreated = $false
for ($i = 0; $i -lt 20; $i++) {
$service = Get-Service -Name containerd -ErrorAction SilentlyContinue
if ($null -eq $service) {
Write-Host "containerd service deleted successfully, recreating with kubelogger"
cmd.exe /c $ContainerdCommandLine
Start-Service Containerd
Write-Output "Successfully started containerd service with kubelogger"
$serviceCreated = $true
break
}
else {
Write-Host "Waiting for containerd service to be fully deleted... (attempt $($i + 1)/20)"
}
Start-Sleep -Seconds 1
}
if (-not $serviceCreated) {
Write-Error "Failed to delete containerd service after 20 attempts"
}
} else {
Write-Output "Starting containerd service without kube-log-runner..."
Start-Service containerd
}
}
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
Expand Down
42 changes: 40 additions & 2 deletions capz/templates/windows-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,46 @@ spec:
}
Write-Output "Extracting new containerd binaries"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
# Check if kube-log-runner.exe exists
if (Test-Path $kubeloggerPath) {
Write-Output "Recreating containerd service with kube-log-runner..."
$logPath = "\var\log\containerd"
# Check if directory exists
if (-Not (Test-Path -Path $logPath -PathType Container)) {
Write-Host "Creating log directory: $logPath"
New-Item -ItemType Directory -Path $logPath -Force | Out-Null
} else {
Write-Host "Log directory already exists: $logPath"
}
$ContainerdCommandLine = 'c:\k\kube-log-runner.exe --log-file=/var/log/containerd/containerd.log "c:\Program Files\containerd\containerd.exe" --register-service'
Write-Output "Containerd command line: $ContainerdCommandLine"
# Stop and delete the existing containerd service
Stop-Service -Name 'containerd' -Force -ErrorAction SilentlyContinue
$null = sc.exe delete containerd
# Wait for service to be fully deleted
$serviceCreated = $false
for ($i = 0; $i -lt 20; $i++) {
$service = Get-Service -Name containerd -ErrorAction SilentlyContinue
if ($null -eq $service) {
Write-Host "containerd service deleted successfully, recreating with kubelogger"
cmd.exe /c $ContainerdCommandLine
Start-Service Containerd
Write-Output "Successfully started containerd service with kubelogger"
$serviceCreated = $true
break
}
else {
Write-Host "Waiting for containerd service to be fully deleted... (attempt $($i + 1)/20)"
}
Start-Sleep -Seconds 1
}
if (-not $serviceCreated) {
Write-Error "Failed to delete containerd service after 20 attempts"
}
} else {
Write-Output "Starting containerd service without kube-log-runner..."
Start-Service containerd
}
}
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
Expand Down
Loading