run kube-proxy in a static pod
This commit is contained in:
54
cluster/saltbase/salt/kube-proxy/kube-proxy.manifest
Normal file
54
cluster/saltbase/salt/kube-proxy/kube-proxy.manifest
Normal file
@@ -0,0 +1,54 @@
|
||||
{% set kubeconfig = "--kubeconfig=/var/lib/kube-proxy/kubeconfig" -%}
|
||||
{% if grains.api_servers is defined -%}
|
||||
{% set api_servers = "--master=https://" + grains.api_servers -%}
|
||||
{% else -%}
|
||||
{% set ips = salt['mine.get']('roles:kubernetes-master', 'network.ip_addrs', 'grain').values() -%}
|
||||
{% set api_servers = "--master=https://" + ips[0][0] -%}
|
||||
{% endif -%}
|
||||
{% if grains['cloud'] is defined and grains.cloud in [ 'aws', 'gce', 'vagrant' ] %}
|
||||
{% set api_servers_with_port = api_servers -%}
|
||||
{% else -%}
|
||||
{% set api_servers_with_port = api_servers + ":6443" -%}
|
||||
{% endif -%}
|
||||
{% set test_args = "" -%}
|
||||
{% if pillar['kubeproxy_test_args'] is defined -%}
|
||||
{% set test_args=pillar['kubeproxy_test_args'] %}
|
||||
{% endif -%}
|
||||
|
||||
# kube-proxy podspec
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: kube-proxy
|
||||
namespace: kube-system
|
||||
spec:
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- name: kube-proxy
|
||||
image: gcr.io/google_containers/kube-proxy:{{pillar['kube-proxy_docker_tag']}}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kube-proxy {{api_servers_with_port}} {{kubeconfig}} {{pillar['log_level']}} {{test_args}} 1>>/var/log/kube-proxy.log 2>&1
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- mountPath: /etc/ssl/certs
|
||||
name: ssl-certs-host
|
||||
readOnly: true
|
||||
- mountPath: /var/log
|
||||
name: varlog
|
||||
readOnly: false
|
||||
- mountPath: /var/lib/kube-proxy/kubeconfig
|
||||
name: kubeconfig
|
||||
readOnly: false
|
||||
volumes:
|
||||
- hostPath:
|
||||
path: /usr/share/ca-certificates
|
||||
name: ssl-certs-host
|
||||
- hostPath:
|
||||
path: /var/lib/kube-proxy/kubeconfig
|
||||
name: kubeconfig
|
||||
- hostPath:
|
||||
path: /var/log
|
||||
name: varlog
|
||||
Reference in New Issue
Block a user