Skip to content

Commit 057b20a

Browse files
author
edge-katanomi-app2[bot]
committed
📚 Sync docs from alaudadevops/tektoncd-operator on 8a3f353144032a9bbfd79e96c4eb283e5a39ec38
Source: chore: [DEVOPS-41997] optimize tutorials docs (#499) Author: yzc Ref: refs/heads/main Commit: 8a3f353144032a9bbfd79e96c4eb283e5a39ec38 This commit automatically syncs documentation changes from the source-docs repository. 🔗 View source commit: https://github.com/alaudadevops/tektoncd-operator/commit/8a3f353144032a9bbfd79e96c4eb283e5a39ec38 🤖 Synced on 2025-09-08 07:41:41 UTC
1 parent 8638bfa commit 057b20a

File tree

6 files changed

+260
-3
lines changed

6 files changed

+260
-3
lines changed

‎.github/SYNC_INFO.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Documentation Sync Information
22

3-
- **Last synced**: 2025-09-08 06:52:41 UTC
3+
- **Last synced**: 2025-09-08 07:41:41 UTC
44
- **Source repository**: alaudadevops/tektoncd-operator
5-
- **Source commit**: [aa62cd3643ab32076cc1766dc27930d29accf05d](https://github.com/alaudadevops/tektoncd-operator/commit/aa62cd3643ab32076cc1766dc27930d29accf05d)
5+
- **Source commit**: [8a3f353144032a9bbfd79e96c4eb283e5a39ec38](https://github.com/alaudadevops/tektoncd-operator/commit/8a3f353144032a9bbfd79e96c4eb283e5a39ec38)
66
- **Triggered by**: edge-katanomi-app2[bot]
7-
- **Workflow run**: [#50](https://github.com/alaudadevops/tektoncd-operator/actions/runs/17542358278)
7+
- **Workflow run**: [#51](https://github.com/alaudadevops/tektoncd-operator/actions/runs/17543499345)
88

99
## Files synced:
1010
- docs/

‎docs/en/tutorials/helm/deploy_or_upgrade_by_helm_chart_in_git_repo.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ spec:
188188
- name: source
189189
volumeClaimTemplate:
190190
spec:
191+
## Specify StorageClassName (as needed)
192+
# storageClassName: <storage-class-name>
191193
accessModes:
192194
- ReadWriteOnce
193195
resources:

‎docs/en/tutorials/helm/package_and_push_helm_chart.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ spec:
177177
- name: source
178178
volumeClaimTemplate:
179179
spec:
180+
## Specify StorageClassName (as needed)
181+
# storageClassName: <storage-class-name>
180182
accessModes:
181183
- ReadWriteOnce
182184
resources:

‎docs/en/tutorials/introduction.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following summarizes the operational practices of common application scenari
2929
| [Package & Push a Helm Chart to an OCI Registry](./helm/package_and_push_helm_chart.mdx) | This tutorial introduces how to package and push a Helm Chart to an OCI Registry. |
3030
| [Prepare Cluster Access Credential](./prepare/prepare_cluster_access_credential.mdx) | This tutorial introduces how to prepare cluster access credential for Task and Pipeline. |
3131
| [Prepare Registry Credential](./prepare/prepare_registry_credential.mdx) | This tutorial introduces how to prepare registry credential for Task and Pipeline. |
32+
| [Prepare Git Credential](./prepare/prepare_git_credential.mdx) | This tutorial introduces how to prepare git credential for Task and Pipeline. |
3233
| [Discover Tool Image](./prepare/discover_tool_image.mdx) | This tutorial introduces how to prepare tool image for Task and Pipeline. |
3334

3435

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
---
2+
weight: 50
3+
---
4+
5+
# Prepare Git Credential
6+
7+
This guide shows you how to create a git credential Secret that help you run your Tekton Tasks and Pipelines.
8+
9+
This document will use the configuration of a `git-clone` Task as an example.
10+
If you are using a different Task, you can refer to the steps here and modify the `taskRef.name` and `workspaces` to match those defined in your Task.
11+
12+
## Prerequisites
13+
14+
- kubectl installed and configured to access the cluster.
15+
- Permissions to read and write Secrets.
16+
17+
## Steps
18+
19+
### Optional 1: Using ssh Credentials
20+
21+
This Task supports fetching private repositories. There are three ways to
22+
authenticate:
23+
24+
1. The simplest approach is to bind an `ssh-directory` workspace to this
25+
Task. The workspace should contain private keys (e.g. `id_rsa`), `config`
26+
and `known_hosts` files - anything you need to interact with your git remote
27+
via SSH. It's **strongly** recommended that you use Kubernetes `Secrets` to
28+
hold your credentials and bind to this workspace.
29+
30+
In a TaskRun that would look something like this:
31+
32+
```yaml
33+
kind: TaskRun
34+
spec:
35+
workspaces:
36+
- name: ssh-directory
37+
secret:
38+
secretName: my-ssh-credentials
39+
```
40+
41+
And in a Pipeline and PipelineRun it would look like this:
42+
43+
```yaml
44+
kind: Pipeline
45+
spec:
46+
workspaces:
47+
- name: ssh-creds
48+
# ...
49+
tasks:
50+
- name: fetch-source
51+
taskRef:
52+
name: git-clone
53+
workspaces:
54+
- name: ssh-directory
55+
workspace: ssh-creds
56+
# ...
57+
---
58+
kind: PipelineRun
59+
spec:
60+
workspaces:
61+
- name: ssh-creds
62+
secret:
63+
secretName: my-ssh-credentials
64+
# ...
65+
```
66+
67+
The `Secret` would appear the same in both cases - structured like a `.ssh`
68+
directory:
69+
70+
```yaml
71+
kind: Secret
72+
apiVersion: v1
73+
metadata:
74+
name: my-ssh-credentials
75+
data:
76+
id_rsa: # ... base64-encoded private key ...
77+
known_hosts: # ... base64-encoded known_hosts file ...
78+
config: # ... base64-encoded ssh config file ...
79+
```
80+
81+
Including `known_hosts` is optional but strongly recommended. Without it
82+
the `git-clone` Task will blindly accept the remote server's identity.
83+
84+
2. Another approach is to bind an `ssl-ca-directory` workspace to this
85+
Task. The workspace should contain crt keys (e.g. `ca-bundle.crt`)files - anything you need to interact with your git remote
86+
via custom CA . It's **strongly** recommended that you use Kubernetes `Secrets` to
87+
hold your credentials and bind to this workspace.
88+
89+
In a TaskRun that would look something like this:
90+
91+
```yaml
92+
kind: TaskRun
93+
spec:
94+
workspaces:
95+
- name: ssl-ca-directory
96+
secret:
97+
secretName: my-ssl-credentials
98+
```
99+
100+
And in a Pipeline and PipelineRun it would look like this:
101+
102+
```yaml
103+
kind: Pipeline
104+
spec:
105+
workspaces:
106+
- name: ssl-creds
107+
# ...
108+
tasks:
109+
- name: fetch-source
110+
taskRef:
111+
name: git-clone
112+
workspaces:
113+
- name: ssl-ca-directory
114+
workspace: ssl-creds
115+
# ...
116+
---
117+
kind: PipelineRun
118+
spec:
119+
workspaces:
120+
- name: ssl-creds
121+
secret:
122+
secretName: my-ssl-credentials
123+
# ...
124+
```
125+
126+
The `Secret` would appear like below:
127+
128+
```yaml
129+
kind: Secret
130+
apiVersion: v1
131+
metadata:
132+
name: my-ssl-credentials
133+
data:
134+
ca-bundle.crt: # ... base64-encoded crt ... # If key/filename is other than ca-bundle.crt then set crtFileName param as explained under Parameters section
135+
```
136+
137+
### Optional 2: Using basic-auth Credentials
138+
139+
**Note**: It is strongly advised that you use `ssh` credentials when the option
140+
is available to you before using basic auth. You can generate a short
141+
lived token from WebVCS platforms (Github, Gitlab, Bitbucket etc..) to be used
142+
as a password and generally be able to use `git` as the username.
143+
On bitbucket server the token may have a / into it so you would need
144+
to urlquote them before in the `Secret`, see this stackoverflow answer :
145+
146+
https://stackoverflow.com/a/24719496
147+
148+
To support basic-auth this Task exposes an optional `basic-auth` Workspace.
149+
The bound Workspace should contain a `.gitconfig` or `.git-credentials` file.
150+
Any other files on this Workspace are ignored. A typical `Secret` containing
151+
these credentials looks as follows:
152+
153+
```yaml
154+
kind: Secret
155+
apiVersion: v1
156+
metadata:
157+
name: my-basic-auth-secret
158+
type: Opaque
159+
stringData:
160+
.gitconfig: |
161+
[credential "https://<hostname>"]
162+
helper = store
163+
.git-credentials: |
164+
https://<user>:<pass>@<hostname>
165+
```
166+
167+
### Optional 3: Using Git Connector
168+
169+
The task can be used with Git Connector to enhance security.
170+
171+
You need to create the Git Connector first, then in the TaskRun, use [CSI](https://tekton.dev/docs/pipelines/workspaces/#csi) to configure the `basic-auth` workspace.
172+
173+
Git Connector currently only supports cloning with basic-auth, not with ssh.
174+
175+
Here is an example of how to use Git Connector in git-clone TaskRun:
176+
177+
**Create Git Connector**
178+
179+
``` bash
180+
cat <<EOF | kubectl apply -f -
181+
kind: Secret
182+
apiVersion: v1
183+
metadata:
184+
name: github
185+
type: kubernetes.io/basic-auth
186+
stringData:
187+
username: your-username # Replace with your Git username
188+
password: your-token # Replace with your Git password or token
189+
---
190+
apiVersion: connectors.alauda.io/v1alpha1
191+
kind: Connector
192+
metadata:
193+
name: github
194+
spec:
195+
connectorClassName: git
196+
address: https://github.com # Replace with your Git server address
197+
auth:
198+
name: basicAuth
199+
secretRef:
200+
name: github
201+
params:
202+
- name: repository
203+
value: your-org/your-repo.git # Replace with your repository path which could access by your token, this is used for health check
204+
EOF
205+
```
206+
207+
**Create TaskRun**
208+
209+
``` bash
210+
cat << EOF | kubectl apply -f -
211+
apiVersion: tekton.dev/v1
212+
kind: TaskRun
213+
metadata:
214+
name: git-clone-demo
215+
spec:
216+
params:
217+
- name: url
218+
value: https://github.com/your-org/your-repo.git # Replace with your repository path which you want to clone
219+
- name: revision
220+
value: refs/heads/main
221+
taskRef:
222+
name: git-clone
223+
timeout: 10m0s
224+
computeResources:
225+
limits:
226+
cpu: 200m
227+
memory: 200Mi
228+
requests:
229+
cpu: 200m
230+
memory: 200Mi
231+
workspaces:
232+
- name: output
233+
emptyDir: {}
234+
- csi:
235+
driver: connectors-csi
236+
readOnly: true
237+
volumeAttributes:
238+
connector.name: github # the name of the connector
239+
connector.namespace: "" # the namespace of the connector, if not specified, the same namespace as the TaskRun will be used
240+
configuration.names: "gitconfig" # the name of the configuration, which is fixed as "gitconfig"
241+
name: basic-auth
242+
EOF
243+
```
244+
245+
More about Connector, please refer to <ExternalSiteLink name="connectors" href="/" children="Alauda DevOps Connectors Doc" />.
246+
247+
- <ExternalSiteLink name="connectors" href="/connectors/how_to/create_scoped_connectors.html" children="How to Create Connector Resources at Different Levels" />
248+
- <ExternalSiteLink name="connectors" href="/connectors/concepts/connector_scope_permissions.html" children="Connector Resource Levels and Permissions" />
249+
- <ExternalSiteLink name="connectors" href="/connectors-git/functions/using-in-tekton-task" children="Using Git Connector in Tekton Task" />

‎sites.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
- name: postgresql
55
base: /postgresql
66
version: "4.0"
7+
- name: connectors
8+
base: /alauda-devops-connectors
9+
version: "1.2"

0 commit comments

Comments
 (0)