Skip to content

Commit de9bd79

Browse files
author
Kasem Alem
committed
fix(KONFLUX-5917): adding tekton example of using secret
Signed-off-by: Kasem Alem <[email protected]>
1 parent 87185fb commit de9bd79

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

docs/modules/ROOT/pages/how-tos/configuring/creating-secrets.adoc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ NOTE: One such task is the link:https://github.com/konflux-ci/build-definitions/
3030
. Optional: Under **Labels**, add a label to tag or provide more context for your secret.
3131
. Click **Add secret**.
3232

33+
=== Notable task input secrets
34+
35+
* xref:/how-tos/configuring/activation-keys-subscription.adoc#adding-activation-keys-to-the-workspace[activation-key]
36+
* xref:/how-tos/configuring/prefetching-dependencies.adoc#creating-the-netrc-secret[netrc]
37+
* xref:/how-tos/testing/build/snyk.adoc[snyk-secret]
38+
* xref:/how-tos/testing/integration/third-parties/testing-farm.adoc[testing-farm-secret]
39+
3340
== Creating registry pull secrets
3441

3542
Some container builds may use parent images from registries that require authentication, for example, `registry.redhat.io`. Until these credentials have been configured, the builds will continue to fail due to the system being unable to pull the required images.
@@ -47,6 +54,61 @@ Some container builds may use parent images from registries that require authent
4754
. Enter the password for the registry in **Password**.
4855
. Click **Add secret**.
4956

57+
== Example of creating a quay.io secret
58+
. Login to Konflux console your workspace (https://console.redhat.com/application-pipeline/workspaces/<your workspace>/applications)
59+
. Click on `Secrets` on the left menu.
60+
. Click on `Add Secret`
61+
. Choose `Image pull secret` for `Secret type`
62+
. Enter `Secret name` , for example `my-quay-secret`
63+
. Choose `Image registry credentials` in `Authentication type` field
64+
. Enter `quay.io` in `Registry server address`
65+
. Enter your Quay.io username in `Username`
66+
. Enter your Quay.io API token in `Password` field.
67+
. Click on `Add secret`
68+
. Email is optional
69+
70+
Once all is information is valid and adding secret successful you can see it appears in the secrets list,
71+
Here is the yaml file of the secret looks like:
72+
73+
74+
[source,yaml]
75+
----
76+
apiVersion: v1
77+
data:
78+
.dockerconfigjson: <your base64 generated token>
79+
kind: Secret
80+
metadata:
81+
creationTimestamp: "2025-01-28T17:45:04Z"
82+
name: my-quay-secret
83+
namespace: <your workspace- tenant>
84+
resourceVersion: "3088423929"
85+
uid: 4af266b0-c63a-4aed-b808-a29cbd0cadfe
86+
type: kubernetes.io/dockerconfigjson
87+
88+
----
89+
90+
In below an example how to use the secret within a Tekton task
91+
92+
[source, yaml]
93+
----
94+
apiVersion: tekton.dev/v1beta1
95+
kind: TaskRun
96+
metadata:
97+
name: build-container
98+
spec:
99+
taskRef:
100+
name: build-container
101+
params:
102+
- name: image
103+
value: quay.io/my-image:latest
104+
workspaces:
105+
- name: source
106+
subPath: src
107+
volumes:
108+
- name: registry-credentials
109+
secret:
110+
secretName: my-quay-secret
111+
----
50112

51113
[NOTE]
52114
====

0 commit comments

Comments
 (0)