Skip to content

Commit

Permalink
feat: support pulling images from sov cloud's MCR for network isolate…
Browse files Browse the repository at this point in the history
…d cluster feature (#5663)
  • Loading branch information
bingosummer authored Feb 14, 2025
1 parent 6a486fc commit 5dbf888
Show file tree
Hide file tree
Showing 274 changed files with 411 additions and 273 deletions.
1 change: 1 addition & 0 deletions parts/linux/cloud-init/artifacts/cse_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ ARTIFACT_STREAMING_ENABLED="{{IsArtifactStreamingEnabled}}"
SYSCTL_CONTENT="{{GetSysctlContent}}"
PRIVATE_EGRESS_PROXY_ADDRESS="{{GetPrivateEgressProxyAddress}}"
BOOTSTRAP_PROFILE_CONTAINER_REGISTRY_SERVER="{{GetBootstrapProfileContainerRegistryServer}}"
MCR_REPOSITORY_BASE="{{GetMCRRepositoryBase}}"
ENABLE_IMDS_RESTRICTION="{{EnableIMDSRestriction}}"
INSERT_IMDS_RESTRICTION_RULE_TO_MANGLE_TABLE="{{InsertIMDSRestrictionRuleToMangleTable}}"
/usr/bin/nohup /bin/bash -c "/bin/bash /opt/azure/containers/provision_start.sh"
4 changes: 2 additions & 2 deletions parts/linux/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ EOF
}

configureContainerdRegistryHost() {
# TODO(binxi): need to update for sovereign cloud.
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down
3 changes: 3 additions & 0 deletions pkg/agent/baker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,9 @@ func getContainerServiceFuncMap(config *datamodel.NodeBootstrappingConfiguration
"GetBootstrapProfileContainerRegistryServer": func() string {
return config.ContainerService.Properties.SecurityProfile.GetPrivateEgressContainerRegistryServer()
},
"GetMCRRepositoryBase": func() string {
return config.CloudSpecConfig.KubernetesSpecConfig.MCRKubernetesImageBase
},
"IsArtifactStreamingEnabled": func() bool {
return config.EnableArtifactStreaming
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+Containerd/CSECommand

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+Containerd/CustomData

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+Containerd/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+Docker/CSECommand

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+Docker/CustomData

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+Docker/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+GPUDedicatedVHD/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S115/CSECommand

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S115/CustomData

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S115/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S117/CSECommand

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S117/CustomData

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S117/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S118/CSECommand

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S118/CustomData

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+K8S118/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/agent/testdata/AKSUbuntu1604+KubeletConfigFile/line70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ EOF
}

configureContainerdRegistryHost() {
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/mcr.microsoft.com/hosts.toml"
MCR_REPOSITORY_BASE="${MCR_REPOSITORY_BASE:=mcr.microsoft.com}"
CONTAINERD_CONFIG_REGISTRY_HOST_MCR="/etc/containerd/certs.d/${MCR_REPOSITORY_BASE}/hosts.toml"
mkdir -p "$(dirname "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}")"
touch "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
chmod 0644 "${CONTAINERD_CONFIG_REGISTRY_HOST_MCR}"
Expand Down
Loading

0 comments on commit 5dbf888

Please sign in to comment.