Pipe aws-eks-kubectl-run fails when namespace set as part of the config

Vish October 1, 2023

Current configuration that i use for deployment

- pipe: atlassian/aws-eks-kubectl-run:2.4.0
variables:
CLUSTER_NAME: $CLUSTER_NAME
KUBECTL_COMMAND: 'apply'
KUBECTL_APPLY_ARGS: '-k'
RESOURCE_PATH: $DEPLOYMENT_PATH

The DEPLOYMENT_PATH points to an overlay kustomization configuration that includes namespace.yml file defining the namespace to be applied as part of this config.

namespace/<namespaceName> created (server dry run)
Error from server (NotFound): error when creating "<$DEPLOYMENT_PATH>": namespaces "<namespaceName>" not found
Error from server (NotFound): error when creating "<$DEPLOYMENT_PATH>": namespaces "<namespaceName>" not found
Error from server (NotFound): error when creating "<$DEPLOYMENT_PATH>": namespaces "<namespaceName>" not found
✖ spec file validation failed.

I need a way to apply the changes along with creation of namespace thru the pipe. 

 

P.S: I can replicate the issue in kubectl when i pass `--dry-run=server` flag.

3 answers

1 accepted

0 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2023

@Vish hi. We released a new version 2.5.0 of the aws-eks-kubectl-run pipe, which now supports disable validation and pre-execution script features.

  - pipe: atlassian/aws-eks-kubectl-run:2.5.0
    variables:
      CLUSTER_NAME: 'my-kube-cluster'
      KUBECTL_COMMAND: 'apply'
      RESOURCE_PATH: 'nginx.yml'
      DISABLE_VALIDATION: 'true'

 

  - echo 'script logic' > .my-script.sh
  - chmod 005 my-script.sh
  - pipe: atlassian/aws-eks-kubectl-run:2.5.0
    variables:
      CLUSTER_NAME: 'my-kube-cluster'
      KUBECTL_COMMAND: 'apply'
      RESOURCE_PATH: 'nginx.yml'
      PRE_EXECUTION_SCRIPT: '.my-script.sh'

 

Regards, Igor

Vish November 3, 2023

That is awesome!. Thank you for this quick turn around.

Like Igor Stoyanov likes this
0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2023

@Vish hi. According to the question you provided there is the response for your case with using DISABLE_VALIDATION variable:

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

Vish October 6, 2023

Hey @Igor Stoyanov , That's available `kubectl-run` pipe but don't see that in any documentation for `aws-eks-kubectl-run` latest version.

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2023

@Vish hi. Thanks for your remark. We will try to implement the same idea in this pipe and notify you when new version will become available.

Regards, Igor

Like Vish likes this
0 votes
Vish October 2, 2023

Similar issue with different pipe is captured here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events