From b3a5c231d83ef2ba649ac83e526a4cbacf66c432 Mon Sep 17 00:00:00 2001 From: ArthurSens Date: Wed, 2 Mar 2022 10:45:56 +0000 Subject: [PATCH 1/2] werft/deploy/post-process: Remove openvsx statefulsetstatus Signed-off-by: ArthurSens --- .werft/jobs/build/installer/post-process.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.werft/jobs/build/installer/post-process.sh b/.werft/jobs/build/installer/post-process.sh index d4b83188455fd6..fb31576ef6e7cf 100755 --- a/.werft/jobs/build/installer/post-process.sh +++ b/.werft/jobs/build/installer/post-process.sh @@ -218,6 +218,15 @@ while [ "$i" -le "$DOCS" ]; do yq m -x -i k8s.yaml -d "$i" /tmp/"$NAME"overrides.yaml fi + if [[ "openvsx-proxy" == "$NAME" ]] && [[ "$KIND" == "StatefulSet" ]]; then + # Our installer is rendering StatefulSet Status field although it is not a necessary field. + # In fact, the fields under StatefulSet status has changed over the last Kubernetes versions, + # We're being hit by this while trying to install Gitpod on GKE and k3s running different versions + # where 'availableReplicas' is unkown in GKE while being required on k3s. + # This workaround should be deleted when https://github.com/gitpod-io/gitpod/issues/8529 gets fixed. + yq d -i k8s.yaml -d "$i" 'status' + fi + if [[ ! -v WITH_VM ]] && [[ "ws-proxy" == "$NAME" ]] && [[ "$KIND" == "Service" ]]; then WORK="overrides for $NAME $KIND" echo "$WORK" From b2a6a000ee03b19f4b7d6d9fdb178845e326b5c8 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Wed, 2 Mar 2022 11:30:29 +0000 Subject: [PATCH 2/2] [installer]: document the StatefulSet validation error and workaround --- install/installer/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/install/installer/README.md b/install/installer/README.md index d9029e226b57ab..61c28139b656d6 100644 --- a/install/installer/README.md +++ b/install/installer/README.md @@ -163,6 +163,24 @@ yq eval-all --inplace \ gitpod.yaml ``` +## Error validating `StatefulSet.status` + +```shell +error: error validating "gitpod.yaml": error validating data: ValidationError(StatefulSet.status): missing required field "availableReplicas" in io.k8s.api.apps.v1.StatefulSetStatus; if you choose to ignore these errors, turn validation off with --validate=false +``` + +Depending upon your Kubernetes implementation, you may receive this error. This is +due to a bug in the underlying StatefulSet dependency, which is used to generate the +OpenVSX proxy (see [#8529](https://github.com/gitpod-io/gitpod/issues/8529)). + +To fix this, you will need to post-process the rendered YAML to remove the `status` field. + +```shell +yq eval-all --inplace \ + 'del(select(.kind == "StatefulSet" and .metadata.name == "openvsx-proxy").status)' \ + gitpod.yaml +``` + --- # What is installed