Skip to content

Commit

Permalink
Merge pull request #54 from openinfradev/initialize_flow
Browse files Browse the repository at this point in the history
add workflow to initilize the aws-cli config
  • Loading branch information
zugwan authored Mar 22, 2022
2 parents 5058247 + 5e51555 commit 5f3f854
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tks-cluster/create-aws-conf-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: tks-create-aws-conf-secret
namespace: argo
spec:
entrypoint: createTokenSecret
arguments:
parameters:
- name: aws_access_key_id
value: "aws_access_key_id"
- name: aws_secret_access_key
value: "aws_secret_access_key"
templates:
- name: createTokenSecret
activeDeadlineSeconds: 120
container:
name: 'createClusterSite'
image: 'k8s.gcr.io/hyperkube:v1.18.8'
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -ecx
- |
kubectl delete secret -n argo awsconfig-secret || true
echo "[default]
aws_access_key_id = $aws_access_key_id
aws_secret_access_key = $aws_secret_access_key" > /tmp/credentials
echo "[default]
region = ap-northeast-2
output = text" > /tmp/config
kubectl create -n argo secret generic awsconfig-secret --from-file=config=/tmp/config --from-file=credentials=/tmp/credentials
env:
- name: aws_access_key_id
value: "{{workflow.parameters.aws_access_key_id}}"
- name: aws_secret_access_key
value: "{{workflow.parameters.aws_secret_access_key}}"



0 comments on commit 5f3f854

Please sign in to comment.