1
0
mirror of https://github.com/rancher/types.git synced 2025-08-01 04:57:05 +00:00

Merge pull request #159 from galal-hussein/master

Add ingress config to rke and labels to nodes
This commit is contained in:
Alena Prokharchyk 2018-02-01 11:09:22 -08:00 committed by GitHub
commit 8775720ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 82 additions and 9 deletions

View File

@ -23,6 +23,8 @@ type RancherKubernetesEngineConfig struct {
Version string `yaml:"kubernetes_version" json:"kubernetesVersion,omitempty"`
// List of private registries and their credentials
PrivateRegistries []PrivateRegistry `yaml:"private_registries" json:"privateRegistries,omitempty"`
// Ingress controller used in the cluster
Ingress IngressConfig `yaml:"ingress" json:"ingress,omitempty"`
}
type PrivateRegistry struct {
@ -76,6 +78,8 @@ type RKEConfigNode struct {
SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty"`
// SSH Private Key Path
SSHKeyPath string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty"`
// Node Labels
Labels map[string]string `yaml:"labels" json:"labels,omitempty"`
}
type RKEConfigServices struct {
@ -164,3 +168,12 @@ type AuthzConfig struct {
// Authorization mode options
Options map[string]string `yaml:"options" json:"options,omitempty"`
}
type IngressConfig struct {
// Ingress controller type used by kubernetes
Type string `yaml:"type" json:"type,omitempty"`
// Ingress controller options
Options map[string]string `yaml:"options" json:"options,omitempty"`
// NodeSelector key pair
NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"`
}

View File

@ -239,6 +239,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*ImportedConfig).DeepCopyInto(out.(*ImportedConfig))
return nil
}, InType: reflect.TypeOf(&ImportedConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*IngressConfig).DeepCopyInto(out.(*IngressConfig))
return nil
}, InType: reflect.TypeOf(&IngressConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*K8sServerConfig).DeepCopyInto(out.(*K8sServerConfig))
return nil
@ -2048,6 +2052,36 @@ func (in *ImportedConfig) DeepCopy() *ImportedConfig {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IngressConfig) DeepCopyInto(out *IngressConfig) {
*out = *in
if in.Options != nil {
in, out := &in.Options, &out.Options
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressConfig.
func (in *IngressConfig) DeepCopy() *IngressConfig {
if in == nil {
return nil
}
out := new(IngressConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *K8sServerConfig) DeepCopyInto(out *K8sServerConfig) {
*out = *in
@ -3449,6 +3483,13 @@ func (in *RKEConfigNode) DeepCopyInto(out *RKEConfigNode) {
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Labels != nil {
in, out := &in.Labels, &out.Labels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
}
@ -3520,6 +3561,7 @@ func (in *RancherKubernetesEngineConfig) DeepCopyInto(out *RancherKubernetesEngi
*out = make([]PrivateRegistry, len(*in))
copy(*out, *in)
}
in.Ingress.DeepCopyInto(&out.Ingress)
return
}

View File

@ -0,0 +1,14 @@
package client
const (
IngressConfigType = "ingressConfig"
IngressConfigFieldNodeSelector = "nodeSelector"
IngressConfigFieldOptions = "options"
IngressConfigFieldType = "type"
)
type IngressConfig struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Options map[string]string `json:"options,omitempty"`
Type string `json:"type,omitempty"`
}

View File

@ -6,6 +6,7 @@ const (
RancherKubernetesEngineConfigFieldAuthentication = "authentication"
RancherKubernetesEngineConfigFieldAuthorization = "authorization"
RancherKubernetesEngineConfigFieldIgnoreDockerVersion = "ignoreDockerVersion"
RancherKubernetesEngineConfigFieldIngress = "ingress"
RancherKubernetesEngineConfigFieldNetwork = "network"
RancherKubernetesEngineConfigFieldNodes = "nodes"
RancherKubernetesEngineConfigFieldPrivateRegistries = "privateRegistries"
@ -20,6 +21,7 @@ type RancherKubernetesEngineConfig struct {
Authentication *AuthnConfig `json:"authentication,omitempty"`
Authorization *AuthzConfig `json:"authorization,omitempty"`
IgnoreDockerVersion *bool `json:"ignoreDockerVersion,omitempty"`
Ingress *IngressConfig `json:"ingress,omitempty"`
Network *NetworkConfig `json:"network,omitempty"`
Nodes []RKEConfigNode `json:"nodes,omitempty"`
PrivateRegistries []PrivateRegistry `json:"privateRegistries,omitempty"`

View File

@ -6,6 +6,7 @@ const (
RKEConfigNodeFieldDockerSocket = "dockerSocket"
RKEConfigNodeFieldHostnameOverride = "hostnameOverride"
RKEConfigNodeFieldInternalAddress = "internalAddress"
RKEConfigNodeFieldLabels = "labels"
RKEConfigNodeFieldMachineId = "machineId"
RKEConfigNodeFieldRole = "role"
RKEConfigNodeFieldSSHKey = "sshKey"
@ -14,13 +15,14 @@ const (
)
type RKEConfigNode struct {
Address string `json:"address,omitempty"`
DockerSocket string `json:"dockerSocket,omitempty"`
HostnameOverride string `json:"hostnameOverride,omitempty"`
InternalAddress string `json:"internalAddress,omitempty"`
MachineId string `json:"machineId,omitempty"`
Role []string `json:"role,omitempty"`
SSHKey string `json:"sshKey,omitempty"`
SSHKeyPath string `json:"sshKeyPath,omitempty"`
User string `json:"user,omitempty"`
Address string `json:"address,omitempty"`
DockerSocket string `json:"dockerSocket,omitempty"`
HostnameOverride string `json:"hostnameOverride,omitempty"`
InternalAddress string `json:"internalAddress,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
MachineId string `json:"machineId,omitempty"`
Role []string `json:"role,omitempty"`
SSHKey string `json:"sshKey,omitempty"`
SSHKeyPath string `json:"sshKeyPath,omitempty"`
User string `json:"user,omitempty"`
}