Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Running aws kubernetes deploy --dry-run seems to still create the kubernetes objects

As part of the pipeline I want to check the kubernetes deployment scripts for syntax errors. I am adding the --dry-run=client (or just --dry-run) to the deploy command. But that seems to be ignored and the script gets executed as it were called without --dry-run. 

The pipeline is defined as below:


pipeatlassian/aws-eks-kubectl-run:1.4.1 
variables:                
  AWS_ACCESS_KEY_ID"$AWS_DEV_ACCESS_KEY_ID"                
  AWS_SECRET_ACCESS_KEY"$AWS_DEV_SECRET_ACCESS_KEY"                
  AWS_DEFAULT_REGION"$AWS_DEV_DEFAULT_REGION"                
  CLUSTER_NAME"$AWS_CLUSTER_NAME"
  KUBECTL_COMMAND"apply"                
  RESOURCE_PATH"k8s/deploy/aws-dev"                
  KUBECTL_ARGS: "--dry-run=client"                
  KUBECTL_APPLY_ARGS"-k"

 How can I achieve that behavior?

1 answer

0 votes

Hi @Brad Vrabete ,

Thank you for your question!

The pipe atlassian/aws-eks-kubectl-run:1.4.1 based on kubectl v1.17.

According to the kubectl v1.17 documentation apply command supports the next flags only:

If true, only print the object that would be sent, without sending it.

Warning:
--dry-run cannot accurately output the result of merging the local manifest and the server-side data.

Use --server-dry-run to get the merged result instead.

so, recommended way is "--server-dry-run".


Also, we are investigating bump version of the kubectl.

Cheers,
Oleksandr Kyrdan

Hi @Oleksandr Kyrdan,

Thanks for the answer. The strange thig is that it works if I put all the parameters in the KUBECTL_COMMAND parameter and remove the rest; that's why I thought there must be something in the pipe that prevents it from running. I di not try --server-dry-run.

Are you filtering the parameters passed to the pipe? That would not be a good idea as it is hard to know what went wrong (hence my question); I would rather get the error message from kubectl and let people handle that. 

In any case I'll try with  --server-dry-run.

Thanks,

Brad

Like Oleksandr Kyrdan likes this

@Brad Vrabete

Yep, good question! It shouldn't filter or modify passed params.

We are investigating this case and notify you.

 

Thank you!
Oleksandr Kyrdan

Like Brad Vrabete likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

533 views 15 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you