1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-11 03:32:45 +00:00

Add priority class name to addons

This commit is contained in:
Steven Crespo 2021-02-04 13:05:35 -08:00
parent 3c2c508492
commit 68453acb6e
4 changed files with 228 additions and 175 deletions

View File

@ -43,6 +43,11 @@ const (
KubeAPIAuthAppName = "kube-api-auth" KubeAPIAuthAppName = "kube-api-auth"
CattleClusterAgentAppName = "cattle-cluster-agent" CattleClusterAgentAppName = "cattle-cluster-agent"
CoreDNSPriorityClassNameKey = "coredns_priority_class_name"
CoreDNSAutoscalerPriorityClassNameKey = "coredns_autoscaler_priority_class_name"
KubeDNSPriorityClassNameKey = "kube_dns_priority_class_name"
KubeDNSAutoscalerPriorityClassNameKey = "kube_dns_autoscaler_priority_class_name"
CoreDNSProvider = "coredns" CoreDNSProvider = "coredns"
KubeDNSProvider = "kube-dns" KubeDNSProvider = "kube-dns"
Nodelocal = "nodelocal" Nodelocal = "nodelocal"
@ -55,75 +60,83 @@ const (
var DNSProviders = []string{KubeDNSProvider, CoreDNSProvider} var DNSProviders = []string{KubeDNSProvider, CoreDNSProvider}
type ingressOptions struct { type ingressOptions struct {
RBACConfig string RBACConfig string
Options map[string]string Options map[string]string
NodeSelector map[string]string NodeSelector map[string]string
ExtraArgs map[string]string ExtraArgs map[string]string
ExtraEnvs []v3.ExtraEnv ExtraEnvs []v3.ExtraEnv
ExtraVolumes []v3.ExtraVolume ExtraVolumes []v3.ExtraVolume
ExtraVolumeMounts []v3.ExtraVolumeMount ExtraVolumeMounts []v3.ExtraVolumeMount
DNSPolicy string DNSPolicy string
AlpineImage string AlpineImage string
IngressImage string IngressImage string
IngressBackend string IngressBackend string
HTTPPort int HTTPPort int
HTTPSPort int HTTPSPort int
NetworkMode string NetworkMode string
DefaultBackend bool DefaultBackend bool
UpdateStrategy *appsv1.DaemonSetUpdateStrategy UpdateStrategy *appsv1.DaemonSetUpdateStrategy
Tolerations []v1.Toleration Tolerations []v1.Toleration
NginxIngressControllerPriorityClassName string
DefaultHTTPBackendPriorityClassName string
} }
type MetricsServerOptions struct { type MetricsServerOptions struct {
RBACConfig string RBACConfig string
Options map[string]string Options map[string]string
NodeSelector map[string]string NodeSelector map[string]string
MetricsServerImage string MetricsServerImage string
Version string Version string
UpdateStrategy *appsv1.DeploymentStrategy UpdateStrategy *appsv1.DeploymentStrategy
Replicas *int32 Replicas *int32
Tolerations []v1.Toleration Tolerations []v1.Toleration
MetricsServerPriorityClassName string
} }
type CoreDNSOptions struct { type CoreDNSOptions struct {
RBACConfig string RBACConfig string
CoreDNSImage string CoreDNSImage string
CoreDNSAutoScalerImage string CoreDNSAutoScalerImage string
ClusterDomain string ClusterDomain string
ClusterDNSServer string ClusterDNSServer string
ReverseCIDRs []string ReverseCIDRs []string
UpstreamNameservers []string UpstreamNameservers []string
NodeSelector map[string]string NodeSelector map[string]string
UpdateStrategy *appsv1.DeploymentStrategy UpdateStrategy *appsv1.DeploymentStrategy
LinearAutoscalerParams string LinearAutoscalerParams string
Tolerations []v1.Toleration Tolerations []v1.Toleration
CoreDNSPriorityClassName string
CoreDNSAutoscalerPriorityClassName string
} }
type KubeDNSOptions struct { type KubeDNSOptions struct {
RBACConfig string RBACConfig string
KubeDNSImage string KubeDNSImage string
DNSMasqImage string DNSMasqImage string
KubeDNSAutoScalerImage string KubeDNSAutoScalerImage string
KubeDNSSidecarImage string KubeDNSSidecarImage string
ClusterDomain string ClusterDomain string
ClusterDNSServer string ClusterDNSServer string
ReverseCIDRs []string ReverseCIDRs []string
UpstreamNameservers []string UpstreamNameservers []string
StubDomains map[string][]string StubDomains map[string][]string
NodeSelector map[string]string NodeSelector map[string]string
UpdateStrategy *appsv1.DeploymentStrategy UpdateStrategy *appsv1.DeploymentStrategy
LinearAutoscalerParams string LinearAutoscalerParams string
Tolerations []v1.Toleration Tolerations []v1.Toleration
KubeDNSPriorityClassName string
KubeDNSAutoscalerPriorityClassName string
} }
type NodelocalOptions struct { type NodelocalOptions struct {
RBACConfig string RBACConfig string
NodelocalImage string NodelocalImage string
ClusterDomain string ClusterDomain string
ClusterDNSServer string ClusterDNSServer string
IPAddress string IPAddress string
NodeSelector map[string]string NodeSelector map[string]string
UpdateStrategy *appsv1.DaemonSetUpdateStrategy UpdateStrategy *appsv1.DaemonSetUpdateStrategy
NodeLocalDNSPriorityClassName string
} }
type addonError struct { type addonError struct {
@ -331,7 +344,9 @@ func (c *Cluster) deployKubeDNS(ctx context.Context, data map[string]interface{}
Type: c.DNS.UpdateStrategy.Strategy, Type: c.DNS.UpdateStrategy.Strategy,
RollingUpdate: c.DNS.UpdateStrategy.RollingUpdate, RollingUpdate: c.DNS.UpdateStrategy.RollingUpdate,
}, },
Tolerations: c.DNS.Tolerations, Tolerations: c.DNS.Tolerations,
KubeDNSPriorityClassName: c.DNS.Options[KubeDNSPriorityClassNameKey],
KubeDNSAutoscalerPriorityClassName: c.DNS.Options[KubeDNSAutoscalerPriorityClassNameKey],
} }
linearModeBytes, err := json.Marshal(c.DNS.LinearAutoscalerParams) linearModeBytes, err := json.Marshal(c.DNS.LinearAutoscalerParams)
if err != nil { if err != nil {
@ -368,7 +383,9 @@ func (c *Cluster) deployCoreDNS(ctx context.Context, data map[string]interface{}
Type: c.DNS.UpdateStrategy.Strategy, Type: c.DNS.UpdateStrategy.Strategy,
RollingUpdate: c.DNS.UpdateStrategy.RollingUpdate, RollingUpdate: c.DNS.UpdateStrategy.RollingUpdate,
}, },
Tolerations: c.DNS.Tolerations, Tolerations: c.DNS.Tolerations,
CoreDNSPriorityClassName: c.DNS.Options[CoreDNSPriorityClassNameKey],
CoreDNSAutoscalerPriorityClassName: c.DNS.Options[CoreDNSAutoscalerPriorityClassNameKey],
} }
linearModeBytes, err := json.Marshal(c.DNS.LinearAutoscalerParams) linearModeBytes, err := json.Marshal(c.DNS.LinearAutoscalerParams)
if err != nil { if err != nil {
@ -422,8 +439,9 @@ func (c *Cluster) deployMetricServer(ctx context.Context, data map[string]interf
Type: c.Monitoring.UpdateStrategy.Strategy, Type: c.Monitoring.UpdateStrategy.Strategy,
RollingUpdate: c.Monitoring.UpdateStrategy.RollingUpdate, RollingUpdate: c.Monitoring.UpdateStrategy.RollingUpdate,
}, },
Replicas: c.Monitoring.Replicas, Replicas: c.Monitoring.Replicas,
Tolerations: c.Monitoring.Tolerations, Tolerations: c.Monitoring.Tolerations,
MetricsServerPriorityClassName: c.Monitoring.MetricsServerPriorityClassName,
} }
tmplt, err := templates.GetVersionedTemplates(kdm.MetricsServer, data, c.Version) tmplt, err := templates.GetVersionedTemplates(kdm.MetricsServer, data, c.Version)
if err != nil { if err != nil {
@ -587,7 +605,9 @@ func (c *Cluster) deployIngress(ctx context.Context, data map[string]interface{}
Type: c.Ingress.UpdateStrategy.Strategy, Type: c.Ingress.UpdateStrategy.Strategy,
RollingUpdate: c.Ingress.UpdateStrategy.RollingUpdate, RollingUpdate: c.Ingress.UpdateStrategy.RollingUpdate,
}, },
Tolerations: c.Ingress.Tolerations, Tolerations: c.Ingress.Tolerations,
NginxIngressControllerPriorityClassName: c.Ingress.NginxIngressControllerPriorityClassName,
DefaultHTTPBackendPriorityClassName: c.Ingress.DefaultHTTPBackendPriorityClassName,
} }
// since nginx ingress controller 0.16.0, it can be run as non-root and doesn't require privileged anymore. // since nginx ingress controller 0.16.0, it can be run as non-root and doesn't require privileged anymore.
// So we can use securityContext instead of setting privileges via initContainer. // So we can use securityContext instead of setting privileges via initContainer.
@ -716,12 +736,13 @@ func (c *Cluster) deployDNS(ctx context.Context, data map[string]interface{}) er
func (c *Cluster) deployNodelocal(ctx context.Context, data map[string]interface{}) error { func (c *Cluster) deployNodelocal(ctx context.Context, data map[string]interface{}) error {
log.Infof(ctx, "[dns] Setting up %s", Nodelocal) log.Infof(ctx, "[dns] Setting up %s", Nodelocal)
NodelocalConfig := NodelocalOptions{ NodelocalConfig := NodelocalOptions{
NodelocalImage: c.SystemImages.Nodelocal, NodelocalImage: c.SystemImages.Nodelocal,
RBACConfig: c.Authorization.Mode, RBACConfig: c.Authorization.Mode,
ClusterDomain: c.ClusterDomain, ClusterDomain: c.ClusterDomain,
ClusterDNSServer: c.ClusterDNSServer, ClusterDNSServer: c.ClusterDNSServer,
IPAddress: c.DNS.Nodelocal.IPAddress, IPAddress: c.DNS.Nodelocal.IPAddress,
NodeSelector: c.DNS.Nodelocal.NodeSelector, NodeSelector: c.DNS.Nodelocal.NodeSelector,
NodeLocalDNSPriorityClassName: c.DNS.Nodelocal.NodeLocalDNSPriorityClassName,
} }
if c.DNS.Nodelocal.UpdateStrategy != nil { if c.DNS.Nodelocal.UpdateStrategy != nil {
NodelocalConfig.UpdateStrategy = &appsv1.DaemonSetUpdateStrategy{ NodelocalConfig.UpdateStrategy = &appsv1.DaemonSetUpdateStrategy{

View File

@ -557,6 +557,10 @@ func (c *Cluster) setClusterDNSDefaults() error {
} }
c.DNS.Provider = ClusterDNSProvider c.DNS.Provider = ClusterDNSProvider
logrus.Debugf("DNS provider set to [%s]", ClusterDNSProvider) logrus.Debugf("DNS provider set to [%s]", ClusterDNSProvider)
if c.DNS.Options == nil {
// don't break if the user didn't define options
c.DNS.Options = make(map[string]string)
}
return nil return nil
} }

View File

@ -53,13 +53,16 @@ const (
// FlannelBackendPort must be 4789 if using VxLan mode in the cluster with Windows nodes // FlannelBackendPort must be 4789 if using VxLan mode in the cluster with Windows nodes
FlannelBackendPort = "flannel_backend_port" FlannelBackendPort = "flannel_backend_port"
// FlannelBackendVxLanNetworkIdentify should be greater than or equal to 4096 if using VxLan mode in the cluster with Windows nodes // FlannelBackendVxLanNetworkIdentify should be greater than or equal to 4096 if using VxLan mode in the cluster with Windows nodes
FlannelBackendVxLanNetworkIdentify = "flannel_backend_vni" FlannelBackendVxLanNetworkIdentify = "flannel_backend_vni"
KubeFlannelPriorityClassNameKeyName = "kube_flannel_priority_class_name"
CalicoNetworkPlugin = "calico" CalicoNetworkPlugin = "calico"
CalicoNodeLabel = "calico-node" CalicoNodeLabel = "calico-node"
CalicoControllerLabel = "calico-kube-controllers" CalicoControllerLabel = "calico-kube-controllers"
CalicoCloudProvider = "calico_cloud_provider" CalicoCloudProvider = "calico_cloud_provider"
CalicoFlexVolPluginDirectory = "calico_flex_volume_plugin_dir" CalicoFlexVolPluginDirectory = "calico_flex_volume_plugin_dir"
CalicoNodePriorityClassNameKeyName = "calico_node_priority_class_name"
CalicoKubeControllersPriorityClassNameKeyName = "calico_kube_controllers_priority_class_name"
CanalNetworkPlugin = "canal" CanalNetworkPlugin = "canal"
CanalIface = "canal_iface" CanalIface = "canal_iface"
@ -69,9 +72,11 @@ const (
// CanalFlannelBackendVxLanNetworkIdentify should be greater than or equal to 4096 if using Flannel VxLan mode in the cluster with Windows nodes // CanalFlannelBackendVxLanNetworkIdentify should be greater than or equal to 4096 if using Flannel VxLan mode in the cluster with Windows nodes
CanalFlannelBackendVxLanNetworkIdentify = "canal_flannel_backend_vni" CanalFlannelBackendVxLanNetworkIdentify = "canal_flannel_backend_vni"
CanalFlexVolPluginDirectory = "canal_flex_volume_plugin_dir" CanalFlexVolPluginDirectory = "canal_flex_volume_plugin_dir"
CanalPriorityClassNameKeyName = "canal_priority_class_name"
WeaveNetworkPlugin = "weave" WeaveNetworkPlugin = "weave"
WeaveNetworkAppName = "weave-net" WeaveNetworkAppName = "weave-net"
WeaveNetPriorityClassNameKeyName = "weave_net_priority_class_name"
AciNetworkPlugin = "aci" AciNetworkPlugin = "aci"
AciOVSMemoryLimit = "aci_ovs_memory_limit" AciOVSMemoryLimit = "aci_ovs_memory_limit"
@ -168,97 +173,102 @@ const (
Calicoctl = "Calicoctl" Calicoctl = "Calicoctl"
FlannelInterface = "FlannelInterface" FlannelInterface = "FlannelInterface"
FlannelBackend = "FlannelBackend" FlannelBackend = "FlannelBackend"
CanalInterface = "CanalInterface" KubeFlannelPriorityClassName = "KubeFlannelPriorityClassName"
FlexVolPluginDir = "FlexVolPluginDir" CalicoNodePriorityClassName = "CalicoNodePriorityClassName"
WeavePassword = "WeavePassword" CalicoKubeControllersPriorityClassName = "CalicoKubeControllersPriorityClassName"
MTU = "MTU" CanalInterface = "CanalInterface"
RBACConfig = "RBACConfig" CanalPriorityClassName = "CanalPriorityClassName"
ClusterVersion = "ClusterVersion" FlexVolPluginDir = "FlexVolPluginDir"
SystemIdentifier = "SystemIdentifier" WeavePassword = "WeavePassword"
ApicHosts = "ApicHosts" WeaveNetPriorityClassName = "WeaveNetPriorityClassName"
Token = "Token" MTU = "MTU"
ApicUserName = "ApicUserName" RBACConfig = "RBACConfig"
ApicUserKey = "ApicUserKey" ClusterVersion = "ClusterVersion"
ApicUserCrt = "ApicUserCrt" SystemIdentifier = "SystemIdentifier"
ApicRefreshTime = "ApicRefreshTime" ApicHosts = "ApicHosts"
VmmDomain = "VmmDomain" Token = "Token"
VmmController = "VmmController" ApicUserName = "ApicUserName"
EncapType = "EncapType" ApicUserKey = "ApicUserKey"
McastRangeStart = "McastRangeStart" ApicUserCrt = "ApicUserCrt"
McastRangeEnd = "McastRangeEnd" ApicRefreshTime = "ApicRefreshTime"
AEP = "AEP" VmmDomain = "VmmDomain"
VRFName = "VRFName" VmmController = "VmmController"
VRFTenant = "VRFTenant" EncapType = "EncapType"
L3Out = "L3Out" McastRangeStart = "McastRangeStart"
L3OutExternalNetworks = "L3OutExternalNetworks" McastRangeEnd = "McastRangeEnd"
DynamicExternalSubnet = "DynamicExternalSubnet" AEP = "AEP"
StaticExternalSubnet = "StaticExternalSubnet" VRFName = "VRFName"
ServiceGraphSubnet = "ServiceGraphSubnet" VRFTenant = "VRFTenant"
KubeAPIVlan = "KubeAPIVlan" L3Out = "L3Out"
ServiceVlan = "ServiceVlan" L3OutExternalNetworks = "L3OutExternalNetworks"
InfraVlan = "InfraVlan" DynamicExternalSubnet = "DynamicExternalSubnet"
ImagePullPolicy = "ImagePullPolicy" StaticExternalSubnet = "StaticExternalSubnet"
ImagePullSecret = "ImagePullSecret" ServiceGraphSubnet = "ServiceGraphSubnet"
Tenant = "Tenant" KubeAPIVlan = "KubeAPIVlan"
ServiceMonitorInterval = "ServiceMonitorInterval" ServiceVlan = "ServiceVlan"
PBRTrackingNonSnat = "PBRTrackingNonSnat" InfraVlan = "InfraVlan"
InstallIstio = "InstallIstio" ImagePullPolicy = "ImagePullPolicy"
IstioProfile = "IstioProfile" ImagePullSecret = "ImagePullSecret"
DropLogEnable = "DropLogEnable" Tenant = "Tenant"
ControllerLogLevel = "ControllerLogLevel" ServiceMonitorInterval = "ServiceMonitorInterval"
HostAgentLogLevel = "HostAgentLogLevel" PBRTrackingNonSnat = "PBRTrackingNonSnat"
OpflexAgentLogLevel = "OpflexAgentLogLevel" InstallIstio = "InstallIstio"
AciCniDeployContainer = "AciCniDeployContainer" IstioProfile = "IstioProfile"
AciHostContainer = "AciHostContainer" DropLogEnable = "DropLogEnable"
AciOpflexContainer = "AciOpflexContainer" ControllerLogLevel = "ControllerLogLevel"
AciMcastContainer = "AciMcastContainer" HostAgentLogLevel = "HostAgentLogLevel"
AciOpenvSwitchContainer = "AciOpenvSwitchContainer" OpflexAgentLogLevel = "OpflexAgentLogLevel"
AciControllerContainer = "AciControllerContainer" AciCniDeployContainer = "AciCniDeployContainer"
AciGbpServerContainer = "AciGbpServerContainer" AciHostContainer = "AciHostContainer"
AciOpflexServerContainer = "AciOpflexServerContainer" AciOpflexContainer = "AciOpflexContainer"
StaticServiceIPStart = "StaticServiceIPStart" AciMcastContainer = "AciMcastContainer"
StaticServiceIPEnd = "StaticServiceIPEnd" AciOpenvSwitchContainer = "AciOpenvSwitchContainer"
PodGateway = "PodGateway" AciControllerContainer = "AciControllerContainer"
PodIPStart = "PodIPStart" AciGbpServerContainer = "AciGbpServerContainer"
PodIPEnd = "PodIPEnd" AciOpflexServerContainer = "AciOpflexServerContainer"
NodeServiceIPStart = "NodeServiceIPStart" StaticServiceIPStart = "StaticServiceIPStart"
NodeServiceIPEnd = "NodeServiceIPEnd" StaticServiceIPEnd = "StaticServiceIPEnd"
ServiceIPStart = "ServiceIPStart" PodGateway = "PodGateway"
ServiceIPEnd = "ServiceIPEnd" PodIPStart = "PodIPStart"
UseAciCniPriorityClass = "UseAciCniPriorityClass" PodIPEnd = "PodIPEnd"
NoPriorityClass = "NoPriorityClass" NodeServiceIPStart = "NodeServiceIPStart"
MaxNodesSvcGraph = "MaxNodesSvcGraph" NodeServiceIPEnd = "NodeServiceIPEnd"
SnatContractScope = "SnatContractScope" ServiceIPStart = "ServiceIPStart"
PodSubnetChunkSize = "PodSubnetChunkSize" ServiceIPEnd = "ServiceIPEnd"
EnableEndpointSlice = "EnableEndpointSlice" UseAciCniPriorityClass = "UseAciCniPriorityClass"
SnatNamespace = "SnatNamespace" NoPriorityClass = "NoPriorityClass"
EpRegistry = "EpRegistry" MaxNodesSvcGraph = "MaxNodesSvcGraph"
OpflexMode = "OpflexMode" SnatContractScope = "SnatContractScope"
SnatPortRangeStart = "SnatPortRangeStart" PodSubnetChunkSize = "PodSubnetChunkSize"
SnatPortRangeEnd = "SnatPortRangeEnd" EnableEndpointSlice = "EnableEndpointSlice"
SnatPortsPerNode = "SnatPortsPerNode" SnatNamespace = "SnatNamespace"
OpflexClientSSL = "OpflexClientSSL" EpRegistry = "EpRegistry"
UsePrivilegedContainer = "UsePrivilegedContainer" OpflexMode = "OpflexMode"
UseHostNetnsVolume = "UseHostNetnsVolume" SnatPortRangeStart = "SnatPortRangeStart"
UseOpflexServerVolume = "UseOpflexServerVolume" SnatPortRangeEnd = "SnatPortRangeEnd"
KafkaBrokers = "KafkaBrokers" SnatPortsPerNode = "SnatPortsPerNode"
KafkaClientCrt = "KafkaClientCrt" OpflexClientSSL = "OpflexClientSSL"
KafkaClientKey = "KafkaClientKey" UsePrivilegedContainer = "UsePrivilegedContainer"
SubnetDomainName = "SubnetDomainName" UseHostNetnsVolume = "UseHostNetnsVolume"
CApic = "CApic" UseOpflexServerVolume = "UseOpflexServerVolume"
UseAciAnywhereCRD = "UseAciAnywhereCRD" KafkaBrokers = "KafkaBrokers"
OverlayVRFName = "OverlayVRFName" KafkaClientCrt = "KafkaClientCrt"
GbpPodSubnet = "GbpPodSubnet" KafkaClientKey = "KafkaClientKey"
RunGbpContainer = "RunGbpContainer" SubnetDomainName = "SubnetDomainName"
RunOpflexServerContainer = "RunOpflexServerContainer" CApic = "CApic"
OpflexServerPort = "OpflexServerPort" UseAciAnywhereCRD = "UseAciAnywhereCRD"
OVSMemoryLimit = "OVSMemoryLimit" OverlayVRFName = "OverlayVRFName"
NodeSubnet = "NodeSubnet" GbpPodSubnet = "GbpPodSubnet"
NodeSelector = "NodeSelector" RunGbpContainer = "RunGbpContainer"
UpdateStrategy = "UpdateStrategy" RunOpflexServerContainer = "RunOpflexServerContainer"
Tolerations = "Tolerations" OpflexServerPort = "OpflexServerPort"
OVSMemoryLimit = "OVSMemoryLimit"
NodeSubnet = "NodeSubnet"
NodeSelector = "NodeSelector"
UpdateStrategy = "UpdateStrategy"
Tolerations = "Tolerations"
) )
var EtcdPortList = []string{ var EtcdPortList = []string{
@ -328,6 +338,7 @@ func (c *Cluster) doFlannelDeploy(ctx context.Context, data map[string]interface
Type: c.Network.UpdateStrategy.Strategy, Type: c.Network.UpdateStrategy.Strategy,
RollingUpdate: c.Network.UpdateStrategy.RollingUpdate, RollingUpdate: c.Network.UpdateStrategy.RollingUpdate,
}, },
KubeFlannelPriorityClassName: c.Network.Options[KubeFlannelPriorityClassNameKeyName],
} }
pluginYaml, err := c.getNetworkPluginManifest(flannelConfig, data) pluginYaml, err := c.getNetworkPluginManifest(flannelConfig, data)
if err != nil { if err != nil {
@ -355,8 +366,10 @@ func (c *Cluster) doCalicoDeploy(ctx context.Context, data map[string]interface{
Type: c.Network.UpdateStrategy.Strategy, Type: c.Network.UpdateStrategy.Strategy,
RollingUpdate: c.Network.UpdateStrategy.RollingUpdate, RollingUpdate: c.Network.UpdateStrategy.RollingUpdate,
}, },
FlexVolPluginDir: c.Network.Options[CalicoFlexVolPluginDirectory], Tolerations: c.Network.Tolerations,
Tolerations: c.Network.Tolerations, FlexVolPluginDir: c.Network.Options[CalicoFlexVolPluginDirectory],
CalicoNodePriorityClassName: c.Network.Options[CalicoNodePriorityClassNameKeyName],
CalicoKubeControllersPriorityClassName: c.Network.Options[CalicoKubeControllersPriorityClassNameKeyName],
} }
pluginYaml, err := c.getNetworkPluginManifest(calicoConfig, data) pluginYaml, err := c.getNetworkPluginManifest(calicoConfig, data)
if err != nil { if err != nil {
@ -401,8 +414,10 @@ func (c *Cluster) doCanalDeploy(ctx context.Context, data map[string]interface{}
Type: c.Network.UpdateStrategy.Strategy, Type: c.Network.UpdateStrategy.Strategy,
RollingUpdate: c.Network.UpdateStrategy.RollingUpdate, RollingUpdate: c.Network.UpdateStrategy.RollingUpdate,
}, },
FlexVolPluginDir: c.Network.Options[CanalFlexVolPluginDirectory], Tolerations: c.Network.Tolerations,
Tolerations: c.Network.Tolerations, FlexVolPluginDir: c.Network.Options[CanalFlexVolPluginDirectory],
CanalPriorityClassName: c.Network.Options[CanalPriorityClassNameKeyName],
CalicoKubeControllersPriorityClassName: c.Network.Options[CalicoKubeControllersPriorityClassNameKeyName],
} }
pluginYaml, err := c.getNetworkPluginManifest(canalConfig, data) pluginYaml, err := c.getNetworkPluginManifest(canalConfig, data)
if err != nil { if err != nil {
@ -425,6 +440,7 @@ func (c *Cluster) doWeaveDeploy(ctx context.Context, data map[string]interface{}
Type: c.Network.UpdateStrategy.Strategy, Type: c.Network.UpdateStrategy.Strategy,
RollingUpdate: c.Network.UpdateStrategy.RollingUpdate, RollingUpdate: c.Network.UpdateStrategy.RollingUpdate,
}, },
WeaveNetPriorityClassName: c.Network.Options[WeaveNetPriorityClassNameKeyName],
} }
pluginYaml, err := c.getNetworkPluginManifest(weaveConfig, data) pluginYaml, err := c.getNetworkPluginManifest(weaveConfig, data)
if err != nil { if err != nil {

View File

@ -421,7 +421,8 @@ type AuthzConfig struct {
type IngressConfig struct { type IngressConfig struct {
// Ingress controller type used by kubernetes // Ingress controller type used by kubernetes
Provider string `yaml:"provider" json:"provider,omitempty" norman:"default=nginx"` Provider string `yaml:"provider" json:"provider,omitempty" norman:"default=nginx"`
// Ingress controller options // These options are NOT for configuring Ingress's addon template.
// They are used for its ConfigMap options specifically.
Options map[string]string `yaml:"options" json:"options,omitempty"` Options map[string]string `yaml:"options" json:"options,omitempty"`
// NodeSelector key pair // NodeSelector key pair
NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"`
@ -447,6 +448,10 @@ type IngressConfig struct {
Tolerations []v1.Toleration `yaml:"tolerations" json:"tolerations,omitempty"` Tolerations []v1.Toleration `yaml:"tolerations" json:"tolerations,omitempty"`
// Enable or disable nginx default-http-backend // Enable or disable nginx default-http-backend
DefaultBackend *bool `yaml:"default_backend" json:"defaultBackend,omitempty" norman:"default=true"` DefaultBackend *bool `yaml:"default_backend" json:"defaultBackend,omitempty" norman:"default=true"`
// Priority class name for Nginx-Ingress's "default-http-backend" deployment
DefaultHTTPBackendPriorityClassName string `yaml:"default_http_backend_priority_class_name" json:"defaultHttpBackendPriorityClassName,omitempty"`
// Priority class name for Nginx-Ingress's "nginx-ingress-controller" daemonset
NginxIngressControllerPriorityClassName string `yaml:"nginx_ingress_controller_priority_class_name" json:"nginxIngressControllerPriorityClassName,omitempty"`
} }
type ExtraEnv struct { type ExtraEnv struct {
@ -895,7 +900,8 @@ type GlobalAwsOpts struct {
type MonitoringConfig struct { type MonitoringConfig struct {
// Monitoring server provider // Monitoring server provider
Provider string `yaml:"provider" json:"provider,omitempty" norman:"default=metrics-server"` Provider string `yaml:"provider" json:"provider,omitempty" norman:"default=metrics-server"`
// Metrics server options // These options are NOT for configuring the Metrics-Server's addon template.
// They are used to pass command args to the metric-server's deployment containers specifically.
Options map[string]string `yaml:"options" json:"options,omitempty"` Options map[string]string `yaml:"options" json:"options,omitempty"`
// NodeSelector key pair // NodeSelector key pair
NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"`
@ -905,6 +911,8 @@ type MonitoringConfig struct {
Replicas *int32 `yaml:"replicas" json:"replicas,omitempty" norman:"default=1"` Replicas *int32 `yaml:"replicas" json:"replicas,omitempty" norman:"default=1"`
// Tolerations for Deployments // Tolerations for Deployments
Tolerations []v1.Toleration `yaml:"tolerations" json:"tolerations,omitempty"` Tolerations []v1.Toleration `yaml:"tolerations" json:"tolerations,omitempty"`
// Priority class name for Metrics-Server's "metrics-server" deployment
MetricsServerPriorityClassName string `yaml:"metrics_server_priority_class_name" json:"metricsServerPriorityClassName,omitempty"`
} }
type RestoreConfig struct { type RestoreConfig struct {
@ -921,6 +929,8 @@ type RotateCertificates struct {
type DNSConfig struct { type DNSConfig struct {
// DNS provider // DNS provider
Provider string `yaml:"provider" json:"provider,omitempty"` Provider string `yaml:"provider" json:"provider,omitempty"`
// DNS config options
Options map[string]string `yaml:"options" json:"options,omitempty"`
// Upstream nameservers // Upstream nameservers
UpstreamNameservers []string `yaml:"upstreamnameservers" json:"upstreamnameservers,omitempty"` UpstreamNameservers []string `yaml:"upstreamnameservers" json:"upstreamnameservers,omitempty"`
// ReverseCIDRs // ReverseCIDRs
@ -930,7 +940,7 @@ type DNSConfig struct {
// NodeSelector key pair // NodeSelector key pair
NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"`
// Nodelocal DNS // Nodelocal DNS
Nodelocal *Nodelocal `yaml:"nodelocal" json:"nodelocal,omitempy"` Nodelocal *Nodelocal `yaml:"nodelocal" json:"nodelocal,omitempty"`
// Update strategy // Update strategy
UpdateStrategy *DeploymentStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` UpdateStrategy *DeploymentStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"`
// Autoscaler fields to determine number of dns replicas // Autoscaler fields to determine number of dns replicas
@ -941,11 +951,13 @@ type DNSConfig struct {
type Nodelocal struct { type Nodelocal struct {
// link-local IP for nodelocal DNS // link-local IP for nodelocal DNS
IPAddress string `yaml:"ip_address" json:"ipAddress,omitempy"` IPAddress string `yaml:"ip_address" json:"ipAddress,omitempty"`
// Nodelocal DNS daemonset upgrade strategy // Nodelocal DNS daemonset upgrade strategy
UpdateStrategy *DaemonSetUpdateStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` UpdateStrategy *DaemonSetUpdateStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"`
// NodeSelector key pair // NodeSelector key pair
NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"`
// Priority class name for NodeLocal's "node-local-dns" daemonset
NodeLocalDNSPriorityClassName string `yaml:"node_local_dns_priority_class_name" json:"nodeLocalDnsPriorityClassName,omitempty"`
} }
// LinearAutoscalerParams contains fields expected by the cluster-proportional-autoscaler https://github.com/kubernetes-incubator/cluster-proportional-autoscaler/blob/0c61e63fc81449abdd52315aa27179a17e5d1580/pkg/autoscaler/controller/linearcontroller/linear_controller.go#L50 // LinearAutoscalerParams contains fields expected by the cluster-proportional-autoscaler https://github.com/kubernetes-incubator/cluster-proportional-autoscaler/blob/0c61e63fc81449abdd52315aa27179a17e5d1580/pkg/autoscaler/controller/linearcontroller/linear_controller.go#L50