1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-09 11:01:40 +00:00
Add relative path for local kube config

Add default cluster yaml config name
This commit is contained in:
galal-hussein
2017-11-15 03:12:33 +02:00
parent c59f5e4d07
commit 703a4fd812
21 changed files with 179 additions and 39 deletions

View File

@@ -0,0 +1,12 @@
FROM nginx:1.13.6-alpine
RUN apk add --update curl ca-certificates \
&& curl -L -o /usr/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.12.0-alpha3/confd-0.12.0-alpha3-linux-amd64 \
&& chmod +x /usr/bin/confd \
&& mkdir -p /etc/confd
ADD templates /etc/confd/templates/
ADD conf.d /etc/confd/conf.d/
ADD entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,6 @@
[template]
src = "nginx.tmpl"
dest = "/etc/nginx/nginx.conf"
keys = [
"CP_HOSTS",
]

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Run confd
confd -onetime -backend env
# Start nginx
nginx -g 'daemon off;'

View File

@@ -0,0 +1,26 @@
error_log stderr notice;
worker_processes auto;
events {
multi_accept on;
use epoll;
worker_connections 1024;
}
stream {
upstream kube_apiserver {
least_conn;
{{ $servers := split (getenv "CP_HOSTS") "," }}{{range $servers}}
server {{.}}:6443;
{{end}}
}
server {
listen 127.0.0.1:6443;
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 1s;
}
}