-
Notifications
You must be signed in to change notification settings - Fork 3
/
pipeline-task-kubeconfig-creator.yaml
68 lines (68 loc) · 2.24 KB
/
pipeline-task-kubeconfig-creator.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: kubeconfig-creator
spec:
params:
- name: name
description: name of the cluster
type: string
- name: url
description: address of the cluster
type: string
- name: username
description: username for basic authentication to the cluster
type: string
- name: password
description: password for basic authentication to the cluster
type: string
default: ""
- name: cadata
description: contains PEM-encoded certificate authority certificates
type: string
default: ""
- name: clientKeyData
description: contains PEM-encoded data from a client key file for TLS
type: string
default: ""
- name: clientCertificateData
description: contains PEM-encoded data from a client cert file for TLS
type: string
default: ""
- name: namespace
description: default namespace to use on unspecified requests
type: string
default: ""
- name: token
description: bearer token for authentication to the cluster
type: string
default: ""
- name: insecure
description: to indicate server should be accessed without verifying the TLS certificate
type: string
default: "false"
workspaces:
- name: output
steps:
- name: write
image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/kubeconfigwriter:latest
command: ["/ko-app/kubeconfigwriter"]
args:
# passing the required json in the form of string to generate the kubeconfig file.
#
- -clusterConfig
- '{
"name":"$(params.name)",
"url":"$(params.url)",
"username":"$(params.username)",
"password":"$(params.password)",
"cadata":"$(params.cadata)",
"clientKeyData":"$(params.clientKeyData)",
"clientCertificateData":"$(params.clientCertificateData)",
"namespace":"$(params.namespace)",
"token":"$(params.token)",
"Insecure":$(params.insecure)
}'
# path to the destination directory, where kubeconfig file will be stored.
- -destinationDir
- '$(workspaces.output.path)'