Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
498a893f
Commit
498a893f
authored
Nov 04, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to etcd v3 API by default
parent
76f115a8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
8 deletions
+12
-8
etcd.manifest
cluster/saltbase/salt/etcd/etcd.manifest
+2
-2
exceptions.txt
hack/verify-flags/exceptions.txt
+2
-2
etcd.go
pkg/genericapiserver/options/etcd.go
+1
-1
config.go
pkg/storage/storagebackend/config.go
+1
-1
factory.go
pkg/storage/storagebackend/factory/factory.go
+2
-2
apiserver.go
test/e2e_node/services/apiserver.go
+4
-0
No files found.
cluster/saltbase/salt/etcd/etcd.manifest
View file @
498a893f
...
...
@@ -20,9 +20,9 @@
{% endfor -%}
{% set etcd_cluster = vars.etcd_cluster -%}
{% set cluster_state = vars.cluster_state -%}
{% set storage_backend = pillar.get('storage_backend', 'etcd
2
') -%}
{% set storage_backend = pillar.get('storage_backend', 'etcd
3
') -%}
{% set quota_bytes = '' -%}
{% if pillar.get('storage_backend', 'etcd
2
') == 'etcd3' -%}
{% if pillar.get('storage_backend', 'etcd
3
') == 'etcd3' -%}
{% set quota_bytes = '--quota-backend-bytes=4294967296' -%}
{% endif -%}
{% set srv_kube_path = "/srv/kubernetes" -%}
...
...
hack/verify-flags/exceptions.txt
View file @
498a893f
...
...
@@ -39,8 +39,8 @@ cluster/photon-controller/util.sh: node_name=${1}
cluster/rackspace/util.sh: local node_ip=$(nova show --minimal ${NODE_NAMES[$i]} \
cluster/saltbase/salt/cluster-autoscaler/cluster-autoscaler.manifest:{% set params = pillar['autoscaler_mig_config'] + " " + cloud_config -%}
cluster/saltbase/salt/etcd/etcd.manifest: "value": "{{ storage_backend }}"
cluster/saltbase/salt/etcd/etcd.manifest:{% if pillar.get('storage_backend', 'etcd
2
') == 'etcd3' -%}
cluster/saltbase/salt/etcd/etcd.manifest:{% set storage_backend = pillar.get('storage_backend', 'etcd
2
') -%}
cluster/saltbase/salt/etcd/etcd.manifest:{% if pillar.get('storage_backend', 'etcd
3
') == 'etcd3' -%}
cluster/saltbase/salt/etcd/etcd.manifest:{% set storage_backend = pillar.get('storage_backend', 'etcd
3
') -%}
cluster/saltbase/salt/kube-admission-controls/init.sls:{% if 'LimitRanger' in pillar.get('admission_control', '') %}
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest:{% set params = address + " " + storage_backend + " " + etcd_servers + " " + etcd_servers_overrides + " " + cloud_provider + " " + cloud_config + " " + runtime_config + " " + feature_gates + " " + admission_control + " " + max_requests_inflight + " " + target_ram_mb + " " + service_cluster_ip_range + " " + client_ca_file + basic_auth_file + " " + min_request_timeout + " " + enable_garbage_collector + " " + etcd_quorum_read -%}
cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest:{% if pillar.get('enable_hostpath_provisioner', '').lower() == 'true' -%}
...
...
pkg/genericapiserver/options/etcd.go
View file @
498a893f
...
...
@@ -61,7 +61,7 @@ func (s *EtcdOptions) AddFlags(fs *pflag.FlagSet) {
"format: group/resource#servers, where servers are http://ip:port, semicolon separated."
)
fs
.
StringVar
(
&
s
.
StorageConfig
.
Type
,
"storage-backend"
,
s
.
StorageConfig
.
Type
,
"The storage backend for persistence. Options: 'etcd
2' (default), 'etcd3
'."
)
"The storage backend for persistence. Options: 'etcd
3' (default), 'etcd2
'."
)
fs
.
IntVar
(
&
s
.
StorageConfig
.
DeserializationCacheSize
,
"deserialization-cache-size"
,
s
.
StorageConfig
.
DeserializationCacheSize
,
"Number of deserialized json objects to cache in memory."
)
...
...
pkg/storage/storagebackend/config.go
View file @
498a893f
...
...
@@ -26,7 +26,7 @@ const (
// Config is configuration for creating a storage backend.
type
Config
struct
{
// Type defines the type of storage backend, e.g. "etcd2", etcd3". Default ("") is "etcd
2
".
// Type defines the type of storage backend, e.g. "etcd2", etcd3". Default ("") is "etcd
3
".
Type
string
// Prefix is the prefix to all keys passed to storage.Interface methods.
Prefix
string
...
...
pkg/storage/storagebackend/factory/factory.go
View file @
498a893f
...
...
@@ -29,9 +29,9 @@ type DestroyFunc func()
// Create creates a storage backend based on given config.
func
Create
(
c
storagebackend
.
Config
)
(
storage
.
Interface
,
DestroyFunc
,
error
)
{
switch
c
.
Type
{
case
storagebackend
.
StorageType
Unset
,
storagebackend
.
StorageType
ETCD2
:
case
storagebackend
.
StorageTypeETCD2
:
return
newETCD2Storage
(
c
)
case
storagebackend
.
StorageTypeETCD3
:
case
storagebackend
.
StorageType
Unset
,
storagebackend
.
StorageType
ETCD3
:
// TODO: We have the following features to implement:
// - Support secure connection by using key, cert, and CA files.
// - Honor "https" scheme to support secure connection in gRPC.
...
...
test/e2e_node/services/apiserver.go
View file @
498a893f
...
...
@@ -42,6 +42,10 @@ func NewAPIServer() *APIServer {
func
(
a
*
APIServer
)
Start
()
error
{
config
:=
options
.
NewServerRunOptions
()
config
.
Etcd
.
StorageConfig
.
ServerList
=
[]
string
{
getEtcdClientURL
()}
// TODO: Current setup of etcd in e2e-node tests doesn't support etcd v3
// protocol. We should migrate it to use the same infrastructure as all
// other tests (pkg/storage/etcd/testing).
config
.
Etcd
.
StorageConfig
.
Type
=
"etcd2"
_
,
ipnet
,
err
:=
net
.
ParseCIDR
(
clusterIPRange
)
if
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment