- Configuring a Push Secret for the Build Pipeline
- Configuring a Push Secret for the Release Pipeline
- Automatically Provision Quay Repositories for Container Images
After the build-pipeline builds an image, it will try to push it to a container registry. If using a registry that requires authentication, the namespace where the pipeline is running should be configured with a push secret for the registry.
Tekton provides a way to inject push secrets into pipelines by attaching them to a service account.
The service account used for running the pipelines is the namespace's
appstudio-pipeline
service account.
- ⚙️ Create the secret in the pipeline's namespace (see the example below for extracting the secret):
Replace $NS with the correct namespace. For example:
- for user1, specify 'user-ns1'
- for user2, specify 'user-ns2'
- for managed1, specify 'managed-ns1'
- for managed2, specify 'managed-ns2'
kubectl create -n $NS secret generic regcred \
--from-file=.dockerconfigjson=<path/to/.docker/config.json> \
--type=kubernetes.io/dockerconfigjson
- ⚙️ Add the secret to the namespace's appstudio-pipeline service account
kubectl patch -n $NS serviceaccount appstudio-pipeline -p '{"secrets": [{"name": "regcred"}]}'
If using Quay.io, you can follow the procedure below to obtain the config.json file used for creating the secret. If not using quay, apply your registry's equivalent procedure.
-
⚙️ Log into quay.io and click your user icon on the top-right corner.
-
⚙️ Select Account Settings.
-
⚙️ Click on Generate Encrypted Password.
-
⚙️ Enter your login password and click Verify.
-
⚙️ Select Docker Configuration.
-
⚙️ Click Download
<your-username>-auth.json
and take note of the download location. -
⚙️ Replace
<path/to/.docker/config.json>
on thekubectl create secret
command with this path.
If the release pipeline needs to push images to a container registry, it needs to be configured with a push secret as well.
⚙️ In the managed
namespace, repeat the same steps mentioned
above for configuring the push
secret.
Note: This step is mandatory for importing components using the UI.
Konflux integrates with the Image Controller that can automatically create Quay repositories when onboarding a component. The image controller requires access to a Quay organization. Please follow the following steps for configuring it:
-
⚙️ Create Application and OAuth access token. The application should have the following permissions:
- Administer Organization
- Administer Repositories
- Create Repositories
-
⚙️ Run the
deploy-image-controller.sh
script:
$TOKEN
- the token for the application you've created on step 3.
$ORGANIZATION
- the name of the organization you created on step 2.
./deploy-image-controller.sh $TOKEN $ORGANIZATION