Skip to content

Commit edab81c

Browse files
aDisplayNamekppullinplaffittdependabot[bot]felipewnp
authored
Sync local Release with remote release enix/kube-image-keeper (#19)
* fix: http connection leak in NewBearer() The `response.Body` for the first `http.Get()` call in `NewBearer()` is not closed. This leaks connections to the `registry` server and can result in substantial memory usage in the `registry`, as the registry allocates a 4MB buffer for each connection and neither end enforces an idle timeout. Fixes enix#378 * fix: repository LastUpdate status wasn't updated * fix: cachedimages with non-nil expiresAt where not updated * build(deps): bump github.com/google/go-containerregistry Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.20.1 to 0.20.2. - [Release notes](https://github.com/google/go-containerregistry/releases) - [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml) - [Commits](google/go-containerregistry@v0.20.1...v0.20.2) --- updated-dependencies: - dependency-name: github.com/google/go-containerregistry dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/onsi/ginkgo/v2 from 2.19.1 to 2.20.0 Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.19.1 to 2.20.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v2.19.1...v2.20.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(helm): generate README.md.gotmpl in CI * fix(controller): re-enable some metrics disabled by mistake * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.19.1 to 1.20.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.19.1...v1.20.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.1.1+incompatible to 27.1.2+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](moby/moby@v27.1.1...v27.1.2) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 27.1.1+incompatible to 27.1.2+incompatible. - [Commits](docker/cli@v27.1.1...v27.1.2) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/onsi/ginkgo/v2 from 2.20.0 to 2.20.1 Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.20.0 to 2.20.1. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v2.20.0...v2.20.1) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.0 to 1.20.2. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.20.0...v1.20.2) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: ignore pod patching failures during startup * docs(readme): uninstall procedure * fix: replace unmaintained parabuzzle/craneoperator with joxit/docker-registry-ui * docs: fixing registry.garbageCollectionSchedule parameter and some typos * feat(helm): add resources for garbage collector cronjob * feat(helm): add nodeSelector to GC pod * build(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.1.2+incompatible to 27.2.0+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](moby/moby@v27.1.2...v27.2.0) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * docs: add description to crds fields in order to provide better explain messages within kubectl * docs: add documentation about handling mutable tags * build(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 27.1.2+incompatible to 27.2.0+incompatible. - [Commits](docker/cli@v27.1.2...v27.2.0) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/onsi/ginkgo/v2 from 2.20.1 to 2.20.2 Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.20.1 to 2.20.2. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v2.20.1...v2.20.2) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/onsi/gomega from 1.34.1 to 1.34.2 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.34.1 to 1.34.2. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](onsi/gomega@v1.34.1...v1.34.2) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * feat(helm): add customizable garbage collection deadline * build(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.2.0+incompatible to 27.3.1+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](moby/moby@v27.2.0...v27.3.1) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.4. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.20.2...v1.20.4) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump go.uber.org/automaxprocs from 1.5.3 to 1.6.0 Bumps [go.uber.org/automaxprocs](https://github.com/uber-go/automaxprocs) from 1.5.3 to 1.6.0. - [Release notes](https://github.com/uber-go/automaxprocs/releases) - [Changelog](https://github.com/uber-go/automaxprocs/blob/master/CHANGELOG.md) - [Commits](uber-go/automaxprocs@v1.5.3...v1.6.0) --- updated-dependencies: - dependency-name: go.uber.org/automaxprocs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 27.2.0+incompatible to 27.3.1+incompatible. - [Commits](docker/cli@v27.2.0...v27.3.1) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump aquasecurity/trivy-action from 0.24.0 to 0.25.0 Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.24.0 to 0.25.0. - [Release notes](https://github.com/aquasecurity/trivy-action/releases) - [Commits](aquasecurity/trivy-action@0.24.0...0.25.0) --- updated-dependencies: - dependency-name: aquasecurity/trivy-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * ci: add joxit chart repo * refactor(helm): remove trailing space in values.yaml for linting --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kevin Pullin <kevin.pullin@gmail.com> Co-authored-by: Paul Laffitte <paul.laffitte@enix.fr> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Felipe Pereira <felipewnp@gmail.com> Co-authored-by: David Donchez <david.donchez@enix.fr> Co-authored-by: Jan-Philipp Ottmüller <j.ottmueller@gmail.com>
1 parent 5fe3ef2 commit edab81c

27 files changed

+337
-602
lines changed

.github/workflows/pr-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
set -euo pipefail
3434
ct lint --chart-dirs deploy/charts --target-branch ${{ github.base_ref }} \
35-
--validate-maintainers=false --check-version-increment=false
35+
--validate-maintainers=false --check-version-increment=false
3636
3737
# FIXME
3838
#- name: Create KinD cluster

.github/workflows/pr-security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/checkout@v4
3232

3333
- name: Run Trivy vulnerability scanner
34-
uses: aquasecurity/trivy-action@0.24.0
34+
uses: aquasecurity/trivy-action@0.25.0
3535
with:
3636
scan-type: 'fs'
3737
ignore-unfixed: true

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
ct lint \
111111
--charts helm/kube-image-keeper \
112112
--chart-repos bitnami=https://charts.bitnami.com/bitnami \
113+
--chart-repos joxit=https://helm.joxit.dev \
113114
--validate-maintainers=false --check-version-increment=false
114115
115116
build:
@@ -219,6 +220,7 @@ jobs:
219220
ct lint \
220221
--charts helm/kube-image-keeper \
221222
--chart-repos bitnami=https://charts.bitnami.com/bitnami \
223+
--chart-repos joxit=https://helm.joxit.dev \
222224
--validate-maintainers=false --check-version-increment=false
223225
224226
- name: Run helm (install)
@@ -351,6 +353,7 @@ jobs:
351353
ct lint \
352354
--charts helm/kube-image-keeper \
353355
--chart-repos bitnami=https://charts.bitnami.com/bitnami \
356+
--chart-repos joxit=https://helm.joxit.dev \
354357
--validate-maintainers=false --check-version-increment=false
355358
356359
- name: Run helm (install latest release)
@@ -562,6 +565,7 @@ jobs:
562565
- name: Helm repository deps
563566
run: |
564567
helm repo add bitnami https://charts.bitnami.com/bitnami
568+
helm repo add joxit https://helm.joxit.dev
565569
566570
- name: Set up Docker Buildx
567571
uses: docker/setup-buildx-action@v3
@@ -814,6 +818,7 @@ jobs:
814818
815819
header('generate chart readme')
816820
821+
run('make', '-C', '../../', 'helm-docs')
817822
run(os.environ['HELM_DOCS_PATH'], '--dry-run')
818823
run(os.environ['HELM_DOCS_PATH'])
819824

.github/workflows/tests.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: webiny/action-conventional-commits@v1.3.0
2929

3030
- name: Run Trivy vulnerability scanner
31-
uses: aquasecurity/trivy-action@0.24.0
31+
uses: aquasecurity/trivy-action@0.25.0
3232
with:
3333
scan-type: 'fs'
3434
ignore-unfixed: true
@@ -129,6 +129,7 @@ jobs:
129129
ct lint \
130130
--charts helm/kube-image-keeper \
131131
--chart-repos bitnami=https://charts.bitnami.com/bitnami \
132+
--chart-repos joxit=https://helm.joxit.dev \
132133
--validate-maintainers=false --check-version-increment=false
133134
134135
# Need wait for the next release with flash --skip-clean-up
@@ -156,7 +157,7 @@ jobs:
156157
run: |
157158
set -euo pipefail
158159
kubectl create deploy nginx --image=nginx:stable-alpine --replicas=2
159-
kubectl rollout status deploy nginx
160+
kubectl rollout status deploy nginx
160161
kubectl wait deployment nginx --for condition=Available=True --timeout=30s
161162
echo "kubectl get cachedimage"
162163
kubectl get cachedimages
@@ -198,7 +199,7 @@ jobs:
198199
set -euo pipefail
199200
## Check for kuik's components metrics
200201
for component in proxy controllers
201-
do
202+
do
202203
echo "Testing $component metrics endpoint"
203204
for ip in $(kubectl get po -l "app.kubernetes.io/component=$component" -n kuik-system -o jsonpath='{range .items[*]}{.status.podIP}{"\n"}{end}')
204205
do
@@ -269,6 +270,7 @@ jobs:
269270
ct lint \
270271
--charts helm/kube-image-keeper \
271272
--chart-repos bitnami=https://charts.bitnami.com/bitnami \
273+
--chart-repos joxit=https://helm.joxit.dev \
272274
--validate-maintainers=false --check-version-increment=false
273275
274276
# Need wait for the next release with flash --skip-clean-up
@@ -306,7 +308,7 @@ jobs:
306308
run: |
307309
set -euo pipefail
308310
kubectl create deploy nginx --image=nginx:stable-alpine --replicas=2
309-
kubectl rollout status deploy nginx
311+
kubectl rollout status deploy nginx
310312
kubectl wait deployment nginx --for condition=Available=True --timeout=30s
311313
echo "kubectl get cachedimage"
312314
kubectl get cachedimages
@@ -348,7 +350,7 @@ jobs:
348350
set -euo pipefail
349351
## Check for kuik's components metrics
350352
for component in proxy controllers
351-
do
353+
do
352354
echo "Testing $component metrics endpoint"
353355
for ip in $(kubectl get po -l "app.kubernetes.io/component=$component" -n kuik-system -o jsonpath='{range .items[*]}{.status.podIP}{"\n"}{end}')
354356
do
@@ -374,4 +376,3 @@ jobs:
374376
fi
375377
done
376378
done
377-

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ zz_generated.*
2828

2929
# helm dependencies
3030
helm/**/charts/*.tgz
31+
32+
# generated helm README template
33+
helm/**/README.md.gotmpl

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ It saves the container images used by your pods in its own local registry so tha
1717
To follow Helm3 best pratices, we moved `cachedimage` and `repository` custom resources definition from the helm templates directory to the dedicated `crds` directory.
1818
This will cause the `cachedimage` CRD to be deleted during the 1.7.0 upgrade.
1919

20-
We advice you to uninstall your helm release, clean the remaining custom resources by removing their finalizer, then reinstall kuik in 1.7.0
20+
We advise you to uninstall your helm release, clean the remaining custom resources by removing their finalizer, and then reinstall kuik in 1.7.0
2121

2222
You may also recreate the custom resource definition right after the upgrade to 1.7.0 using
2323
```
2424
kubectl apply -f https://raw.githubusercontent.com/enix/kube-image-keeper/main/helm/kube-image-keeper/crds/cachedimage-crd.yaml
2525
kubectl apply -f https://raw.githubusercontent.com/enix/kube-image-keeper/main/helm/kube-image-keeper/crds/repository-crd.yaml
2626
```
2727

28-
2928
## Why and when is it useful?
3029

3130
At [Enix](https://enix.io/), we manage production Kubernetes clusters both for our internal use and for various customers; sometimes on premises, sometimes in various clouds, public or private. We regularly run into image availability issues, for instance:
@@ -94,7 +93,7 @@ web-8667899c97-89j2h localhost:7439/nginx
9493
web-8667899c97-fl54b localhost:7439/nginx
9594
```
9695

97-
The kuik controllers keep track of how many pods use a given image. When an image isn't used anymore, it is flagged for deletion, and removed one month later. This expiration delay can be configured. You can see kuik's view of your images by looking at the `CachedImages` custom resource:
96+
The kuik controllers keep track of how many pods use a given image. When an image isn't used anymore, it is flagged for deletion and removed one month later. This expiration delay can be configured. You can see kuik's view of your images by looking at the `CachedImages` custom resource:
9897

9998
```bash
10099
$ kubectl get cachedimages
@@ -166,6 +165,17 @@ kubectl create namespace kuik-system
166165
kubectl apply -f /tmp/kuik.yaml --namespace kuik-system
167166
```
168167

168+
## Uninstall kuik (whyyyy? 😢)
169+
170+
We are very proud of kube-image-keeper and we believe that it is an awesome project that should be used as often as possible. However, we understand that it may not fit your needs, that it may contain a bug that occurs only in some very peculiar circumstances or even that you're not sure about how and why to use it. In the 2 first cases, please [open an issue](https://github.com/enix/kube-image-keeper/issues/new), we will be very happy to address your issue or implement a new feature if we think it can make kuik better! In the case you're not sure how and why to use it, and assuming that you've already read the corresponding section of the readme, you can contact us at [contact@enix.fr](mailto:contact@enix.fr). If none of those solution made you happy, we're sad to let you go but here is the uninstall procedure:
171+
172+
- Disable rewriting of the pods by deleting the kuik mutating webhook.
173+
- Restart pods using cached images, or manually rewrite them, in order to stop using images from the kuik cache.
174+
- Delete kuik custom resources (`CachedImages` and `Repositories`).
175+
- Uninstall kuik helm chart.
176+
177+
It is very important to stop using images from kuik before uninstalling. Indeed, if some pods are configured with the `imagePullPolicy: Always` and `.controllers.webhook.ignorePullPolicyAlways` value of the helm chart is set to `false`, then, in a case of a restart of a container (for example in an OOM scenario), the pod would not be able to pull its image anymore and will go in the `ImagePullBackOff` error state until someone manually fix its image.
178+
169179
## Configuration and customization
170180

171181
If you want to change e.g. the expiration delay, the port number used by the proxy, enable persistence (with a PVC) for the registry cache... You can do that with standard Helm values.
@@ -242,7 +252,7 @@ No manual action is required when migrating an amd64-only cluster from v1.3.0 to
242252

243253
### Corporate proxy
244254

245-
To configure kuik to work behind a corporate proxy, you can set the well known `http_proxy` and `https_proxy` environment variables (upper and lowercase variant both works) through helm values `proxy.env` and `controllers.env` like shown below:
255+
To configure kuik to work behind a corporate proxy, you can set the well-known `http_proxy` and `https_proxy` environment variables (upper and lowercase variant both works) through helm values `proxy.env` and `controllers.env` like shown below:
246256

247257
```yaml
248258
controllers:
@@ -263,7 +273,7 @@ Be careful that both the proxy and the controllers need to access the kubernetes
263273

264274
### Insecure registries & self-signed certificates
265275

266-
In some cases, you may want to use images from self-hosted registries that are insecure (without TLS or with an invalid certificate for instance) or using a self-signed certificate. By default, kuik will not allow to cache images from those registries for security reasons, even though you configured your container runtime (e.g. Docker, containerd) to do so. However you can choose to trust a list of insecure registries to pull from using the helm value `insecureRegistries`. If you use a self-signed certificate you can store the root certificate authority in a secret and reference it with the helm value `rootCertificateAuthorities`. Here is an example of the use of those two values:
276+
In some cases, you may want to use images from self-hosted registries that are insecure (without TLS or with an invalid certificate for instance) or using a self-signed certificate. By default, kuik will not allow to cache images from those registries for security reasons, even though you configured your container runtime (e.g. Docker, containerd) to do so. However, you can choose to trust a list of insecure registries to pull from using the helm value `insecureRegistries`. If you use a self-signed certificate you can store the root certificate authority in a secret and reference it with the helm value `rootCertificateAuthorities`. Here is an example of the use of those two values:
267277

268278
```yaml
269279
insecureRegistries:
@@ -280,11 +290,11 @@ You can of course use as many insecure registries or root certificate authoritie
280290

281291
### Registry UI
282292

283-
For debugging reasons, it may be useful to be able to access the registry through an UI. This can be achieved by enabling the registry UI with the value `registryUI.enabled=true`. The UI will not be publicly available through an ingress, you will need to open a port-forward from port `80`. You can set a custom username and password with values `registryUI.auth.username` (default is `admin`) and `registryUI.auth.password` (empty by default).
293+
For debugging reasons, it may be useful to be able to access the registry through an UI. This can be achieved by enabling the registry UI with the value `docker-registry-ui.enabled=true`. The UI will not be publicly available through an ingress, you will need to open a port-forward from port `80`. For more information about the UI and how to configure it, please see https://artifacthub.io/packages/helm/joxit/docker-registry-ui.
284294

285295
## Garbage collection and limitations
286296

287-
When a CachedImage expires because it is not used anymore by the cluster, the image is deleted from the registry. However, since kuik uses [Docker's registry](https://docs.docker.com/registry/), this only deletes **reference files** like tags. It doesn't delete blobs, which account for most of the used disk space. [Garbage collection](https://docs.docker.com/registry/garbage-collection/) allows removing those blobs and free up space. The garbage collecting job can be configured to run thanks to the `registry.garbageCollectionSchedule` configuration in a cron-like format. It is disabled by default, because running garbage collection without persistence would just wipe out the cache registry.
297+
When a CachedImage expires because it is not used anymore by the cluster, the image is deleted from the registry. However, since kuik uses [Docker's registry](https://docs.docker.com/registry/), this only deletes **reference files** like tags. It doesn't delete blobs, which account for most of the used disk space. [Garbage collection](https://docs.docker.com/registry/garbage-collection/) allows removing those blobs, freeing up space. The garbage collecting job can be configured to run thanks to the `registry.garbageCollection.schedule` configuration in a cron-like format. It is disabled by default, because running garbage collection without persistence would just wipe out the cache registry.
288298

289299
Garbage collection can only run when the registry is read-only (or stopped), otherwise image corruption may happen. (This is described in the [registry documentation](https://docs.docker.com/registry/garbage-collection/).) Before running garbage collection, kuik stops the registry. During that time, all image pulls are automatically proxified to the source registry so that garbage collection is mostly transparent for cluster nodes.
290300

@@ -320,18 +330,18 @@ Imagine the following scenario:
320330
- pods A and B use a private image, `example.com/myimage:latest`
321331
- pod A correctly references `imagePullSecrets, but pod B does not
322332

323-
On a normal Kubernetes cluster (without kuik), if pods A and B are on the same node, then pod B will run correctly, even though it doesn't reference `imagePullSecrets`, because the image gets pulled when starting pod A, and once it's available on the node, any other pod can use it. However, if pods A and B are on different nodes, pod B won't start, because it won't be able to pull the private image. Some folks may use that to segregate sensitive image to specific nodes using a combination of taints, tolerations, or node selectors.
333+
On a normal Kubernetes cluster (without kuik), if pods A and B are on the same node, then pod B will run correctly, even though it doesn't reference `imagePullSecrets`, because the image gets pulled when starting pod A, and once it's available on the node, any other pod can use it. However, if pods A and B are on different nodes, pod B won't start, because it won't be able to pull the private image. Some folks may use that to segregate sensitive images to specific nodes using a combination of taints, tolerations, or node selectors.
324334

325-
Howevever, when using kuik, once an image has been pulled and stored in kuik's registry, it becomes available for any node on the cluster. This means that using taints, tolerations, etc. to limit sensitive images to specific nodes won't work anymore.
335+
However, when using kuik, once an image has been pulled and stored in kuik's registry, it becomes available for any node on the cluster. This means that using taints, tolerations, etc. to limit sensitive images to specific nodes won't work anymore.
326336

327337
### Cluster autoscaling delays
328338

329-
With kuik, all image pulls (except in the namespaces excluded from kuik) go through kuik's registry proxy, which runs on each node thanks to a DaemonSet. When a node gets added to a Kubernetes cluster (for instance, by the cluster autoscaler), a kuik registry proxy Pod gets scheduled on that node, but it will take a brief moment to start. During that time, all other image pulls will fail. Thanks to Kubernetes automatic retry mechanisms, they will eventually succeed, but on new nodes, you may see Pods in `ErrImagePull` or `ImagePullBackOff` status for a minute before everything works correctly. If you are using cluster autoscaling and try to achieve very fast scale-up times, this is something that you might want to keep in mind.
339+
With kuik, all image pulls (except in the namespaces excluded from kuik) go through kuik's registry proxy, which runs on each node thanks to a DaemonSet. When a node gets added to a Kubernetes cluster (for instance, by the cluster autoscaler), a kuik registry proxy Pod gets scheduled on that node, but it will take a brief moment to start. During that time, all other image pulls will fail. Thanks to Kubernetes automatic retry mechanisms, they will eventually succeed, but on new nodes, you may see Pods in `ErrImagePull` or `ImagePullBackOff` status for a minute before everything works correctly. If you are using cluster autoscaling trying to achieve very fast scale-up times, this is something that you might want to keep in mind.
330340

331341
### Garbage collection issue
332342

333343
We use Docker Distribution in Kuik, along with the integrated garbage collection tool. There is a bug that occurs when untagged images are pushed into the registry, causing it to crash. It's possible to end up in a situation where the registry is in read-only mode and becomes unusable. Until a permanent solution is found, we advise keeping the value `registry.garbageCollection.deleteUntagged` set to false.
334344

335345
### Images with digest
336346

337-
As of today, there is no way to manage container images based on a digest. The rational behind this limitation is that a digest is an image manifest hash, and the manifest contains the registry URL associated with the image. Thus, pushing the image to another registry (our cache registry) changes its digest and as a consequence, it is not anymore referenced by its original digest. Digest validation prevent from pushing a manifest with an invalid digest. Therefore, we currently ignore all images based on a digest, those images will not be rewritten nor put in cache to prevent malfunctionning of kuik.
347+
As of today, there is no way to manage container images based on a digest. The rationale behind this limitation is that a digest is an image manifest hash, and the manifest contains the registry URL associated with the image. Thus, pushing the image to another registry (our cache registry) changes its digest and as a consequence, it is no longer referenced by its original digest. Digest validation prevents from pushing a manifest with an invalid digest. Therefore, we currently ignore all images based on a digest. Those images will not be rewritten nor put into the cache to prevent kuik from malfunctioning.

api/core/v1/pod_webhook.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,13 @@ func (p *PodInitializer) Start(ctx context.Context) error {
181181
}
182182

183183
for _, pod := range pods.Items {
184-
setupLog.Info("patching " + pod.Namespace + "/" + pod.Name)
184+
setupLog.Info("patching", "pod", pod.Namespace+"/"+pod.Name)
185185
err := p.Client.Patch(ctx, &pod, client.RawPatch(types.JSONPatchType, []byte("[]")))
186186
if err != nil && !apierrors.IsNotFound(err) {
187-
return err
187+
setupLog.Info("patching failed", "pod", pod.Namespace+"/"+pod.Name, "err", err)
188188
}
189189
}
190+
setupLog.Info("completed")
190191

191192
return nil
192193
}

0 commit comments

Comments
 (0)