Install RHOSO 18 dataplane

Login to the preprovisioned Compute and configure networking

From the bastion login to the compute01 host:

ssh -i /home/lab-user/.ssh/my-guidkey.pem cloud-user@compute01
sudo hostnamectl set-hostname edpm-compute-1.sandbox-my-guid-ocp4-cluster.svc.cluster.local
sudo nmcli con add con-name "static-eth1" ifname eth1 type ethernet ip4 172.22.0.100/24 ipv4.dns "172.22.0.89"
sudo nmcli con up "static-eth1"
sudo nmcli con add type ethernet ifname eth0 con-name eth0-dhcp ipv4.method auto ipv6.method ignore
sudo nmcli con up eth0-dhcp
sudo nmcli con mod eth0-dhcp connection.stable-id "user-set"

And log off VM

logout

Creating the Dataplane Environment Overlay

Configuring OpenShift Networking for RHOS

Creating the environment overlay configuration

Change directory to your base forked gitops repo, in your bastion:

cd /home/lab-user/labrepo/content/files/manifests

Create an environment directory to store the managed cluster overlay configuration:

mkdir -p environments/demo-env/dataplane/

Create the kustomization.yaml for the demo-env environment overlay configuration:

cat > environments/demo-env/dataplane/kustomization.yaml <<EOF
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - ../../../base/dataplane
EOF

Validate the base configuration can be generated with kustomize build:

kustomize build environments/demo-env/dataplane

Patching the OpenStackDataplaneNodeSet

In the previous chapter, we used patches inside kustomize.yaml file.

In this chapter, we will learn how to put those patches into files instead.

Edit the kustomization.yaml created in the previous step:

vim environments/demo-env/dataplane/kustomization.yaml

And add the patches to add the compute01 node:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - ../../../base/dataplane

patches:
  - path: patch-nodeset-ansible.yaml
    target:
      kind: OpenStackDataPlaneNodeSet
      name: preprovisioned-nodeset
  - path: patch-nodeset-nodes.yaml
    target:
      kind: OpenStackDataPlaneNodeSet
      name: preprovisioned-nodeset

Let’s create the patches files, patch-nodeset-nodes.yaml content:

cat << EOF > environments/demo-env/dataplane/patch-nodeset-nodes.yaml
  - op: add
    path: /spec/nodes/edpm-compute-1
    value:
      hostName: edpm-compute-1.sandbox-my-guid-ocp4-cluster.svc.cluster.local
      networks:
      - name: ctlplane
        subnetName: subnet1
        defaultRoute: false
        fixedIP: 172.22.0.100
      - name: internalapi
        subnetName: subnet1
        fixedIP: 172.17.0.100
      - name: storage
        subnetName: subnet1
        fixedIP: 172.18.0.100
      - name: tenant
        subnetName: subnet1
        fixedIP: 172.19.0.100
      - name: external
        subnetName: subnet1
        fixedIP: 172.21.0.100
      ansible:
        ansibleHost: 172.22.0.100
        ansibleUser: cloud-user
        ansibleVars:
          fqdn_internal_api: edpm-compute-1.sandbox-my-guid-ocp4-cluster.svc.cluster.local
EOF

Let’s create the patches files, patch-nodeset-ansible.yaml content:

cat << EOF > environments/demo-env/dataplane/patch-nodeset-ansible.yaml
- op: replace
  path: /spec/nodeTemplate/ansible/ansibleVars/dns_search_domains
  value: sandbox-my-guid-ocp4-cluster.svc.cluster.local
EOF

Validate the base configuration can be generated with kustomize build:

kustomize build environments/demo-env/dataplane/

Commit the files created and push it to your github repo:

git add .
git commit -m "Base and demo-env environment dataplane"
git push origin

Deploying the data plane overlay using a GitOps Application

Deploy the RHOSO data plane using a GitOps Application which will be deployed using sync-waves, resulting in the automated deployment of the environment on OpenShift.

Create the Application manifest:

replace $your_github_id string with your Github id
cat > applications/rhoso/application-environment-demo-env-dataplane.yaml <<EOF
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  finalizers:
  - resources-finalizer.argocd.argoproj.io
  name: environment-rhoso-demo-env-dataplane
  namespace: openshift-gitops
spec:
  destination:
    server: https://kubernetes.default.svc
  project: default
  source:
    path: content/files/manifests/environments/demo-env/dataplane/
    repoURL: https://github.com/$your_github_id/showroom_osp-on-ocp-day2.git
    targetRevision: HEAD
  syncPolicy:
    automated: {}
EOF

Deploy the RHOSO control plane with the GitOps Application:

oc create --save-config -f applications/rhoso/application-environment-demo-env-dataplane.yaml

Wait for the Application to deploy successfully:

oc wait --timeout=600s -nopenshift-gitops applications.argoproj.io/environment-rhoso-demo-env-dataplane --for jsonpath='{.status.health.status}'=Healthy

Wait for the Application to deploy successfully. Type Control + C, to exit the wait command:

oc get -n openshift-gitops application.argoproj.io environment-rhoso-demo-env-dataplane -w