diff --git a/tks-cluster/create-aws-conf-secret.yaml b/tks-cluster/create-aws-conf-secret.yaml new file mode 100755 index 00000000..9eaf03c6 --- /dev/null +++ b/tks-cluster/create-aws-conf-secret.yaml @@ -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}}" + + + \ No newline at end of file