An operator to install, configure, and manage a kubernetes-image-puller deployment.
The kubernetes-image-puller creates daemonsets that will run a list of images on your cluster, allowing Eclipse Che to start workspaces faster, because those images have been pre-pulled. For more information about the kubernetes-image-puller, consult the kubernetes-image-puller README.
The operator provides a KubernetesImagePuller
custom resource definition (CRD) to install and configure a kubernetes-image-puller instance.
apiVersion: che.eclipse.org/v1alpha1
kind: KubernetesImagePuller
metadata:
name: image-puller
spec:
deploymentName: kubernetes-image-puller # the name of the deployment the operator creates
configMapName: k8s-image-puller # the name of the configmap the operator creates
daemonsetName: k8s-image-puller # the name of subsequent daemonsets created by the kubernetes-image-puller
images: >- # the list of images to pre-pull
che-theia=quay.io/eclipse/che-theia:next;java11-maven=quay.io/eclipse/che-java11-maven:nightly
cachingIntervalHours: '2' # number of hours between health checks
cachingMemoryRequest: '10Mi' # the memory request for each pre-pulled image
cachingMemoryLimit: '20Mi' # the memory limit for each pre-pulled image
nodeSelector: '{}' # node selector applied to pods created by the daemonset
kubectl apply -f deploy/
kubectl apply -f deploy/crds/
- Go >=
1.15
- Operator SDK
v0.19.4
(recommended)
operator-sdk build quay.io/eclipse/kubernetes-image-puller-operator:tag
go test -v ./pkg... ./cmd...
A quirk of this project is that while the repository is named kubernetes-image-puller-operator
, the operator bundle on OperatorHub is named kubernetes-imagepuller-operator
. This was caused by the previous version of OLM deployment that required a Quay.io Application.
- Change the version in
version/version.go
to match your new operator bundle version. If your new bundle is v0.5.1, for example, this is what theVersion
var should be inversion/version.go
. - Make a directory in
deploy/olm-catalog/kubernetes-imagepuller-operator/VERSION
- Run
operator-sdk generate k8s
andoperator-sdk generate crds --crd-version=v1
- Copy a previous version of
kubernetes-imagepuller-operator.vX.X.X.clusterserviceversion.yaml
to the new folder you made in step 2 - Edit the new
kubernetes-imagepuller-operator.vX.X.X.clusterserviceversion.yaml
and change the following fields:
name
- replace the verison tag to the new versioncontainerImage
: replace the version tag to the new versionversion
: replace to the new versionreplaces
: replace the version tag to the previous version that this one is intended to replacedeployments.spec.template.spec.containers[0].image
: replace the image tag with the new version
- Copy the crd generated by
operator-sdk generate crds
intodeploy/olm-catalog/kubernetes-imagepuller-operator/VERSION
- Update
deploy/olm-catalog/kubernetes-imagepuller-operator/kubernetes-imagepuller-operator.package.yaml
to reference the newly-created version
You now have a new version of the CSV and CRD, and can open a PR to kubernetes-image-puller-operator
to keep everything in sync.
Then, to see these changes on OperatorHub:
- Clone the
community-operators
andcommunity-operators-prod
repositories. - Copy
deploy/olm-catalog/kubernetes-imagepuller-operator/
to thekubernetes-imagepuller-operator
folder of those repositories. - Optionally run some tests to confirm your changes are good (see testing operators)
- Open two separate pull requests to
community-operators
andcommunity-operators-prod
repositories. Examples of the PRs: