forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to pass pod annotations and labels at the template level (a…
…rgoproj#798) * Add ability to pass pod annotations and labels at the template level **What** - Add ability to set `template.metadata.annotations` and `template.metadata.labels` as pod metadata **Why** Labels are helpful when searching for k8s resources. Annotations are another type of metadata k8s supports. They can be used by various tools like [kube2iam](https://github.com/jtblin/kube2iam). **Testing** Add metadata to templates. Submit job. Test annotations and labels were added with `kubectl describe pod <pod-name>`. See `examples/pod-metadata.yaml`. * Fix broken json tags * Update codegen * Update generated files
- Loading branch information
Showing
8 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This template demonstrates a how pod annotations and labels may be set at the template level | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: steps- | ||
spec: | ||
entrypoint: hello-hello-hello | ||
|
||
templates: | ||
- name: hello-hello-hello | ||
steps: | ||
- - name: hello1 | ||
template: whalesay | ||
arguments: | ||
parameters: | ||
- name: message | ||
value: "hello1" | ||
|
||
- name: whalesay | ||
inputs: | ||
parameters: | ||
- name: message | ||
container: | ||
image: docker/whalesay | ||
command: [cowsay] | ||
args: ["{{inputs.parameters.message}}"] | ||
metadata: | ||
annotations: | ||
iam.amazonaws.com/role: role-arn | ||
labels: | ||
app: whalesay | ||
tier: demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters