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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,467,721
Community Members
 
Community Events
177
Community Groups

Atlassian/kubectl-run by default runs with --dry-run enabled

Edited

I'm using atlassian/kubectl-run:3.3.1 and trying to deploy resources in a namespace that doesn't exist yet but is created in the same apply. 

The namespace is defined like this:

apiVersion: v1
kind: Namespace
metadata:
name: namespace-name

 

Due to the pipe running dry-run by default I'm unable to apply both the namespace resources and the to be deployed resources in a single apply. 

Is there a way around this (by disabling the dry-run by default) or am I stuck creating the namespaces and the resources in two separate applys?

1 answer

1 accepted

0 votes
Answer accepted

Hi @Jurgen Heeffer . Thanks for your question. Please provide us your configuration details of how you use the pipe.

Maybe you use the pipe this way:

script:
  - pipe: atlassian/kubectl-run:3.3.1
    variables:
      KUBE_CONFIG: $KUBE_CONFIG
      KUBECTL_COMMAND: 'apply'
      RESOURCE_PATH: 'nginx.yml'
      KUBECTL_ARGS:
        - '--dry-run'

then you should remove '--dry-run' from KUBECTL_ARGS.

Regards, Igor

Hi @Igor Stoyanov

I'm currently using it like this. 

 
- pipe: atlassian/kubectl-run:3.3.1
variables:
KUBE_CONFIG: ${!kube_config}
KUBECTL_COMMAND: 'apply'
KUBECTL_APPLY_ARGS: '-k'
RESOURCE_PATH: '.deploy/overlays/${ENVIRONMENT}/'
I'm not currently specifying dry-run. 
With regards,
Jurgen

@Jurgen Heeffer Thanks for your response. Please provide also your pipeline output.

 

Regards, Igor

--dry-run is used in validate spec file by default, and i guess you receive 

spec file validation failed error. Our team may think about disable validation with an option available for user, will be this solution ok for you?
Regards, Igor

Hi Igor,

Ah yes that would be perfect. 

Thank you for the response!

With regards,
Jurgen

@Jurgen Heeffer . We released a new version 3.4.0 of the pipe:

script:
  - pipe: atlassian/kubectl-run:3.4.0
    variables:
      KUBE_CONFIG: $KUBE_CONFIG
      KUBECTL_COMMAND: 'apply'
      RESOURCE_PATH: 'nginx.yml'
      DISABLE_VALIDATION: 'true'

Regards, Igor

Hi Igor,

Thank you for the change this is perfect!

With regards,

Jurgen

Like Igor Stoyanov likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events