-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Problem
An update to the K8s dependencies broke the installation process. In k8s 1.24, NetworkPolicy has a new status
object added to it. In the Golang definition, this does not use omitempty
, so the generation of the YAML add status: {}
to the YAML.
As Kubernetes <= 1.23 doesn't know how to handle it, this returns this error when running kubectl apply
error: error validating "STDIN": error validating data: ValidationError(NetworkPolicy): unknown field "status" in io.k8s.api.networking.v1.NetworkPolicy; if you choose to ignore these errors, turn validation off with --validate=false
This is not the first time we've had this problem - we've already had it with StatefulSets
This is likely to be a recurring issue and could hit us any time we do an update of the Kubernetes variables.
Potential Solutions
These are just the solutions I came up with at the time of writing. If you have one, please add it to the list with pros and cons
1. Post-process with yq
Every time we get one of these, we document the problem as done with StatefulSets
Pros
- Simple
Cons
- Has to be done everywhere (KOTS, production, preview-environments, etc)
- Could become a very long list
- Not clear when these should be removed from docs
2. Lock the versions to the Kubernetes versions we support
We officially support the latest version of Kubernetes and the 2 previous versions (currently 1.22-1.24). We could lock the versions of Kubernetes
Pros
- No need to be done everywhere
Cons
- Not exactly clear how this could be achieved
- Workspace team may need to bump things that they need to support
- May still get this problem when bumping to a new version (in this case, from 1.23 to 1.24)
3. Process inside the Installer
Either customise the Golang structs (preferred) or post-processing inside the Installer (if first not possible) so that the bad parameters are never generated.
Pros
- No need to be done everywhere
Cons
- Bit hacky?
My personal preference is 3. However, this is something that affects all teams so it should be debated by all and a final decision should be made by @corneliusludmann and @csweichel
cc @gitpod-io/engineering-self-hosted @gitpod-io/engineering-ide @gitpod-io/product-engineering @gitpod-io/platform @gitpod-io/engineering-workspace @gitpod-io/engineering-webapp
This action was created from Incident 172 by Mads Hartmann, using incident.io 🔥