Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tingxueca
Copy link
Contributor

No description provided.

Copy link
Member

@akrzos akrzos left a 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
Copy link
Member

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.

Comment on lines +58 to +66
- 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"
Copy link
Member

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"

Comment on lines +78 to +95
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 -
Copy link
Member

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
Copy link
Member

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?

Comment on lines +103 to +113
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 -
Copy link
Member

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.

Comment on lines +120 to +127
echo "
apiVersion: operator.open-cluster-management.io/v1
kind: MultiClusterHub
metadata:
name: multiclusterhub
namespace: open-cluster-management
spec:
{}" | kubectl apply -f -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with templating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants