-
Notifications
You must be signed in to change notification settings - Fork 13
ACM/MCE installation from Konflux build #55
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets leverage templating manifests and can use Ansible looping to properly render each needed file/manifests to complete an install whether it is from Konflux or not Konflux.
template: | ||
src: icsp.yaml.j2 | ||
dest: "{{ install_directory }}/rhacm-deploy/icsp.yml" | ||
|
||
- name: Create ImageContentSourcePolicy on hub cluster | ||
when: not is_konflux_build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be when: is_konflux_build
? Also we should add something to the name of each task so in output from Ansible we can better understand one is the template for the ICSP for konflux and the other is not.
- name: Create catalog source for ACM | ||
template: | ||
src: cs-acm-dev-catalog.yaml.j2 | ||
dest: "{{ install_directory }}/rhacm-deploy/cs-acm-dev-catalog.yaml" | ||
|
||
- name: Create catalog source for MCE | ||
template: | ||
src: cs-mce-dev-catalog.yaml.j2 | ||
dest: "{{ install_directory }}/rhacm-deploy/cs-mce-dev-catalog.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we combine the 3 template tasks into a single one with a loop, Ex:
- name: Create Konflux ACM install manifests
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: pull-secret.yaml.j2
dest: "{{ install_directory }}/rhacm-deploy/pull-secret.yaml"
- src: cs-acm-dev-catalog.yaml.j2
dest: "{{ install_directory }}/rhacm-deploy/cs-acm-dev-catalog.yaml"
- src: cs-mce-dev-catalog.yaml.j2
dest: "{{ install_directory }}/rhacm-deploy/cs-mce-dev-catalog.yaml"
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
name: open-cluster-management-operator-group | ||
spec: | ||
targetNamespaces: | ||
- open-cluster-management" | kubectl apply -f - | ||
echo " | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
name: acm-operator-subscription | ||
spec: | ||
sourceNamespace: openshift-marketplace | ||
source: cs-acm-dev-catalog | ||
channel: $ACM_CHANNEL | ||
installPlanApproval: Automatic | ||
name: advanced-cluster-management" | kubectl apply -f - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these two manifests + namespace should just be rendered as one file similar to other operator installs instead of piped directly in to kubectl apply commands. The template could be rendered in the above template loop as well. An example would be something like these manifests, templated here and applied here. Afterwards we can have one shell to apply each of the manifests in the proper order.
channel: $ACM_CHANNEL | ||
installPlanApproval: Automatic | ||
name: advanced-cluster-management" | kubectl apply -f - | ||
sleep 60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a way to avoid a sleep statement, maybe test for the operator to begin installing?
oc create secret generic -n open-cluster-management open-cluster-management-pull-secret \ | ||
--from-file=.dockerconfigjson={{ install_directory }}/rhacm-deploy/pull-secret.yaml \ | ||
--type=kubernetes.io/dockerconfigjson | ||
echo " | ||
apiVersion: operator.open-cluster-management.io/v1 | ||
kind: MultiClusterHub | ||
metadata: | ||
name: multiclusterhub | ||
namespace: open-cluster-management | ||
spec: | ||
imagePullSecret: open-cluster-management-pull-secret" | kubectl apply -f - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sticking with the prior method I believe this should also be rendered as a file so all manifest templating is rendered in the same manner making it easier to understand how each manifest is created.
echo " | ||
apiVersion: operator.open-cluster-management.io/v1 | ||
kind: MultiClusterHub | ||
metadata: | ||
name: multiclusterhub | ||
namespace: open-cluster-management | ||
spec: | ||
{}" | kubectl apply -f - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with templating
No description provided.