mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
update api types
This commit is contained in:
parent
76f8a800ed
commit
60c5db5e87
@ -21,41 +21,53 @@ import "k8s.io/kubernetes/pkg/api/unversioned"
|
|||||||
type KubeProxyConfiguration struct {
|
type KubeProxyConfiguration struct {
|
||||||
unversioned.TypeMeta
|
unversioned.TypeMeta
|
||||||
|
|
||||||
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0 for all interfaces)
|
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
|
||||||
|
// for all interfaces)
|
||||||
BindAddress string `json:"bindAddress"`
|
BindAddress string `json:"bindAddress"`
|
||||||
// cleanupIPTables
|
// healthzBindAddress is the IP address for the health check server to serve on,
|
||||||
CleanupIPTables bool `json:"cleanupIPTables"`
|
// defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces)
|
||||||
// healthzBindAddress is the IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces)
|
|
||||||
HealthzBindAddress string `json:"healthzBindAddress"`
|
HealthzBindAddress string `json:"healthzBindAddress"`
|
||||||
// healthzPort is the port to bind the health check server. Use 0 to disable.
|
// healthzPort is the port to bind the health check server. Use 0 to disable.
|
||||||
HealthzPort int `json:"healthzPort"`
|
HealthzPort int `json:"healthzPort"`
|
||||||
// hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname.
|
// hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname.
|
||||||
HostnameOverride string `json:"hostnameOverride"`
|
HostnameOverride string `json:"hostnameOverride"`
|
||||||
// iptablesSyncPeriodSeconds is the period that iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.
|
// iptablesSyncPeriod is the period that iptables rules are refreshed (e.g. '5s', '1m',
|
||||||
IPTablesSyncePeriodSeconds int `json:"iptablesSyncPeriodSeconds"`
|
// '2h22m'). Must be greater than 0.
|
||||||
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver
|
IPTablesSyncPeriod unversioned.Duration `json:"iptablesSyncPeriodSeconds"`
|
||||||
KubeAPIBurst int `json:"kubeAPIBurst"`
|
// kubeconfigPath is the path to the kubeconfig file with authorization information (the
|
||||||
// kubeAPIQPS is the max QPS to use while talking with kubernetes apiserver
|
// master location is set by the master flag).
|
||||||
KubeAPIQPS int `json:"kubeAPIQPS"`
|
|
||||||
// kubeconfigPath is the path to the kubeconfig file with authorization information (the master location is set by the master flag).
|
|
||||||
KubeconfigPath string `json:"kubeconfigPath"`
|
KubeconfigPath string `json:"kubeconfigPath"`
|
||||||
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.
|
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.
|
||||||
MasqueradeAll bool `json:"masqueradeAll"`
|
MasqueradeAll bool `json:"masqueradeAll"`
|
||||||
// master is the address of the Kubernetes API server (overrides any value in kubeconfig)
|
// master is the address of the Kubernetes API server (overrides any value in kubeconfig)
|
||||||
Master string `json:"master"`
|
Master string `json:"master"`
|
||||||
// oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]
|
// oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within
|
||||||
|
// the range [-1000, 1000]
|
||||||
OOMScoreAdj *int `json:"oomScoreAdj"`
|
OOMScoreAdj *int `json:"oomScoreAdj"`
|
||||||
// mode specifies which proxy mode to use.
|
// mode specifies which proxy mode to use.
|
||||||
Mode ProxyMode `json:"mode"`
|
Mode ProxyMode `json:"mode"`
|
||||||
// portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen.
|
// portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed
|
||||||
|
// in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen.
|
||||||
PortRange string `json:"portRange"`
|
PortRange string `json:"portRange"`
|
||||||
// resourceContainer is the bsolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy).
|
// resourceContainer is the bsolute name of the resource-only container to create and run
|
||||||
|
// the Kube-proxy in (Default: /kube-proxy).
|
||||||
ResourceContainer string `json:"resourceContainer"`
|
ResourceContainer string `json:"resourceContainer"`
|
||||||
// udpTimeoutMilliseconds is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxyMode=userspace.
|
// udpIdleTimeout is how long an idle UDP connection will be kept open (e.g. '250ms', '2s').
|
||||||
UDPTimeoutMilliseconds int `json:"udpTimeoutMilliseconds"`
|
// Must be greater than 0. Only applicable for proxyMode=userspace.
|
||||||
|
UDPIdleTimeout unversioned.Duration `json:"udpTimeoutMilliseconds"`
|
||||||
|
// conntrackMax is the maximum number of NAT connections to track (0 to leave as-is)")
|
||||||
|
ConntrackMax int `json:"conntrackMax"`
|
||||||
|
// conntrackTCPEstablishedTimeout is how long an idle UDP connection will be kept open
|
||||||
|
// (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxyMode is Userspace
|
||||||
|
ConntrackTCPEstablishedTimeout unversioned.Duration `json:"conntrackTCPEstablishedTimeout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.
|
// Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables'
|
||||||
|
// (experimental). If blank, look at the Node object on the Kubernetes API and respect the
|
||||||
|
// 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the
|
||||||
|
// best-available proxy (currently userspace, but may change in future versions). If the
|
||||||
|
// iptables proxy is selected, regardless of how, but the system's kernel or iptables
|
||||||
|
// versions are insufficient, this always falls back to the userspace proxy.
|
||||||
type ProxyMode string
|
type ProxyMode string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -17,6 +17,9 @@ limitations under the License.
|
|||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/qos"
|
"k8s.io/kubernetes/pkg/kubelet/qos"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
)
|
)
|
||||||
@ -37,8 +40,8 @@ func addDefaultingFuncs(scheme *runtime.Scheme) {
|
|||||||
temp := int32(qos.KubeProxyOOMScoreAdj)
|
temp := int32(qos.KubeProxyOOMScoreAdj)
|
||||||
obj.OOMScoreAdj = &temp
|
obj.OOMScoreAdj = &temp
|
||||||
}
|
}
|
||||||
if obj.IPTablesSyncePeriodSeconds == 0 {
|
if obj.IPTablesSyncPeriod.Duration == 0 {
|
||||||
obj.IPTablesSyncePeriodSeconds = 5
|
obj.IPTablesSyncPeriod = unversioned.Duration{5 * time.Second}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -21,41 +21,53 @@ import "k8s.io/kubernetes/pkg/api/unversioned"
|
|||||||
type KubeProxyConfiguration struct {
|
type KubeProxyConfiguration struct {
|
||||||
unversioned.TypeMeta
|
unversioned.TypeMeta
|
||||||
|
|
||||||
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0 for all int32erfaces)
|
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
|
||||||
|
// for all interfaces)
|
||||||
BindAddress string `json:"bindAddress"`
|
BindAddress string `json:"bindAddress"`
|
||||||
// cleanupIPTables
|
// healthzBindAddress is the IP address for the health check server to serve on,
|
||||||
CleanupIPTables bool `json:"cleanupIPTables"`
|
// defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces)
|
||||||
// healthzBindAddress is the IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all int32erfaces)
|
|
||||||
HealthzBindAddress string `json:"healthzBindAddress"`
|
HealthzBindAddress string `json:"healthzBindAddress"`
|
||||||
// healthzPort is the port to bind the health check server. Use 0 to disable.
|
// healthzPort is the port to bind the health check server. Use 0 to disable.
|
||||||
HealthzPort int32 `json:"healthzPort"`
|
HealthzPort int32 `json:"healthzPort"`
|
||||||
// hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname.
|
// hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname.
|
||||||
HostnameOverride string `json:"hostnameOverride"`
|
HostnameOverride string `json:"hostnameOverride"`
|
||||||
// iptablesSyncPeriodSeconds is the period that iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.
|
// iptablesSyncPeriod is the period that iptables rules are refreshed (e.g. '5s', '1m',
|
||||||
IPTablesSyncePeriodSeconds int32 `json:"iptablesSyncPeriodSeconds"`
|
// '2h22m'). Must be greater than 0.
|
||||||
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver
|
IPTablesSyncPeriod unversioned.Duration `json:"iptablesSyncPeriodSeconds"`
|
||||||
KubeAPIBurst int32 `json:"kubeAPIBurst"`
|
// kubeconfigPath is the path to the kubeconfig file with authorization information (the
|
||||||
// kubeAPIQPS is the max QPS to use while talking with kubernetes apiserver
|
// master location is set by the master flag).
|
||||||
KubeAPIQPS int32 `json:"kubeAPIQPS"`
|
|
||||||
// kubeconfigPath is the path to the kubeconfig file with authorization information (the master location is set by the master flag).
|
|
||||||
KubeconfigPath string `json:"kubeconfigPath"`
|
KubeconfigPath string `json:"kubeconfigPath"`
|
||||||
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.
|
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.
|
||||||
MasqueradeAll bool `json:"masqueradeAll"`
|
MasqueradeAll bool `json:"masqueradeAll"`
|
||||||
// master is the address of the Kubernetes API server (overrides any value in kubeconfig)
|
// master is the address of the Kubernetes API server (overrides any value in kubeconfig)
|
||||||
Master string `json:"master"`
|
Master string `json:"master"`
|
||||||
// oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]
|
// oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within
|
||||||
|
// the range [-1000, 1000]
|
||||||
OOMScoreAdj *int32 `json:"oomScoreAdj"`
|
OOMScoreAdj *int32 `json:"oomScoreAdj"`
|
||||||
// mode specifies which proxy mode to use.
|
// mode specifies which proxy mode to use.
|
||||||
Mode ProxyMode `json:"mode"`
|
Mode ProxyMode `json:"mode"`
|
||||||
// portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen.
|
// portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed
|
||||||
|
// in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen.
|
||||||
PortRange string `json:"portRange"`
|
PortRange string `json:"portRange"`
|
||||||
// resourceContainer is the bsolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy).
|
// resourceContainer is the bsolute name of the resource-only container to create and run
|
||||||
|
// the Kube-proxy in (Default: /kube-proxy).
|
||||||
ResourceContainer string `json:"resourceContainer"`
|
ResourceContainer string `json:"resourceContainer"`
|
||||||
// udpTimeoutMilliseconds is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxyMode=userspace.
|
// udpIdleTimeout is how long an idle UDP connection will be kept open (e.g. '250ms', '2s').
|
||||||
UDPTimeoutMilliseconds int32 `json:"udpTimeoutMilliseconds"`
|
// Must be greater than 0. Only applicable for proxyMode=userspace.
|
||||||
|
UDPIdleTimeout unversioned.Duration `json:"udpTimeoutMilliseconds"`
|
||||||
|
// conntrackMax is the maximum number of NAT connections to track (0 to leave as-is)")
|
||||||
|
ConntrackMax int32 `json:"conntrackMax"`
|
||||||
|
// conntrackTCPEstablishedTimeout is how long an idle UDP connection will be kept open
|
||||||
|
// (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxyMode is Userspace
|
||||||
|
ConntrackTCPEstablishedTimeout unversioned.Duration `json:"conntrackTCPEstablishedTimeout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.
|
// Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables'
|
||||||
|
// (experimental). If blank, look at the Node object on the Kubernetes API and respect the
|
||||||
|
// 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the
|
||||||
|
// best-available proxy (currently userspace, but may change in future versions). If the
|
||||||
|
// iptables proxy is selected, regardless of how, but the system's kernel or iptables
|
||||||
|
// versions are insufficient, this always falls back to the userspace proxy.
|
||||||
type ProxyMode string
|
type ProxyMode string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
Reference in New Issue
Block a user