Skip to content

Commit 9d9bc14

Browse files
author
Bohan Chen
committed
add docs for blob auth
Signed-off-by: Bohan Chen <bohanc@vmware.com>
1 parent 2a51389 commit 9d9bc14

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

docs/build.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ The `source` field is a composition of a source code location and a `subpath`. I
9595
- `git`: (Source Code is a git repository)
9696
- `url`: The git repository url. Both https and ssh formats are supported; with ssh format requiring a [ssh secret](secrets.md#git-secrets).
9797
- `revision`: The git revision to use. This value may be a commit sha, branch name, or tag.
98+
- `auth`: Optional auth to use with blob source. Leave empty for no auth, "secret" for providing auth [via Secret](secrets.md#blob-secrets), or "helper" to use service account IAM (specific to each IaaS).
99+
> Note: Only [Microsoft Azure](https://learn.microsoft.com/en-us/azure/aks/workload-identity-overview)
100+
> and [Google Cloud Platform](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#kubernetes-sa-to-iam)
101+
> helpers are currently implemented, contributions are welcome to `pkg/blob/<iaas>_keychain.go`.
98102
- `subPath`: A subdirectory within the source folder where application code resides. Can be ignored if the source code resides at the `root` level.
99103

100104
* Blob

docs/image.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,16 @@ The `source` field is a composition of a source code location and a `subpath`. I
9999
blob:
100100
url: ""
101101
stripComponents: 0
102+
auth: "" | "secret" | "helper"
102103
subPath: ""
103104
```
104105
- `blob`: (Source Code is a blob/jar in a blobstore)
105106
- `url`: The URL of the source code blob. This blob needs to either be publicly accessible or have the access token in the URL
106107
- `stripComponents`: Optional number of directory components to strip from the blobs content when extracting.
108+
- `auth`: Optional auth to use with blob source. Leave empty for no auth, "secret" for providing auth [via Secret](secrets.md#blob-secrets), or "helper" to use service account IAM (specific to each IaaS).
109+
> Note: Only [Microsoft Azure](https://learn.microsoft.com/en-us/azure/aks/workload-identity-overview)
110+
> and [Google Cloud Platform](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#kubernetes-sa-to-iam)
111+
> helpers are currently implemented, contributions are welcome to `pkg/blob/<iaas>_keychain.go`.
107112
- `subPath`: A subdirectory within the source folder where application code resides. Can be ignored if the source code resides at the `root` level.
108113

109114
* Registry

docs/secrets.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,26 @@ stringData:
126126
password: <generated-token>
127127
```
128128

129+
### Blob Secrets
130+
131+
Secrets are used with a `kpack.io/blob` annotation that references a hostname for a blob location. Only one of username/password, bearer, or authorization is allowed.
132+
133+
```yaml
134+
apiVersion: v1
135+
kind: Secret
136+
metadata:
137+
name: blob-secret
138+
annotations:
139+
kpack.io/blob: my-blob-store.com
140+
stringData:
141+
username: <username>
142+
password: <password>
143+
144+
bearer: <oauth2 token>
145+
146+
authorization: <third-party-auth-header>
147+
```
148+
129149
### Service Account
130150

131151
To use these secrets with kpack create a service account and reference the service account in image and build resources. When configuring the image resource, reference the `name` of your registry credential and the `name` of your git credential.

0 commit comments

Comments
 (0)