0

021-03-13T08:42:55.8392238Z ##[section]Starting: kubectl exec 2021-03-13T08:42:55.8405006Z ============================================================================== 2021-03-13T08:42:55.8405352Z Task : Kubectl 2021-03-13T08:42:55.8405912Z Description : Deploy, configure, update a Kubernetes cluster in Azure Container Service by running kubectl commands 2021-03-13T08:42:55.8406301Z Version : 1.181.0 2021-03-13T08:42:55.8406563Z Author : Microsoft Corporation 2021-03-13T08:42:55.8406884Z Help : https://aka.ms/azpipes-kubectl-tsg 2021-03-13T08:42:55.8407232Z ============================================================================== 2021-03-13T08:42:56.3648668Z Downloading: https://storage.googleapis.com/kubernetes-release/release/stable.txt 2021-03-13T08:42:56.5295919Z Downloading: https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/linux/amd64/kubectl 2021-03-13T08:42:57.0282085Z Caching tool: kubectl 1.20.4 x64 2021-03-13T08:42:57.0677423Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/kubectl/1.20.4/x64 2021-03-13T08:42:57.1937535Z ============================================================================== 2021-03-13T08:42:57.1938076Z Kubectl Client Version: v1.20.4 2021-03-13T08:42:57.1938494Z Kubectl Server Version: v1.19.6 2021-03-13T08:42:57.1938938Z ============================================================================== 2021-03-13T08:42:57.2065403Z [command]/opt/hostedtoolcache/kubectl/1.20.4/x64/kubectl exec -n kube-system -i calicoctl -- /calicoctl create -f - < global-deny.yaml 2021-03-13T08:42:57.7060782Z Usage: 2021-03-13T08:42:57.7063189Z calicoctl create --filename= [--recursive] [--skip-empty] 2021-03-13T08:42:57.7064917Z [--skip-exists] [--config=] [--namespace=] 2021-03-13T08:42:57.7067062Z Invalid option: 'calicoctl create -f - < global-deny.yaml'. Use flag '--help' to read about a specific subcommand. 2021-03-13T08:42:57.7120995Z command terminated with exit code 1 2021-03-13T08:42:57.7212396Z ##[error]Usage: 2021-03-13T08:42:57.7230325Z ##[error] calicoctl create --filename= [--recursive] [--skip-empty] 2021-03-13T08:42:57.7231900Z ##[error] [--skip-exists] [--config=] [--namespace=] 2021-03-13T08:42:57.7233388Z ##[error]Invalid option: 'calicoctl create -f - < global-deny.yaml'. Use flag '--help' to read about a specific subcommand. 2021-03-13T08:42:57.7234557Z ##[error]command terminated with exit code 1 2021-03-13T08:42:57.7235473Z commandOutput 2021-03-13T08:42:57.7239235Z ##[error]The process '/opt/hostedtoolcache/kubectl/1.20.4/x64/kubectl' failed with exit code 1 2021-03-13T08:42:57.7286625Z ##[section]Finishing: kubectl exec

Same i'm able to run using cli kubectl exec -n kube-system -i calicoctl -- /calicoctl create -f - < global-deny.yaml

  • exit code 1: the container crashed because the application crashed. Here is a [case](https://stackoverflow.com/a/63705352/11508192) with similar issue you can refer to. Besides, can you share more details about pipeline definition? –  Mar 16 '21 at 07:33
  • I'm running this in the azure DevOps pipeline. Using kubectl task on AKS cluster. The same running on CLI without issues. – shabbir1226 Mar 24 '21 at 13:23

0 Answers0