mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Mount cloud-config files for cloudproviders in kube-apiserver & kube-controllermanager.
This commit is contained in:
parent
644e74f5a9
commit
82afaaf31d
@ -5,21 +5,17 @@
|
||||
|
||||
{% set cloud_provider = "" -%}
|
||||
{% set cloud_config = "" -%}
|
||||
{% set cloud_config_mount = "" -%}
|
||||
{% set cloud_config_volume = "" -%}
|
||||
|
||||
{% if grains.cloud is defined -%}
|
||||
{% set cloud_provider = "--cloud_provider=" + grains.cloud -%}
|
||||
{% set cloud_provider = "--cloud_provider=" + grains.cloud -%}
|
||||
|
||||
{% if grains.cloud == 'gce' -%}
|
||||
{% if grains.cloud_config is defined -%}
|
||||
{% if grains.cloud in [ 'aws', 'gce' ] and grains.cloud_config is defined -%}
|
||||
{% set cloud_config = "--cloud_config=" + grains.cloud_config -%}
|
||||
{% set cloud_config_mount = "{\"name\": \"cloudconfigmount\",\"mountPath\": \"" + grains.cloud_config + "\", \"readOnly\": true}," -%}
|
||||
{% set cloud_config_volume = "{\"name\": \"cloudconfigmount\",\"hostPath\": {\"path\": \"" + grains.cloud_config + "\"}}," -%}
|
||||
{% endif -%}
|
||||
|
||||
{% elif grains.cloud == 'aws' -%}
|
||||
{% if grains.cloud_config is defined -%}
|
||||
{% set cloud_config = "--cloud_config=" + grains.cloud_config -%}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
|
||||
{% endif -%}
|
||||
|
||||
{% set advertise_address = "" -%}
|
||||
@ -111,6 +107,7 @@
|
||||
"hostPort": 8080}
|
||||
],
|
||||
"volumeMounts": [
|
||||
{{cloud_config_mount}}
|
||||
{ "name": "srvkube",
|
||||
"mountPath": "/srv/kubernetes",
|
||||
"readOnly": true},
|
||||
@ -145,6 +142,7 @@
|
||||
}
|
||||
],
|
||||
"volumes":[
|
||||
{{cloud_config_volume}}
|
||||
{ "name": "srvkube",
|
||||
"hostPath": {
|
||||
"path": "/srv/kubernetes"}
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
{% set cloud_provider = "" -%}
|
||||
{% set cloud_config = "" -%}
|
||||
{% set cloud_config_mount = "" -%}
|
||||
{% set cloud_config_volume = "" -%}
|
||||
|
||||
{% if grains.cloud is defined -%}
|
||||
{% set cloud_provider = "--cloud_provider=" + grains.cloud -%}
|
||||
@ -21,6 +23,8 @@
|
||||
|
||||
{% if grains.cloud in [ 'aws', 'gce' ] and grains.cloud_config is defined -%}
|
||||
{% set cloud_config = "--cloud_config=" + grains.cloud_config -%}
|
||||
{% set cloud_config_mount = "{\"name\": \"cloudconfigmount\",\"mountPath\": \"" + grains.cloud_config + "\", \"readOnly\": true}," -%}
|
||||
{% set cloud_config_volume = "{\"name\": \"cloudconfigmount\",\"hostPath\": {\"path\": \"" + grains.cloud_config + "\"}}," -%}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
|
||||
@ -42,6 +46,7 @@
|
||||
"/usr/local/bin/kube-controller-manager {{params}} 1>>/var/log/kube-controller-manager.log 2>&1"
|
||||
],
|
||||
"volumeMounts": [
|
||||
{{cloud_config_mount}}
|
||||
{ "name": "srvkube",
|
||||
"mountPath": "/srv/kubernetes",
|
||||
"readOnly": true},
|
||||
@ -76,6 +81,7 @@
|
||||
}
|
||||
],
|
||||
"volumes":[
|
||||
{{cloud_config_volume}}
|
||||
{ "name": "srvkube",
|
||||
"hostPath": {
|
||||
"path": "/srv/kubernetes"}
|
||||
|
Loading…
Reference in New Issue
Block a user