Home > database >  Kubernetes Run CURL on Node with Taints
Kubernetes Run CURL on Node with Taints

Time:10-15

Currently I run a curl container and directly connect with its terminal to verify connectivity to services and check we can can connect on some port to an external service or a service maintained by some other team.

kubectl run curl -it --rm --image=curlimages/curl -- sh

Now the problem is that I have to run a curl container on a Node that has taints and tolerations enabled. Is there a way to run this container on by providing tolerations from the kubectl cli?

For reference I am using AKS service and we use helm for deployment. In order to schedule workloads on the tainted nodes we use a combination of telerations and nodeaffinity in combination. Configs given below.

  spec:
      tolerations:
        - key: "mendix"
          operator: "Equal"
          value: "true"
          effect: "NoSchedule"
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: appType
                operator: In
                values:
                - mendix

CodePudding user response:

You can do something like this, if you need to run it on a specific node that is tainted (it will run despite any taints):

kubectl run curl -it --rm --image=curlimages/curl --overrides \
  '{"spec":{"tolerations":[{"operator":"Exists"}]},"nodeName":"mynode"}' \
  -- sh
  • Related