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
ImageShift normalizes registry names to handle aliases. For example:
245
+
246
+
-`docker.io` is equivalent to `index.docker.io` (Docker Hub's canonical name)
247
+
- Images without a registry prefix (e.g., `nginx:latest`) use the `spec.default` registry
248
+
249
+
This means you can use `docker.io` in your swap rules and it will match images specified as either `docker.io/nginx` or `nginx` (when default is `docker.io`).
Copy file name to clipboardExpand all lines: docs/docs/reference/crd.md
+73-15Lines changed: 73 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,9 @@ The Imageshift resource defines image mapping rules that are applied to pods cre
22
22
23
23
| Field | Type | Default | Description |
24
24
|-------|------|---------|-------------|
25
-
|`spec.default`| string |`"docker.io"`| The default registry for images without an explicit registry |
26
-
|`spec.namespaceSelector`| string |`"imageshift.dev"`| The label key used to identify namespaces for image swapping |
25
+
|`spec.default`| string |`"docker.io"`| The default registry assumed for images without an explicit registry prefix (e.g., `nginx` becomes `docker.io/library/nginx`) |
26
+
|`spec.namespaceSelector`| string |`"imageshift.dev"`| Reserved for future use. Currently ignored - namespaces must use label `imageshift.dev=enabled`|
27
+
|`spec.enforceExistingPods`| boolean |`false`| When enabled, the controller will delete pods that have images not matching the swap rules, forcing pod recreation with correct images |
27
28
|`spec.mappings`| object || Container for all mapping rules |
By default, ImageShift only mutates pods at creation time via the admission webhook. Pods that already exist when ImageShift is installed or when rules are changed will not be affected.
161
+
162
+
To enforce image swap rules on existing pods, enable the `enforceExistingPods` field:
163
+
164
+
```yaml
165
+
apiVersion: imageshift.dev/v1
166
+
kind: Imageshift
167
+
metadata:
168
+
name: imageshift
169
+
spec:
170
+
enforceExistingPods: true
171
+
mappings:
172
+
swap:
173
+
- registry: docker.io
174
+
target: registry.internal.example.com/dockerhub
175
+
```
158
176
159
-
ImageShift only processes pods in namespaces that have the selector label set to `enabled`.
177
+
:::warning
178
+
**This is a disruptive operation.** When enabled, the controller will **delete** any pods in labeled namespaces that have images not matching the current swap rules. This forces the pods to be recreated by their controllers (Deployment, StatefulSet, etc.) with the correct images applied by the webhook.
160
179
161
-
Default selector label: `imageshift.dev=enabled`
180
+
Only enable this feature when you understand the impact:
181
+
- Pods will be deleted and recreated
182
+
- Stateless workloads managed by controllers will recover automatically
183
+
- Standalone pods (not managed by a controller) will be permanently deleted
184
+
- Brief service interruptions may occur during pod recreation
185
+
:::
186
+
187
+
## Namespace Selection
188
+
189
+
ImageShift only processes pods in namespaces that have the label `imageshift.dev=enabled`.
0 commit comments