0

In my Kubernetes Service, running on OpenShift, I have an annotation like this:

  annotations:
    service.beta.openshift.io/serving-cert-secret-name: "..."

which works fine on OpenShift 4.x.

However I also want to support OpenShift 3.11, which requires the similar annotation (note alpha):

service.alpha.openshift.io/serving-cert-secret-name: "..."

Can I just include both annotations in my yaml file in order to support both versions? In other words will OpenShift 4.x ignore the alpha annotation; and will OpenShift 3.11 ignore the beta annotation?

Dave L.
  • 9,595
  • 7
  • 43
  • 69

1 Answers1

2

Yes

This is a common pattern for alpha/beta annotation migrations in the Kubernetes ecosystem, the controllers will only be looking for their specific annotation, any the controller doesn't recognise will be ignored.

If a controller is written to be backwards-compatible, they will normally look for the new beta annotation, and only if not finding it respect the alpha one.

Mike Bryant
  • 1,072
  • 9
  • 11
  • Thanks Mike -- Do you know if this is documented anywhere in the OpenShift docs by any chance? I could not find it – Dave L. Aug 20 '20 at 18:02
  • It's not documented explicitly anywhere I could find. I'm drawing on the docs for each version that says they honor the specific annotation for that version, and my general knowledge of how other Kubernetes things are written. – Mike Bryant Aug 21 '20 at 07:23