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

Conversation

mateoflorido
Copy link
Member

@mateoflorido mateoflorido commented Jun 19, 2024

Overview

Sync Calico CNI images from upstream to the ghcr.io registry.

Rationale

We have encountered that we hit the rate limits of DockerHub. This pull request mirrors the images we are using in Calico to ghcr.io, allowing the k8s snap to pull them from there instead of DockerHub.

Testing

Events:
  Type     Reason     Age   From               Message
  ----     ------     ----  ----               -------
  Normal   Scheduled  21s   default-scheduler  Successfully assigned calico-system/calico-node-ps4zh to kcp-1
  Normal   Pulled     22s   kubelet            Container image "ghcr.io/canonical/k8s-snap/calico/pod2daemon-flexvol:v3.28.0" already present on machine
  Normal   Created    22s   kubelet            Created container flexvol-driver
  Normal   Started    22s   kubelet            Started container flexvol-driver
  Normal   Pulling    21s   kubelet            Pulling image "ghcr.io/canonical/k8s-snap/calico/cni:v3.28.0"
  Normal   Pulled     15s   kubelet            Successfully pulled image "ghcr.io/canonical/k8s-snap/calico/cni:v3.28.0" in 5.746s (5.746s including waiting). Image size: 94536228 bytes.
  Normal   Created    15s   kubelet            Created container install-cni
  Normal   Started    15s   kubelet            Started container install-cni
  Normal   Pulling    14s   kubelet            Pulling image "ghcr.io/canonical/k8s-snap/calico/node:v3.28.0"
  Normal   Pulled     7s    kubelet            Successfully pulled image "ghcr.io/canonical/k8s-snap/calico/node:v3.28.0" in 7.202s (7.202s including waiting). Image size: 115239232 bytes.
  Normal   Created    7s    kubelet            Created container calico-node
  Normal   Started    7s    kubelet            Started container calico-node
  Warning  Unhealthy  6s    kubelet            Readiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to connect to BIRDv4 socket: dial unix /var/run/bird/bird.ctl: connect: no such file or directory
  Warning  Unhealthy  5s    kubelet            Readiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to connect to BIRDv4 socket: dial unix /var/run/calico/bird.ctl: connect: connection refused

@mateoflorido mateoflorido marked this pull request as ready for review June 19, 2024 16:00
@mateoflorido mateoflorido requested a review from a team as a code owner June 19, 2024 16:00
Copy link
Contributor

@neoaggelos neoaggelos left a comment

Choose a reason for hiding this comment

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

Also needs

// 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
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",
)

src/k8s/pkg/k8sd/features/calico/chart.go Outdated Show resolved Hide resolved
@mateoflorido
Copy link
Member Author

Also needs

// 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
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",
)

I have checked and all the images are already in the upstream-images.yaml file. Is there anything else you would like to sync from upstream?

Copy link
Contributor

@neoaggelos neoaggelos left a comment

Choose a reason for hiding this comment

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

Final comment and we're good to go! Nice work!

src/k8s/pkg/k8sd/features/calico/register.go Outdated Show resolved Hide resolved
@neoaggelos neoaggelos merged commit 325380d into main Jun 21, 2024
18 checks passed
@neoaggelos neoaggelos deleted the KU-1016/calico-images branch June 21, 2024 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants