world-federation-of-advertisers / cross-media-measurement

A privacy centric system for cross publisher, cross media ads measurement through secure multiparty computations.
https://halo.wfanet.org/
Apache License 2.0
36 stars 11 forks source link

Kind version and K8s client version incompatible #1780

Open renjiezh opened 2 months ago

renjiezh commented 2 months ago

Describe the bug Presubmit correctness test fails with message

io.kubernetes.client.openapi.ApiException: Message: java.lang.IllegalArgumentException: The field `volumeMounts` in the JSON string is not defined in the `V1ContainerStatus` properties. JSON: {"name":"gcp-kingdom-data-server-container","state":{"running":{"startedAt":"2024-08-22T21:13:38Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"localhost:5001/halo/kingdom/data-server:latest","imageID":"localhost:5001/halo/kingdom/data-server@sha256:bdd7e72687d7e4b415e54d2ea67b278fdb2ccee58aa518d6562922e15afb0090","containerID":"containerd://8a3d0451880911cc6885c6b6dd375bcd747f2789ec576fe026de1af3adca137a","started":true,"volumeMounts":[{"name":"config-files","mountPath":"/etc/halo-cmms/config-files","readOnly":true,"recursiveReadOnly":"Disabled"},{"name":"heap-dumps","mountPath":"/run/heap-dumps"},{"name":"gcp-kingdom-data-server-files","mountPath":"/var/run/secrets/files","readOnly":true,"recursiveReadOnly":"Disabled"},{"name":"kube-api-access-ns55w","mountPath":"/var/run/secrets/kubernetes.io/serviceaccount","readOnly":true,"recursiveReadOnly":"Disabled"}]}

It turns out the Kind version is changed by the installation script "kind-with-registry.sh". The version from the script is not explicit and seems it is using the latest version which is not supported by jvm k8s client.

The solution is :

  1. specify the Kind version during installation.
  2. Upgrade k8s client to match Kind.

Steps to reproduce Run presubmit test.

Component(s) affected All

Version v0.5.8

Environment Github workflow

Additional context

renjiezh commented 2 months ago

A temporary fix to specify the Kind version. https://github.com/world-federation-of-advertisers/cross-media-measurement/pull/1775#pullrequestreview-2256156629

SanjayVas commented 2 months ago

The appropriate fix is to update the K8s client version. It looks like #1779 is intended to do this.

Pinning the Kubernetes version used by the Kind tests doesn't really help long-term, as the K8s API client is also used to interact with clusters in cloud providers (GKE/EKS). These may also upgrade to newer versions of K8s. Therefore we need to ensure that our K8s client is kept up-to-date.