Skip to content

Commit

Permalink
change merge type, fix DPA template, add resource reqs for Velero (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavgaikwad authored May 18, 2022
1 parent eb6e593 commit 8bdcfb0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions roles/migrationcontroller/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ velero_azure_plugin_image: "{{ registry }}/{{ project }}/{{ velero_azure_plugin_
velero_azure_plugin_repo: "{{ lookup( 'env', 'VELERO_AZURE_PLUGIN_REPO') }}"
velero_azure_plugin_version: "{{ snapshot_tag | default(lookup( 'env', 'VELERO_AZURE_PLUGIN_TAG')) }}"
velero_azure_plugin_fqin: "{{ velero_azure_plugin_image }}:{{ velero_azure_plugin_version }}"
velero_requests_cpu: "100m"
velero_state: absent
velero_qps: 100
velero_burst: 1000
1 change: 1 addition & 0 deletions roles/migrationcontroller/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
k8s:
state: "{{ velero_state }}"
definition: "{{ lookup('template', 'velero.yml.j2') }}"
merge_type: merge

- name: "Set up rsync-anyuid SCC"
k8s:
Expand Down
46 changes: 44 additions & 2 deletions roles/migrationcontroller/templates/velero.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,37 @@ spec:
podConfig:
labels:
app.kubernetes.io/part-of: openshift-migration
resourceAllocations:
{% if velero_requests_cpu is defined or velero_requests_memory is defined %}
requests:
{% if velero_requests_cpu is defined %}
cpu: "{{ velero_requests_cpu }}"
{% else %}
cpu: null
{% endif %}
{% if velero_requests_memory is defined %}
memory: "{{ velero_requests_memory }}"
{% else %}
memory: null
{% endif %}
{% else %}
requests: null
{% endif %}
{% if velero_limits_cpu is defined or velero_limits_memory is defined %}
limits:
{% if velero_limits_cpu is defined %}
cpu: "{{ velero_limits_cpu }}"
{% else %}
cpu: null
{% endif %}
{% if velero_limits_memory is defined %}
memory: "{{ velero_limits_memory }}"
{% else %}
memory: null
{% endif %}
{% else %}
limits: null
{% endif %}
restic:
enable: true
timeout: "{{ restic_timeout }}"
Expand All @@ -30,18 +61,29 @@ spec:
requests:
{% if restic_requests_cpu is defined %}
cpu: "{{ restic_requests_cpu }}"
{% else %}
cpu: null
{% endif %}
{% if restic_requests_memory is defined %}
memory: "{{ restic_requests_memory }}"
{% else %}
memory: null
{% endif %}
{% else %}
requests: null
{% endif %}
{% if restic_limits_cpu is defined or restic_limits_memory is defined %}
{% if restic_limits_cpu is defined %}
limits:
{% if restic_limits_cpu is defined %}
cpu: "{{ restic_limits_cpu }}"
{% else %}
cpu: null
{% endif %}
{% if restic_limits_memory is defined %}
memory: "{{ restic_limits_memory }}"
{% else %}
memory: null
{% endif %}
{% else %}
limits: null
{% endif %}

0 comments on commit 8bdcfb0

Please sign in to comment.