1 /* 2 Copyright 2018 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package config 18 19 import ( 20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 21 ) 22 23 // ClientConnectionConfiguration contains details for constructing a client. 24 type ClientConnectionConfiguration struct { 25 // kubeconfig is the path to a KubeConfig file. 26 Kubeconfig string 27 // acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the 28 // default value of 'application/json'. This field will control all connections to the server used by a particular 29 // client. 30 AcceptContentTypes string 31 // contentType is the content type used when sending data to the server from this client. 32 ContentType string 33 // qps controls the number of queries per second allowed for this connection. 34 QPS float32 35 // burst allows extra queries to accumulate when a client is exceeding its rate. 36 Burst int32 37 } 38 39 // LeaderElectionConfiguration defines the configuration of leader election 40 // clients for components that can run with leader election enabled. 41 type LeaderElectionConfiguration struct { 42 // leaderElect enables a leader election client to gain leadership 43 // before executing the main loop. Enable this when running replicated 44 // components for high availability. 45 LeaderElect bool 46 // leaseDuration is the duration that non-leader candidates will wait 47 // after observing a leadership renewal until attempting to acquire 48 // leadership of a led but unrenewed leader slot. This is effectively the 49 // maximum duration that a leader can be stopped before it is replaced 50 // by another candidate. This is only applicable if leader election is 51 // enabled. 52 LeaseDuration metav1.Duration 53 // renewDeadline is the interval between attempts by the acting master to 54 // renew a leadership slot before it stops leading. This must be less 55 // than or equal to the lease duration. This is only applicable if leader 56 // election is enabled. 57 RenewDeadline metav1.Duration 58 // retryPeriod is the duration the clients should wait between attempting 59 // acquisition and renewal of a leadership. This is only applicable if 60 // leader election is enabled. 61 RetryPeriod metav1.Duration 62 // resourceLock indicates the resource object type that will be used to lock 63 // during leader election cycles. 64 ResourceLock string 65 // resourceName indicates the name of resource object that will be used to lock 66 // during leader election cycles. 67 ResourceName string 68 // resourceNamespace indicates the namespace of resource object that will be used to lock 69 // during leader election cycles. 70 ResourceNamespace string 71 } 72 73 // DebuggingConfiguration holds configuration for Debugging related features. 74 type DebuggingConfiguration struct { 75 // enableProfiling enables profiling via web interface host:port/debug/pprof/ 76 EnableProfiling bool 77 // enableContentionProfiling enables block profiling, if 78 // enableProfiling is true. 79 EnableContentionProfiling bool 80 } 81