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

Sync Calico CNI images from upstream #506

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
30 changes: 30 additions & 0 deletions build-scripts/hack/upstream-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,33 @@ sync:
- source: registry.k8s.io/pause:3.10
target: ghcr.io/canonical/k8s-snap/pause:3.10
type: image
- source: docker.io/calico/apiserver:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/apiserver:v3.28.0
type: image
- source: docker.io/calico/cni:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/cni:v3.28.0
type: image
- source: docker.io/calico/csi:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/csi:v3.28.0
type: image
- source: docker.io/calico/ctl:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/ctl:v3.28.0
type: image
- source: docker.io/calico/kube-controllers:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/kube-controllers:v3.28.0
type: image
- source: docker.io/calico/node-driver-registrar:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/node-driver-registrar:v3.28.0
type: image
- source: docker.io/calico/node:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/node:v3.28.0
type: image
- source: docker.io/calico/pod2daemon-flexvol:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/pod2daemon-flexvol:v3.28.0
type: image
- source: docker.io/calico/typha:v3.28.0
target: ghcr.io/canonical/k8s-snap/calico/typha:v3.28.0
type: image
- source: quay.io/tigera/operator:v1.34.0
target: ghcr.io/canonical/k8s-snap/tigera/operator:v1.34.0
type: image
6 changes: 3 additions & 3 deletions src/k8s/pkg/k8sd/features/calico/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ var (
ManifestPath: path.Join("charts", "tigera-operator-v3.28.0.tgz"),
}

// tigeraOperatorRepo represents the repo to fetch the tigera-operator image for calico.
// Note: Tigera is the company behind Calico and the tigera-operator is the operator for Calico.
// TODO: use ROCKs instead of upstream
tigeraOperatorRegistry = "quay.io"
// imageRepo represents the repo to fetch the Calico CNI images.
imageRepo = "ghcr.io/canonical/k8s-snap"

// tigeraOperatorImage represents the image to fetch for calico.
tigeraOperatorImage = "tigera/operator"
Expand All @@ -27,7 +27,7 @@ var (

// calicoCtlImage represents the image to fetch for calicoctl.
// TODO: use ROCKs instead of upstream
calicoCtlImage = "docker.io/calico/ctl"
calicoCtlImage = "ghcr.io/canonical/k8s-snap/calico/ctl"
// calicoCtlTag represents the tag to use for the calicoctl image.
calicoCtlTag = "v3.28.0"
)
3 changes: 2 additions & 1 deletion src/k8s/pkg/k8sd/features/calico/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func ApplyNetwork(ctx context.Context, snap snap.Snap, cfg types.Network, _ type

values := map[string]any{
"tigeraOperator": map[string]any{
"registry": tigeraOperatorRegistry,
"registry": imageRepo,
"image": tigeraOperatorImage,
"version": tigeraOperatorVersion,
},
Expand All @@ -67,6 +67,7 @@ func ApplyNetwork(ctx context.Context, snap snap.Snap, cfg types.Network, _ type
"calicoNetwork": map[string]any{
"ipPools": podIpPools,
},
"registry": imageRepo,
},
"serviceCIDRs": serviceCIDRs,
}
Expand Down
34 changes: 17 additions & 17 deletions src/k8s/pkg/k8sd/features/calico/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ import (

func init() {
images.Register(
fmt.Sprintf("%s/%s:%s", tigeraOperatorRegistry, tigeraOperatorImage, tigeraOperatorVersion),
fmt.Sprintf("%s/%s:%s", imageRepo, tigeraOperatorImage, tigeraOperatorVersion),
)

// TODO: configurable Calico images, include in this list
//
// Hardcoded list based on "k8s kubectl get node -o template='{{ range .items }}{{ .metadata.name }}{{":"}}{{ range .status.images }}{{ "\n- " }}{{ index .names 1 }}{{ end }}{{"\n"}}{{ end }}' | grep calico":
//
// - docker.io/calico/node:v3.28.0
// - docker.io/calico/cni:v3.28.0
// - docker.io/calico/apiserver:v3.28.0
// - docker.io/calico/kube-controllers:v3.28.0
// - docker.io/calico/typha:v3.28.0
// - docker.io/calico/node-driver-registrar:v3.28.0
// - docker.io/calico/csi:v3.28.0
// - docker.io/calico/pod2daemon-flexvol:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/node:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/cni:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/apiserver:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/kube-controllers:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/typha:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/node-driver-registrar:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/csi:v3.28.0
// - ghcr.io/canonical/k8s-snap/calico/pod2daemon-flexvol:v3.28.0

images.Register(
"docker.io/calico/node:v3.28.0",
"docker.io/calico/cni:v3.28.0",
"docker.io/calico/apiserver:v3.28.0",
"docker.io/calico/kube-controllers:v3.28.0",
"docker.io/calico/typha:v3.28.0",
"docker.io/calico/node-driver-registrar:v3.28.0",
"docker.io/calico/csi:v3.28.0",
"docker.io/calico/pod2daemon-flexvol:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/node:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/cni:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/apiserver:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/kube-controllers:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/typha:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/node-driver-registrar:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/csi:v3.28.0",
"ghcr.io/canonical/k8s-snap/calico/pod2daemon-flexvol:v3.28.0",
)
mateoflorido marked this conversation as resolved.
Show resolved Hide resolved
}
Loading