|
| 1 | +/* |
| 2 | +Copyright 2022 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 options |
| 18 | + |
| 19 | +import ( |
| 20 | + cliflag "k8s.io/component-base/cli/flag" |
| 21 | +) |
| 22 | + |
| 23 | +// Flags returns flags for a specific APIServer by section name |
| 24 | +func (s *ServerRunOptions) Flags() (fss cliflag.NamedFlagSets) { |
| 25 | + s.GenericServerRunOptions.AddUniversalFlags(fss.FlagSet("generic")) |
| 26 | + s.Etcd.AddFlags(fss.FlagSet("etcd")) |
| 27 | + s.SecureServing.AddFlags(fss.FlagSet("secure serving")) |
| 28 | + s.Audit.AddFlags(fss.FlagSet("auditing")) |
| 29 | + s.Features.AddFlags(fss.FlagSet("features")) |
| 30 | + s.Authentication.AddFlags(fss.FlagSet("authentication")) |
| 31 | + |
| 32 | + s.APIEnablement.AddFlags(fss.FlagSet("API enablement")) |
| 33 | + s.EgressSelector.AddFlags(fss.FlagSet("egress selector")) |
| 34 | + s.Admission.AddFlags(fss.FlagSet("admission")) |
| 35 | + |
| 36 | + s.Metrics.AddFlags(fss.FlagSet("metrics")) |
| 37 | + s.Logs.AddFlags(fss.FlagSet("logs")) |
| 38 | + s.Traces.AddFlags(fss.FlagSet("traces")) |
| 39 | + |
| 40 | + fs := fss.FlagSet("misc") |
| 41 | + fs.DurationVar(&s.EventTTL, "event-ttl", s.EventTTL, |
| 42 | + "Amount of time to retain events.") |
| 43 | + |
| 44 | + fs.BoolVar(&s.EnableLogsHandler, "enable-logs-handler", s.EnableLogsHandler, |
| 45 | + "If true, install a /logs handler for the apiserver logs.") |
| 46 | + fs.MarkDeprecated("enable-logs-handler", "This flag will be removed in v1.19") //nolint:golint,errcheck |
| 47 | + |
| 48 | + fs.Int64Var(&s.MaxConnectionBytesPerSec, "max-connection-bytes-per-sec", s.MaxConnectionBytesPerSec, ""+ |
| 49 | + "If non-zero, throttle each user connection to this number of bytes/sec. "+ |
| 50 | + "Currently only applies to long-running requests.") |
| 51 | + |
| 52 | + fs.IntVar(&s.IdentityLeaseDurationSeconds, "identity-lease-duration-seconds", s.IdentityLeaseDurationSeconds, |
| 53 | + "The duration of kube-apiserver lease in seconds, must be a positive number. (In use when the APIServerIdentity feature gate is enabled.)") |
| 54 | + |
| 55 | + fs.IntVar(&s.IdentityLeaseRenewIntervalSeconds, "identity-lease-renew-interval-seconds", s.IdentityLeaseRenewIntervalSeconds, |
| 56 | + "The interval of kube-apiserver renewing its lease in seconds, must be a positive number. (In use when the APIServerIdentity feature gate is enabled.)") |
| 57 | + |
| 58 | + fs.StringVar(&s.ProxyClientCertFile, "proxy-client-cert-file", s.ProxyClientCertFile, ""+ |
| 59 | + "Client certificate used to prove the identity of the aggregator or kube-apiserver "+ |
| 60 | + "when it must call out during a request. This includes proxying requests to a user "+ |
| 61 | + "api-server and calling out to webhook admission plugins. It is expected that this "+ |
| 62 | + "cert includes a signature from the CA in the --requestheader-client-ca-file flag. "+ |
| 63 | + "That CA is published in the 'extension-apiserver-authentication' configmap in "+ |
| 64 | + "the kube-system namespace. Components receiving calls from kube-aggregator should "+ |
| 65 | + "use that CA to perform their half of the mutual TLS verification.") |
| 66 | + fs.StringVar(&s.ProxyClientKeyFile, "proxy-client-key-file", s.ProxyClientKeyFile, ""+ |
| 67 | + "Private key for the client certificate used to prove the identity of the aggregator or kube-apiserver "+ |
| 68 | + "when it must call out during a request. This includes proxying requests to a user "+ |
| 69 | + "api-server and calling out to webhook admission plugins.") |
| 70 | + |
| 71 | + return fss |
| 72 | +} |
0 commit comments