Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support pulling images from sov cloud's MCR for network isolated cluster feature #5663

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.

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.

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
Loading