Skip to content

Commit

Permalink
Add legacy vm to mad_roadshow (#7227)
Browse files Browse the repository at this point in the history
* Add legacy vm to mad_roadshow

* Fix mad rdshow readme
  • Loading branch information
juliaaano authored Oct 23, 2023
1 parent 7f7a22b commit e7e8ba6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ ocp4_workload_mad_roadshow_pipeline_namespace_prefix: cicd-
# Demo deployment namespace
ocp4_workload_mad_roadshow_demo_namespace_prefix: retail-

# Demo legacy namespace (for VMs)
ocp4_workload_mad_roadshow_legacy_namespace: vm-legacy
ocp4_workload_mad_roadshow_legacy_static_ip: "10.10.10.30/24"

# PostgreSQL Helm Chart
ocp4_workload_mad_roadshow_postgresql_repo: https://github.com/redhat-gpte-devopsautomation/agnosticd_workload_helm_charts.git
ocp4_workload_mad_roadshow_postgresql_repo_tag: main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ history -c
Connect to the PostgreSQL Kubevirt VM from another container.

```
oc run psql -it --rm --image=registry.redhat.io/rhel8/postgresql-13:latest --restart=Never -- bash
psql -h postgresql.postgresql-vm.svc.cluster.local -U redhat customers
oc run psql-${RANDOM} -it --rm --image=registry.redhat.io/rhel8/postgresql-13:latest --restart=Never \
--annotations=k8s.v1.cni.cncf.io/networks='[{"name":"postgresql-net","interface":"net1","ips":["10.10.10.40/24"]}]' \
--env="PGPASSWORD=redhat" \
-- psql -h 10.10.10.30 -U redhat customers
```

## Image size optimization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@
- kubevirt/namespace.yaml.j2
- kubevirt/datavolume.yaml.j2
- kubevirt/clusterrole.yaml.j2
# Single shared legacy VM
- kubevirt/legacy-namespace.yaml.j2
- kubevirt/legacy-application.yaml.j2
# VMs for all users
- kubevirt/applicationset.yaml.j2

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: postgresql-legacy
namespace: openshift-gitops
spec:
project: default
destination:
namespace: "{{ ocp4_workload_mad_roadshow_legacy_namespace }}"
server: 'https://kubernetes.default.svc'
syncPolicy:
automated: {}
source:
repoURL: {{ ocp4_workload_mad_roadshow_kubevirt_vm_repo }}
targetRevision: {{ ocp4_workload_mad_roadshow_kubevirt_psql_vm_repo_tag }}
path: {{ ocp4_workload_mad_roadshow_kubevirt_psql_vm_repo_path }}
helm:
values: |
fullnameOverride: postgresql-legacy
staticIP: {{ ocp4_workload_mad_roadshow_legacy_static_ip }}
storage:
pvcSize: {{ ocp4_workload_mad_roadshow_kubevirt_image_size }}
{% if ocp4_workload_mad_roadshow_kubevirt_image_storage_class | default("") | length > 0 %}
storageClass: {{ ocp4_workload_mad_roadshow_kubevirt_image_storage_class }}
{% endif %}
resources:
requests:
memory: {{ ocp4_workload_mad_roadshow_kubevirt_vm_memory }}
cpu: '{{ ocp4_workload_mad_roadshow_kubevirt_vm_cpu }}'
dataVolumeSource:
namespace: {{ ocp4_workload_mad_roadshow_kubevirt_image_namespace }}
name: {{ ocp4_workload_mad_roadshow_kubevirt_psql_image_name }}
clusterRole: datavolume-cloner
{% if ocp4_workload_mad_roadshow_kubevirt_vm_node_selector | length > 0 %}
nodeSelector:
{{ ocp4_workload_mad_roadshow_kubevirt_vm_node_selector | to_yaml }}
{% endif %}
{% if ocp4_workload_mad_roadshow_kubevirt_vm_tolerations | length > 0 %}
tolerations:
{{ ocp4_workload_mad_roadshow_kubevirt_vm_tolerations | to_yaml }}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: "{{ ocp4_workload_mad_roadshow_legacy_namespace }}"

0 comments on commit e7e8ba6

Please sign in to comment.