config.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Copyright 2016 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package storagebackend
  14. import "k8s.io/kubernetes/pkg/runtime"
  15. const (
  16. StorageTypeUnset = ""
  17. StorageTypeETCD2 = "etcd2"
  18. StorageTypeETCD3 = "etcd3"
  19. )
  20. // Config is configuration for creating a storage backend.
  21. type Config struct {
  22. // Type defines the type of storage backend, e.g. "etcd2", etcd3". Default ("") is "etcd2".
  23. Type string
  24. // Prefix is the prefix to all keys passed to storage.Interface methods.
  25. Prefix string
  26. // ServerList is the list of storage servers to connect with.
  27. ServerList []string
  28. // TLS credentials
  29. KeyFile string
  30. CertFile string
  31. CAFile string
  32. // Quorum indicates that whether read operations should be quorum-level consistent.
  33. Quorum bool
  34. // DeserializationCacheSize is the size of cache of deserialized objects.
  35. // Currently this is only supported in etcd2.
  36. // We will drop the cache once using protobuf.
  37. DeserializationCacheSize int
  38. Codec runtime.Codec
  39. }