Skip to content

Commit

Permalink
Add proxy env vars to pods
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontleon committed Apr 2, 2020
1 parent 4efddd8 commit 49c3f1f
Show file tree
Hide file tree
Showing 3 changed files with 51 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: "{{ lookup( 'env', 'HTTP_PROXY') }}"
https_proxy: "{{ lookup( 'env', 'HTTPS_PROXY') }}"
image_pull_policy: Always
mig_controller_image: "{{ registry }}/{{ project }}/{{ mig_controller_repo }}"
mig_controller_limits_cpu: "100m"
Expand Down Expand Up @@ -33,6 +35,7 @@ migration_registry_image: "{{ registry }}/{{ project }}/{{ migration_registry_re
migration_registry_repo: "{{ lookup( 'env', 'MIGRATION_REGISTRY_REPO') }}"
migration_registry_version: "{{ lookup( 'env', 'MIGRATION_REGISTRY_TAG') }}"
migration_registry_image_fqin: "{{ migration_registry_image }}:{{ migration_registry_version }}"
no_proxy: "{{ lookup( 'env', 'NO_PROXY') }}"
olm_managed: false
registry: "{{ lookup( 'env', 'REGISTRY') }}"
project: "{{ lookup( 'env', 'PROJECT') }}"
Expand Down
24 changes: 24 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_fqin }}
{% 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 Expand Up @@ -114,6 +126,18 @@ spec:
value: discovery
- name: SECRET_NAME
value: webhook-server-secret
{% 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 @@ -213,6 +225,18 @@ spec:
- name: certs
mountPath: /etc/ssl/certs
env:
{% 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 %}
- name: NODE_NAME
valueFrom:
fieldRef:
Expand Down

0 comments on commit 49c3f1f

Please sign in to comment.