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
Copy file name to clipboardexpand all lines: README.md
+8
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ reference which matches at least one match rule and none of the exclusion rules,
44
44
by the `replace` contents of the rule. If `checkUpstream` is enabled, the webhook will first fetch the manifest
45
45
the rewritten container image reference and verify it exists before rewriting the image.
46
46
47
+
You can also update the `imagePullSecrets` of a modified pod to have the right docker secret to connect to the modified registry. For that, put `replaceImagePullSecrets` to `true` and be sure that `authSecretName` is set with the Kubernetes secret that you want to add to `imagePullSecrets`. If `imagePullSecrets` already contains a secret, the `authSecretName` will be added to the list anyway.
48
+
47
49
Example configuration:
48
50
```yaml
49
51
port: 9443
@@ -67,6 +69,12 @@ rules:
67
69
replace: 'harbor.example.com/ubuntu-proxy'
68
70
checkUpstream: true # tests if the manifest for the rewritten image exists
69
71
authSecretName: harbor-example-image-pull-secret # optional, defaults to "" - secret in the webhook namespace for authenticating to harbor.example.com
72
+
- name: 'docker.io rewrite rule with imagePullSecrets update'
73
+
matches:
74
+
- '^docker.io'
75
+
replace: 'harbor.example.com/dockerhub-proxy'
76
+
replaceImagePullSecrets: true # enable imagePullSecrets change for modified images
77
+
authSecretName: harbor-example-image-pull-secret # secret to add to imagePullSecrets on the modified pod
0 commit comments