Skip to content

Commit

Permalink
Configure proxy on velero, restic, and controller if required
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontleon committed Mar 26, 2020
1 parent 06377a9 commit e5e6e0c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/migrationcontroller/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ configmap_secret: ""
controller_state: absent
deprecated_cors_configuration: false
cors_origins: []
http_proxy: "{{ default(lookup( 'env', 'HTTP_PROXY') }}"
http_proxy: "{{ default(lookup( 'env', 'HTTPS_PROXY') }}"
image_pull_policy: Always
mig_controller_image: "{{ registry }}/{{ project }}/{{ mig_controller_repo }}"
mig_controller_limits_cpu: "100m"
Expand All @@ -30,6 +32,7 @@ mig_ui_version: "{{ snapshot_tag | default(lookup( 'env', 'MIG_UI_TAG')) }}"
migration_registry_image: "{{ registry }}/{{ project }}/{{ migration_registry_repo }}"
migration_registry_repo: "{{ lookup( 'env', 'MIGRATION_REGISTRY_REPO') }}"
migration_registry_version: "{{ lookup( 'env', 'MIGRATION_REGISTRY_TAG') }}"
no_proxy: "{{ default(lookup( 'env', 'NO_PROXY') }}"
olm_managed: false
registry: "{{ lookup( 'env', 'REGISTRY') }}"
project: "{{ lookup( 'env', 'PROJECT') }}"
Expand Down
12 changes: 12 additions & 0 deletions roles/migrationcontroller/templates/controller.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ spec:
value: webhook-server-secret
- name: MIGRATION_REGISTRY_IMAGE
value: {{ migration_registry_image }}:{{ migration_registry_version }}
{% if http_proxy|length >0 %}
- name: HTTP_PROXY
value: http_proxy
{% endif %}
{% if https_proxy|length >0 %}
- name: HTTPS_PROXY
value: https_proxy
{% endif %}
{% if no_proxy|length >0 %}
- name: NO_PROXY
value: no_proxy
{% endif %}
envFrom:
- configMapRef:
name: migration-controller
Expand Down
24 changes: 24 additions & 0 deletions roles/migrationcontroller/templates/velero.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ spec:
value: {{ mig_namespace }}
- name: VELERO_SCRATCH_DIR
value: /scratch
{% if http_proxy|length >0 %}
- name: HTTP_PROXY
value: http_proxy
{% endif %}
{% if https_proxy|length >0 %}
- name: HTTPS_PROXY
value: https_proxy
{% endif %}
{% if no_proxy|length >0 %}
- name: NO_PROXY
value: no_proxy
{% endif %}
volumes:
- name: {{ velero_aws_secret_name }}
secret:
Expand Down Expand Up @@ -212,6 +224,18 @@ spec:
mountPath: /scratch
- name: certs
mountPath: /etc/ssl/certs
{% if http_proxy|length >0 %}
- name: HTTP_PROXY
value: http_proxy
{% endif %}
{% if https_proxy|length >0 %}
- name: HTTPS_PROXY
value: https_proxy
{% endif %}
{% if no_proxy|length >0 %}
- name: NO_PROXY
value: no_proxy
{% endif %}
env:
- name: NODE_NAME
valueFrom:
Expand Down

0 comments on commit e5e6e0c

Please sign in to comment.