Creating the Dataplane Environment Overlay
Configuring OpenShift Networking for RHOS
Creating the environment overlay configuration
Change directory to your forked gitops repo, in your bastion:
cd /home/lab-user/labrepo/gitops
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.
First add the patches to add the compute01 node:
cat >> environments/demo-env/dataplane/kustomization.yaml <<'EOF'
patches:
- path: patch-nodeset-ansible.yaml
target:
kind: OpenStackDataPlaneNodeSet
name: preprovisioned-nodeset
- path: patch-nodeset-nodes.yaml
target:
kind: OpenStackDataPlaneNodeSet
name: preprovisioned-nodeset
- path: patch-pvc-storageclass.yaml
target:
kind: PersistentVolumeClaim
name: openstack-dataplane-ansible-log
EOF
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-{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-{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-{guid}-ocp4-cluster.svc.cluster.local
EOF
Let’s create the patches files, patch-pvc-storageclass.yaml content:
cat << EOF > environments/demo-env/dataplane/patch-pvc-storageclass.yaml
- op: add
path: /spec/storageClassName
value: ocs-external-storagecluster-ceph-rbd-immediate
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 environments/demo-env/dataplane/
git commit -m "Base and demo-env environment dataplane"
git push origin
Configure the dataplane validated patterns section in the values-rhoso-gitops.yaml file
On the bastion, in your forked pattern repository:
cd /home/lab-user/rhoso-gitops
| Make sure to replace $your_github_id with your GitHub ID. |
your_github_id=pnavarro
echo $your_github_id
Enable openstack-dataplane applications in the values-rhoso-gitops.yaml file:
cat >> overrides/values-rhoso-gitops.yaml <<EOF
openstack-dataplane:
enabled: true
repoURL: https://github.com/$your_github_id/osp-on-ocp-showroom
path: gitops/environments/demo-env/dataplane
targetRevision: "main"
kustomize:
patches:
- target:
kind: Job
name: delete-services
patch: |-
[
{"op": "replace", "path": "/metadata/namespace", "value": "openshift-gitops"},
{"op": "replace", "path": "/spec/template/spec/serviceAccountName", "value": "openshift-gitops-argocd-application-controller"}
]
EOF
Commit the files created and push them to your GitHub repo:
git add overrides/values-rhoso-gitops.yaml
git commit -m "Configure the dataplane validated patterns section in the values-rhoso-gitops.yaml file"
git push origin