-
Story
-
Resolution: Done
-
Normal
-
None
-
None
-
5
-
False
-
None
-
False
-
-
-
AppSvc Sprint 240, AppSvc Sprint 241
Owner: Architect:
Francesco Ilario
Story (Required)
As a Primaza Administrator,
I would like to have a dry-run and output arguments for primazactl's commands
so that I can test the command before executing and print the manifests that would be created
Background (Required)
To allow the Primaza Administrator to test the command before applying it, we can introduce a dry-run argument.
To facilitate the integration with GitOps tools (like ArgoCD), this dry-run argument may be used together with an output to print the YAML manifests that primaza would apply.
See epic for arch document link.
Glossary
See glossary in architecture document
Out of scope
- worker join output
In Scope
- create tenant
- create application-namespace
- create service-namespace
Approach(Required)
Introduce the following two arguments:
- --dry-run: boolean value, if present won't apply the manifests
- --output: default to None, may be set to yaml to print the manifests to stdout
primazactl's behavior should mostly mimic kubectl's one.
The big difference should be that if kubectl is executed without --dry-run it will output the resource manifests as they are after the resource are created (same as if you perform a get after the create).
primazactl should instead print them as they are before creating them.
This is because main target for this feature is integration with DevOps.
Whenever there is the need to generate an Access Token in a cluster and create a secret containing it in another cluster, if executed with --dry-run the kubeconfig secret is created empty and a WARNING is printed to stderr.
The secrets should be the following:
- create tenant command: NA
- join cluster command: tenant namespace, primaza-kubeconfig-[CLUSTER_ENVIRONMENT_NAME]
- create application-namespace command: application namespace, primaza-app-kubeconfig
- create service-namespace command: service namespace, primaza-svc-kubeconfig
Demo requirements(Required)
NA
Dependencies
NA
Edge Case
NA
BDD Tests
You can find BDD Test specification for this story in the "Testing Instruction" Field Tab or in the GitHub Issue linked to this story.
Click here for all BDD Tests Issues.
Acceptance Criteria
- Development
primazactl supports the --dry-run flag on create tenant command
primazactl supports the --dry-run flag on join worker command
primazactl supports the --dry-run flag on create application-namespace command
primazactl supports the --dry-run flag on create service-namespace command
primazactl supports the --output flag on create tenant command
primazactl supports the --output flag on join worker command
primazactl supports the --output flag on create application-namespace command
primazactl supports the --output flag on create service-namespace command
- QE
There are test cases for dry-run and output arguments
- Docs
There is a page in our docs dedicated to explaining how dry-run and output works (I think most of it can be taken from this story)
Update architecture document with any changes while implementing
INVEST Checklist
Dependencies identified
Blockers noted and expected delivery timelines set
Design is implementable
Acceptance criteria agreed upon
Story estimated
Legend
Unknown
Verified
Unsatisfied