Skip to content

Commit 1a90895

Browse files
authored
Merge pull request #87565 from Greenie0506/devspaces-private-docker-image
Edit format
2 parents e246a50 + 2ef4811 commit 1a90895

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

articles/dev-spaces/troubleshooting.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,4 +449,41 @@ Resource requests and limits can be applied for the injected container (devspace
449449
Below is an example of a proxy-resources annotation that is to be applied to your pod spec.
450450
```
451451
azds.io/proxy-resources: "{\"Limits\": {\"cpu\": \"300m\",\"memory\": \"400Mi\"},\"Requests\": {\"cpu\": \"150m\",\"memory\": \"200Mi\"}}"
452-
```
452+
```
453+
454+
## Error "unauthorized: authentication required" when trying to use a Docker image from a private registry
455+
456+
### Reason
457+
458+
You are using a Docker image from a private registry that requires authentication. You can allow Dev Spaces to authenticate and pull images from this private registry using [imagePullSecrets](https://kubernetes.io/docs/concepts/configuration/secret/#using-imagepullsecrets).
459+
460+
### Try
461+
462+
To use imagePullSecrets, [create a Kubernetes secret](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) in the namespace where you are using the image. Then provide the secret as an imagePullSecret in `azds.yaml`.
463+
464+
Below is an example of a specifying imagePullSecrets in `azds.yaml`.
465+
466+
```
467+
kind: helm-release
468+
apiVersion: 1.1
469+
build:
470+
context: $BUILD_CONTEXT$
471+
dockerfile: Dockerfile
472+
install:
473+
chart: $CHART_DIR$
474+
values:
475+
- values.dev.yaml?
476+
- secrets.dev.yaml?
477+
set:
478+
# Optional, specify an array of imagePullSecrets. These secrets must be manually created in the namespace.
479+
# This will override the imagePullSecrets array in values.yaml file.
480+
# If the dockerfile specifies any private registry, the imagePullSecret for the registry must be added here.
481+
# ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
482+
#
483+
# This uses credentials from secret "myRegistryKeySecretName".
484+
imagePullSecrets:
485+
- name: myRegistryKeySecretName
486+
```
487+
488+
> [!IMPORTANT]
489+
> Setting imagePullSecrets in `azds.yaml` will override imagePullSecrets specified in the `values.yaml`.

0 commit comments

Comments
 (0)