You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following document provides an introduction around the different authentication methods that can take place during an image build when using the Build operator.
-[Authentication for Git](#authentication-for-git)
13
14
-[Basic authentication](#basic-authentication)
14
15
-[SSH authentication](#ssh-authentication)
@@ -20,7 +21,32 @@ The following document provides an introduction around the different authenticat
20
21
21
22
## Overview
22
23
23
-
There are two places where users might need to define authentication when building images. Authentication to a container registry is the most common one, but also users might have the need to define authentications for pulling source-code from Git.
24
+
There are two places where users might need to define authentication when building images. Authentication to a container registry is the most common one, but also users might have the need to define authentications for pulling source-code from Git. Overall, the authentication is done via the definion of [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) in which the require sensitive data will be stored.
25
+
26
+
## Build Secrets Annotation
27
+
28
+
Users need to add an annotation `build.build.dev/referenced.secret: "true"` to a build secret so that build controller can decide to take a reconcile action when a secret event (`create`, `update` and `delete`) happens. Below is a secret example with build annotation:
29
+
30
+
```yaml
31
+
apiVersion: v1
32
+
data:
33
+
.dockerconfigjson: xxxxx
34
+
kind: Secret
35
+
metadata:
36
+
annotations:
37
+
build.build.dev/referenced.secret: "true"
38
+
name: secret-docker
39
+
type: kubernetes.io/dockerconfigjson
40
+
```
41
+
42
+
This annotation will help us filter secrets which are not referenced on a Build instance. That means if a secret doesn't have this annotation, then although event happens on this secret, Build controller will not reconcile. Being able to reconcile on secrets events allow the Build controller to re-trigger validations on the Build configuration, allowing users to understand if a dependency is missing.
43
+
44
+
If you are using `kubectl` command create secrets, then you can first create build secret using `kubectl create secret` command and annotate this secret using `kubectl annotate secrets`. Below is an example:
_Notes:_ When generating a secret to access docker hub, the `REGISTRY_HOST` value should be `https://index.docker.io/v1/`, the username is the Docker ID.
0 commit comments