spec:
containers:
- command:
- kube-apiserver
- --advertise-address=192.168.34.2
- --allow-privileged=true
- --authorization-mode=Node,RBAC
- --client-ca-file=/etc/kubernetes/pki/ca.crt
- --enable-admission-plugins=NodeRestriction
- --enable-bootstrap-token-auth=true
- --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt
- --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt
- --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key
- --etcd-servers=https://127.0.0.1:2379
search etcd-servers
staging/src/k8s.io/apiserver/pkg/server/options/etcd.go
fs.StringSliceVar(&s.StorageConfig.Transport.ServerList, "etcd-servers", s.StorageConfig.Transport.ServerList,
"List of etcd servers to connect with (scheme://ip:port), comma separated.")
staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go:newETCD3Client()
cfg := clientv3.Config{
DialTimeout: dialTimeout,
DialKeepAliveTime: keepaliveTime,
DialKeepAliveTimeout: keepaliveTimeout,
DialOptions: dialOptions,
Endpoints: c.ServerList,
TLS: tlsConfig,
}
clientv3.New(cfg)-->
newClient(&cfg)-->
client.resolver = resolver.New(cfg.Endpoints...)
conn, err := client.dialWithBalancer()-->
return c.dial(creds, opts...)
staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go:newETCD3Storage()
staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go:Create()
staging/src/k8s.io/apiserver/pkg/registry/generic/storage_decorator.go:NewRawStorage()
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/storage_factory.go:StorageWithCacher()
staging/src/k8s.io/apiserver/pkg/server/options/etcd.go:GetRESTOptions()
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go:CompleteWithOptions()
pkg/registry/core/configmap/storage/storage.go:store.CompleteWithOptions(options)