Skip to content

Commit

Permalink
cluster-cidr is set via param and not config file because we dont kno…
Browse files Browse the repository at this point in the history
…w in advance
  • Loading branch information
nouseforaname committed Nov 15, 2018
1 parent c6a536f commit 511f945
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
25 changes: 18 additions & 7 deletions jobs/kube-proxy/templates/bin/kube_proxy_ctl.erb
Expand Up @@ -43,16 +43,27 @@ get_hostname_override() {
echo $hostname_override
}


start_kubernetes_proxy() {

sed -i "s|HOSTNAMEOVERRIDE|$(get_hostname_override)|g" /var/vcap/jobs/kube-proxy/config/config.yml

kube-proxy \
--config /var/vcap/jobs/kube-proxy/config/config.yml \
--v=<%=p('logging-level') %> \
<% if_p('proxy-mode') do |proxy_mode| %>--proxy-mode="<%= proxy_mode %>"<% end %> \
1>> $LOG_DIR/kube_proxy.stdout.log \
2>> $LOG_DIR/kube_proxy.stderr.log
cont=true
while $cont; do
curl -s localhost:23954
if [ $0 -eq 0]; then
cont=false
fi
done
SILK_CIDR="$(curl -s localhost:23954 | sed -n 's/.*"overlay_subnet":"\([^"]*\)".*/\1/p')"

kube-proxy \
--config /var/vcap/jobs/kube-proxy/config/config.yml \
--v=<%=p('logging-level') %> \
--cluster-cidr="$SILK_CIDR" \
<% if_p('proxy-mode') do |proxy_mode| %>--proxy-mode="<%= proxy_mode %>"<% end %> \
--cluster-cidr="$SILK_CIDR"
1>> $LOG_DIR/kube_proxy.stdout.log \
2>> $LOG_DIR/kube_proxy.stderr.log
}

stop_kubernetes_proxy() {
Expand Down
1 change: 0 additions & 1 deletion jobs/kube-proxy/templates/config/config.yml.erb
Expand Up @@ -6,7 +6,6 @@ clientConnection:
contentType: application/vnd.kubernetes.protobuf
kubeconfig: /var/vcap/jobs/kube-proxy/config/kubeconfig
qps: 5
clusterCIDR: <%= p('pod-network-cidr') %>
configSyncPeriod: 15m0s
conntrack:
max: 0
Expand Down

0 comments on commit 511f945

Please sign in to comment.