Add verification of Calico policy setting during upgrade
In order to perform Calico upgrade properly, it's required to
determine whether Calico policy is enabled on the environment already
and to align policy settings for Calico v3.x (that will be running
after upgrade) accordingly.
The following actions are performed:
1. Check CNI config for policy settings.
2. Check Kubernetes addons for calico_policy addon.
3. Check whether kube-controllers pod is running.
4. Remove v2.6.x calico_policy addon on masters to not interfere with
v3.x kube-controllers.
5. Check consistency between Calico policy entities detected during
pp.1-3. Show a warning and do not touch policy turn on/off flag in
case of non-consistency.
6. Check Calico policy setting for v3.x (that will be effective after
upgrade) if Calico policy was enabled for currently running
environment (so for Calico v2.6.x) already.
7. Issue a warning message if Calico policy is enabled currently but
it is going to be disabled after upgrade.
It's safe to enable Calico policy any time, but it may be unsafe to
disable it. So, no need to disable Calico policy for v3.x if it's
not in use currently. But if Calico policy is in use already, it
should be enabled after upgrade as well.
Related-Prod: PROD-25161 (PROD:25161)
Change-Id: I35634adef52c29037b0184440aae9cbb4872ffd5
1 file changed