Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow to initilize the aws-cli config #54

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}}"