mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
AWS: Change apiserver to listen on 443 directly, not through nginx
Mirrors changes in GCE. I think the same changes will be needed for vagrant.
This commit is contained in:
parent
b447dc0c54
commit
57f7b658bb
@ -36,8 +36,12 @@ dns_domain: '$(echo "$DNS_DOMAIN" | sed -e "s/'/''/g")'
|
|||||||
admission_control: '$(echo "$ADMISSION_CONTROL" | sed -e "s/'/''/g")'
|
admission_control: '$(echo "$ADMISSION_CONTROL" | sed -e "s/'/''/g")'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mkdir -p /srv/salt-overlay/salt/nginx
|
readonly BASIC_AUTH_FILE="/srv/salt-overlay/salt/kube-apiserver/basic_auth.csv"
|
||||||
echo $MASTER_HTPASSWD > /srv/salt-overlay/salt/nginx/htpasswd
|
if [ ! -e "${BASIC_AUTH_FILE}" ]; then
|
||||||
|
mkdir -p /srv/salt-overlay/salt/kube-apiserver
|
||||||
|
(umask 077;
|
||||||
|
echo "${KUBE_PASSWORD},${KUBE_USER},admin" > "${BASIC_AUTH_FILE}")
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate and distribute a shared secret (bearer token) to
|
# Generate and distribute a shared secret (bearer token) to
|
||||||
# apiserver and the nodes so that kubelet and kube-proxy can
|
# apiserver and the nodes so that kubelet and kube-proxy can
|
||||||
|
@ -361,10 +361,6 @@ function kube-up {
|
|||||||
ensure-iam-profiles
|
ensure-iam-profiles
|
||||||
|
|
||||||
get-password
|
get-password
|
||||||
python "${KUBE_ROOT}/third_party/htpasswd/htpasswd.py" \
|
|
||||||
-b -c "${KUBE_TEMP}/htpasswd" "$KUBE_USER" "$KUBE_PASSWORD"
|
|
||||||
local htpasswd
|
|
||||||
htpasswd=$(cat "${KUBE_TEMP}/htpasswd")
|
|
||||||
|
|
||||||
if [[ ! -f "$AWS_SSH_KEY" ]]; then
|
if [[ ! -f "$AWS_SSH_KEY" ]]; then
|
||||||
ssh-keygen -f "$AWS_SSH_KEY" -N ''
|
ssh-keygen -f "$AWS_SSH_KEY" -N ''
|
||||||
@ -442,7 +438,8 @@ function kube-up {
|
|||||||
echo "readonly SERVER_BINARY_TAR_URL='${SERVER_BINARY_TAR_URL}'"
|
echo "readonly SERVER_BINARY_TAR_URL='${SERVER_BINARY_TAR_URL}'"
|
||||||
echo "readonly SALT_TAR_URL='${SALT_TAR_URL}'"
|
echo "readonly SALT_TAR_URL='${SALT_TAR_URL}'"
|
||||||
echo "readonly ZONE='${ZONE}'"
|
echo "readonly ZONE='${ZONE}'"
|
||||||
echo "readonly MASTER_HTPASSWD='${htpasswd}'"
|
echo "readonly KUBE_USER='${KUBE_USER}'"
|
||||||
|
echo "readonly KUBE_PASSWORD='${KUBE_PASSWORD}'"
|
||||||
echo "readonly PORTAL_NET='${PORTAL_NET}'"
|
echo "readonly PORTAL_NET='${PORTAL_NET}'"
|
||||||
echo "readonly ENABLE_CLUSTER_MONITORING='${ENABLE_CLUSTER_MONITORING:-false}'"
|
echo "readonly ENABLE_CLUSTER_MONITORING='${ENABLE_CLUSTER_MONITORING:-false}'"
|
||||||
echo "readonly ENABLE_NODE_MONITORING='${ENABLE_NODE_MONITORING:-false}'"
|
echo "readonly ENABLE_NODE_MONITORING='${ENABLE_NODE_MONITORING:-false}'"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if grains['cloud'] is defined and grains['cloud'] == 'gce' %}
|
{% if grains['cloud'] is defined and grains.cloud in [ 'aws', 'gce' ] %}
|
||||||
/srv/kubernetes/basic_auth.csv:
|
/srv/kubernetes/basic_auth.csv:
|
||||||
file.managed:
|
file.managed:
|
||||||
- source: salt://kube-apiserver/basic_auth.csv
|
- source: salt://kube-apiserver/basic_auth.csv
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
{% set client_ca_file = "" -%}
|
{% set client_ca_file = "" -%}
|
||||||
|
|
||||||
{% set secure_port = "6443" -%}
|
{% set secure_port = "6443" -%}
|
||||||
{% if grains['cloud'] is defined and grains['cloud'] == 'gce' %}
|
{% if grains['cloud'] is defined and grains.cloud in [ 'aws', 'gce' ] %}
|
||||||
{% set secure_port = "443" -%}
|
{% set secure_port = "443" -%}
|
||||||
{% set client_ca_file = "--client_ca_file=/srv/kubernetes/ca.crt" -%}
|
{% set client_ca_file = "--client_ca_file=/srv/kubernetes/ca.crt" -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
@ -60,7 +60,7 @@
|
|||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{% if grains['cloud'] is defined and grains['cloud'] == 'gce' %}
|
{% if grains['cloud'] is defined and grains.cloud in [ 'aws', 'gce' ] %}
|
||||||
{% set basic_auth_file = "--basic_auth_file=/srv/kubernetes/basic_auth.csv" -%}
|
{% set basic_auth_file = "--basic_auth_file=/srv/kubernetes/basic_auth.csv" -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
# TODO: remove nginx for other cloud providers.
|
# TODO: remove nginx for other cloud providers.
|
||||||
{% if grains['cloud'] is defined and grains['cloud'] == 'gce' -%}
|
{% if grains['cloud'] is defined and grains.cloud in [ 'aws', 'gce' ] %}
|
||||||
{% set api_servers_with_port = api_servers -%}
|
{% set api_servers_with_port = api_servers -%}
|
||||||
{% else -%}
|
{% else -%}
|
||||||
{% set api_servers_with_port = api_servers + ":6443" -%}
|
{% set api_servers_with_port = api_servers + ":6443" -%}
|
||||||
|
@ -33,7 +33,7 @@ base:
|
|||||||
- kube-controller-manager
|
- kube-controller-manager
|
||||||
- kube-scheduler
|
- kube-scheduler
|
||||||
- monit
|
- monit
|
||||||
{% if grains['cloud'] is defined and grains['cloud'] != 'gce' %}
|
{% if grains['cloud'] is defined and not grains.cloud in [ 'aws', 'gce' ] %}
|
||||||
- nginx
|
- nginx
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- cadvisor
|
- cadvisor
|
||||||
|
Loading…
Reference in New Issue
Block a user