When installing kubernetes 1.7.2 and a warning about kube-proxy appears
WARNING: all flags other than --config, --write-config-to, and --cleanup-iptables are deprecated. Please begin using a config file ASAP.
So I try make my own config file, like this,
{
"bind-address": "10.110.200.42",
"hostname-override": "10.110.200.42",
"cluster-cidr": "172.30.0.0/16",
"logtostderr": true,
"v": 0,
"allow-privileged": true,
"master": "http://10.110.200.42:8080",
"etcd-servers": "http://10.110.200.42:2379"
}
but I still get error
error: Object 'apiVersion' is missing in '{
I think I need some example about the config file, but I googled without any result, even search the source code in git , I found nothing usefull, please help!
ps, I found way to generate example file , just use --write-config-to command line , the example is below
apiVersion: componentconfig/v1alpha1
bindAddress: 0.0.0.0
clientConnection:
acceptContentTypes: ""
burst: 10
contentType: application/vnd.kubernetes.protobuf
kubeconfig: ""
qps: 5
clusterCIDR: ""
configSyncPeriod: 15m0s
conntrack:
max: 0
maxPerCore: 32768
min: 131072
tcpCloseWaitTimeout: 1h0m0s
tcpEstablishedTimeout: 24h0m0s
enableProfiling: false
featureGates: ""
healthzBindAddress: 0.0.0.0:10256
hostnameOverride: ""
iptables:
masqueradeAll: false
masqueradeBit: 14
minSyncPeriod: 0s
syncPeriod: 30s
kind: KubeProxyConfiguration
metricsBindAddress: 127.0.0.1:10249
mode: ""
oomScoreAdj: -999
portRange: ""
resourceContainer: /kube-proxy
udpTimeoutMilliseconds: 250ms
I am using k8s version 1.10.3, and just for simplicity and testing, i disable service account in apiserver by adding the item
--disable-admission-plugins=ServiceAccount
And for kube-proxy, just add the --master
item, e.g.
./kube-proxy --master 127.0.0.1:8080 --v=3
and the kube-proxy turns out to be working.