-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for mirroring Helm charts with both operator and operand images #1030
Comments
Explored this a little bit more and came up with two tactical approaches which can be done with the existing Tactical option 1 - additionalImages in ImageSetConfigurationapiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
...
mirror:
helm:
...
additionalImages:
- name: quay.io/acme/operator-image:1.0
- name: quay.io/acme/operand-primary-image:1.0
- name: quay.io/acme/operand-secondary-image:1.0 Tactical option 2 - additional CR in Helm, listing imagesThe second option which proved working was to come up with a new CRD, let's call it Sample CR below: apiVersion: acme.com/v1
kind: ImageMirrorList
metadata:
name: ibm-test-images-list
spec:
containers:
- name: operator-image
image: quay.io/acme/operator-image:1.0
- name: operand-primary-image
image: quay.io/acme/operand-primary-image:1.0
- name: operand-secondary-image
image: quay.io/acme/operand-secondary-image:1.0 It has though disadvantage that it introduces the application-specific CRD, whereas if OCP provided such CRD, it would be much cleaner. |
Hi @pgodowski, Currently oc-mirror v2 has the field
Do you think using this field could be a solution ? |
Thanks for your response @aguidirh. So I tried adding kind: ImageSetConfiguration
...
mirror:
helm:
local:
- name: test-mirror-helm
path: /test/test-mirror-helm-0.3.0.tgz
imagePaths:
- "{.spec.template.spec.containers[*].env[*].value}" and with Helm chart having apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-ingress
spec:
replicas: 1
selector:
matchLabels:
app: nginx-test
template:
metadata:
labels:
app: nginx-test
spec:
containers:
- name: nginx
image: quay.io/nginx/nginx-ingress:latest
env:
- name: DUMMY_IMAGE
value: "quay.io/prometheus/prometheus:latest"
ports:
- containerPort: 8080
protocol: TCP This is very promising - thanks for sharing this as an option - I didn't find |
Hi @pgodowski , Yes, the team is currently adding the information about this field in openshift docs 4.18. |
As of today,
oc-mirror
supports mirroring the container images referenced from Helm Charts, as the result of the Helm support initial work: #83However, when the Helm Chart packages the operator-managed workloads,
oc-mirror
is mirroring only the operator-controller image, but not the operand images. The reason for it is thatoc-mirror
does the image reference looking within the rendered Helm YAML manifests, assuming that some of those YAMLs would representDeployment
,Pod
,StatefulSet
, etc.In operator-managed workloads, what gets initially deployed via Helm chart though is the operator-controller Deployment/StatefulSet, but the operand is deployed by operator-controller dynamically, after operator's CustomResource reconcilation.
This enhancement request is to provide some convention for Helm chart authors to follow by listing the operand images and then
oc-mirror
to get the list of such operand images for mirroring purposes.There are some existing community efforts in this space:
Deployment
, etc), but also fromConfigMap
image:
).There are some suggestions for implementation choices:
additionalImages
section populated with the list of operand imagesimages.txt
file which was supposed to be a Helm convention, but never materialised, see Support for first-class image definition helm/helm#7754The text was updated successfully, but these errors were encountered: