1
0
mirror of https://github.com/rancher/types.git synced 2025-06-23 04:07:03 +00:00

Merge pull request #154 from moelsayed/images_type

Add SystemImages type
This commit is contained in:
Alena Prokharchyk 2018-01-29 15:18:07 -08:00 committed by GitHub
commit 019aa7fc1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 78 additions and 13 deletions

View File

@ -12,15 +12,15 @@ type RancherKubernetesEngineConfig struct {
// YAML manifest for user provided addons to be deployed on the cluster
Addons string `yaml:"addons" json:"addons,omitempty"`
// List of images used internally for proxy, cert downlaod and kubedns
SystemImages map[string]string `yaml:"system_images" json:"systemImages,omitempty"`
SystemImages RKESystemImages `yaml:"system_images" json:"systemImages,omitempty"`
// SSH Private Key Path
SSHKeyPath string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty"`
// Authorization mode configuration used in the cluster
Authorization AuthzConfig `yaml:"authorization" json:"authorization,omitempty"`
// Enable/disable strict docker version checking
IgnoreDockerVersion bool `yaml:"ignore_docker_version" json:"ignoreDockerVersion"`
// Kubernetes version to use (overrides individual Images)
Version string `yaml:"kubernetesVersion"`
// Kubernetes version to use (if kubernetes image is specifed, image version takes precedence)
Version string `yaml:"kubernetes_version" json:"kubernetesVersion,omitempty"`
// List of private registries and their credentials
PrivateRegistries []PrivateRegistry `yaml:"private_registries" json:"privateRegistries,omitempty"`
}
@ -34,6 +34,29 @@ type PrivateRegistry struct {
Password string `yaml:"password" json:"password,omitempty"`
}
type RKESystemImages struct {
// etcd image
Etcd string `yaml:"etcd" json:"etcd,omitempty" norman:"default=quay.io/coreos/etcd:latest"`
// Alpine image
Alpine string `yaml:"alpine" json:"alpine,omitempty" norman:"default=alpine"`
// rke-nginx-proxy image
NginxProxy string `yaml:"nginx_proxy" json:"nginxProxy,omitempty" norman:"default=rancher/rke-nginx-proxy"`
// rke-cert-deployer image
CertDownloader string `yaml:"cert_downloader" json:"certDownloader,omitempty" norman:"default=rancher/rke-cert-deployer"`
// rke-service-sidekick image
KubernetesServicesSidecar string `yaml:"kubernetes_services_sidecar" json:"kubernetesServicesSidecar,omitempty" norman:"default=rancher/rke-kube-services-sidecar"`
// KubeDNS image
KubeDNS string `yaml:"kubedns" json:"kubedns,omitempty" norman:"default=gcr.io/google_containers/k8s-dns-kube-dns-amd64"`
// DNSMasq image
DNSmasq string `yaml:"dnsmasq" json:"dnsmasq,omitempty" norman:"default=gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64"`
// KubeDNS side car image
KubeDNSSidecar string `yaml:"kubedns_sidecar" json:"kubednsSidecar,omitempty" norman:"default=gcr.io/google_containers/k8s-dns-sidecar-amd64"`
// KubeDNS autoscaler image
KubeDNSAutoscaler string `yaml:"kubedns_autoscaler" json:"kubednsAutoscaler,omitempty" norman:"default=gcr.io/google_containers/cluster-proportional-autoscaler-amd64"`
// Kubernetes image
Kubernetes string `yaml:"kubernetes" json:"kubernetes,omitempty" norman:"default=rancher/k8s"`
}
type RKEConfigNode struct {
// Name of the host provisioned via docker machine
MachineName string `yaml:"machine_name,omitempty" json:"machineName,omitempty" norman:"type=reference[machine]"`

View File

@ -427,6 +427,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*RKEConfigServices).DeepCopyInto(out.(*RKEConfigServices))
return nil
}, InType: reflect.TypeOf(&RKEConfigServices{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*RKESystemImages).DeepCopyInto(out.(*RKESystemImages))
return nil
}, InType: reflect.TypeOf(&RKESystemImages{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*RancherKubernetesEngineConfig).DeepCopyInto(out.(*RancherKubernetesEngineConfig))
return nil
@ -3298,6 +3302,22 @@ func (in *RKEConfigServices) DeepCopy() *RKEConfigServices {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RKESystemImages) DeepCopyInto(out *RKESystemImages) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKESystemImages.
func (in *RKESystemImages) DeepCopy() *RKESystemImages {
if in == nil {
return nil
}
out := new(RKESystemImages)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RancherKubernetesEngineConfig) DeepCopyInto(out *RancherKubernetesEngineConfig) {
*out = *in
@ -3311,13 +3331,7 @@ func (in *RancherKubernetesEngineConfig) DeepCopyInto(out *RancherKubernetesEngi
in.Services.DeepCopyInto(&out.Services)
in.Network.DeepCopyInto(&out.Network)
in.Authentication.DeepCopyInto(&out.Authentication)
if in.SystemImages != nil {
in, out := &in.SystemImages, &out.SystemImages
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
out.SystemImages = in.SystemImages
in.Authorization.DeepCopyInto(&out.Authorization)
if in.PrivateRegistries != nil {
in, out := &in.PrivateRegistries, &out.PrivateRegistries

View File

@ -12,7 +12,7 @@ const (
RancherKubernetesEngineConfigFieldSSHKeyPath = "sshKeyPath"
RancherKubernetesEngineConfigFieldServices = "services"
RancherKubernetesEngineConfigFieldSystemImages = "systemImages"
RancherKubernetesEngineConfigFieldVersion = "version"
RancherKubernetesEngineConfigFieldVersion = "kubernetesVersion"
)
type RancherKubernetesEngineConfig struct {
@ -25,6 +25,6 @@ type RancherKubernetesEngineConfig struct {
PrivateRegistries []PrivateRegistry `json:"privateRegistries,omitempty"`
SSHKeyPath string `json:"sshKeyPath,omitempty"`
Services *RKEConfigServices `json:"services,omitempty"`
SystemImages map[string]string `json:"systemImages,omitempty"`
Version string `json:"version,omitempty"`
SystemImages *RKESystemImages `json:"systemImages,omitempty"`
Version string `json:"kubernetesVersion,omitempty"`
}

View File

@ -0,0 +1,28 @@
package client
const (
RKESystemImagesType = "rkeSystemImages"
RKESystemImagesFieldAlpine = "alpine"
RKESystemImagesFieldCertDownloader = "certDownloader"
RKESystemImagesFieldDNSmasq = "dnsmasq"
RKESystemImagesFieldEtcd = "etcd"
RKESystemImagesFieldKubeDNS = "kubedns"
RKESystemImagesFieldKubeDNSAutoscaler = "kubednsAutoscaler"
RKESystemImagesFieldKubeDNSSidecar = "kubednsSidecar"
RKESystemImagesFieldKubernetes = "kubernetes"
RKESystemImagesFieldKubernetesServicesSidecar = "kubernetesServicesSidecar"
RKESystemImagesFieldNginxProxy = "nginxProxy"
)
type RKESystemImages struct {
Alpine string `json:"alpine,omitempty"`
CertDownloader string `json:"certDownloader,omitempty"`
DNSmasq string `json:"dnsmasq,omitempty"`
Etcd string `json:"etcd,omitempty"`
KubeDNS string `json:"kubedns,omitempty"`
KubeDNSAutoscaler string `json:"kubednsAutoscaler,omitempty"`
KubeDNSSidecar string `json:"kubednsSidecar,omitempty"`
Kubernetes string `json:"kubernetes,omitempty"`
KubernetesServicesSidecar string `json:"kubernetesServicesSidecar,omitempty"`
NginxProxy string `json:"nginxProxy,omitempty"`
}