]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/kubeadm: set up tigera resources via kubectl create 48097/head
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 29 Aug 2022 14:03:01 +0000 (10:03 -0400)
committerAdam King <adking@redhat.com>
Wed, 14 Sep 2022 19:16:31 +0000 (15:16 -0400)
Fixes: https://tracker.ceph.com/issues/57268
The tigera operator for the calico CNI has some pretty large resource
definitions. The length of the definitions can cause the "client side
apply", the default mode for `kubectl apply ....`, to fail due to the
length of the needed annotation that would result:

```
2022-08-22T20:24:55.636 INFO:teuthology.orchestra.run.smithi087.stdout:clusterrolebinding.rbac.authorization.k8s.io/tigera-operator created
2022-08-22T20:24:55.670 INFO:teuthology.orchestra.run.smithi087.stdout:deployment.apps/tigera-operator created
2022-08-22T20:24:55.671 INFO:teuthology.orchestra.run.smithi087.stderr:The CustomResourceDefinition "installations.operator.tigera.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes
2022-08-22T20:24:55.674 DEBUG:teuthology.orchestra.run:got remote process result: 1
```

There are two simple options for avoiding this error. One is to use
`kubectl create`. The create command will not make this lengthy
annotation. It will fail if any of the resources already exist. The
other option is to use server-side apply, via the `kubectl apply
--server-side ...` command. It is new in k8s 1.18. It will not create
the annotation either.

The block of code setting up the CNI already uses `kubectl create` to
create the custom resources that configure the tigera operator.
Therefore it should be safe to assume the block of code in question
doesn't need to be idempotent and we can also use `kubectl create`
elsewhere in the same block.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit f8b0511d6c45977f2f7925769cf570a82ea447bc)

qa/tasks/kubeadm.py

index 2b967f5569f5f380f3edf3e0a9bde6061e4cd944..9f147c6e77c431e68fce3f6e8daf7476170fa72a 100644 (file)
@@ -403,7 +403,7 @@ def pod_network(ctx, config):
 
     elif pnet == 'calico':
         _kubectl(ctx, config, [
-            'apply', '-f',
+            'create', '-f',
             'https://docs.projectcalico.org/manifests/tigera-operator.yaml'
         ])
         cr = {