Skip to content

Commit

Permalink
Add ImagePullSecrets in Ingress (#674)
Browse files Browse the repository at this point in the history
Fixes #673
  • Loading branch information
tamalsaha committed Nov 2, 2017
1 parent df3f09e commit c77bd75
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 2 deletions.
7 changes: 7 additions & 0 deletions apis/voyager/ingress.go
Expand Up @@ -92,6 +92,13 @@ type IngressSpec struct {
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`

// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
// in the case of docker, only DockerConfig type secrets are honored.
// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
// +optional
ImagePullSecrets []core.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

// IngressTLS describes the transport layer security associated with an Ingress.
Expand Down
7 changes: 7 additions & 0 deletions apis/voyager/v1beta1/ingress.go
Expand Up @@ -93,6 +93,13 @@ type IngressSpec struct {
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`

// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
// in the case of docker, only DockerConfig type secrets are honored.
// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
// +optional
ImagePullSecrets []core.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

// IngressTLS describes the transport layer security associated with an Ingress.
Expand Down
15 changes: 14 additions & 1 deletion apis/voyager/v1beta1/openapi_generated.go
Expand Up @@ -1041,11 +1041,24 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
},
},
},
"imagePullSecrets": {
SchemaProps: spec.SchemaProps{
Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("k8s.io/api/core/v1.LocalObjectReference"),
},
},
},
},
},
},
},
},
Dependencies: []string{
"github.com/appscode/voyager/apis/voyager/v1beta1.FrontendRule", "github.com/appscode/voyager/apis/voyager/v1beta1.HTTPIngressBackend", "github.com/appscode/voyager/apis/voyager/v1beta1.IngressRule", "github.com/appscode/voyager/apis/voyager/v1beta1.IngressTLS", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.Toleration"},
"github.com/appscode/voyager/apis/voyager/v1beta1.FrontendRule", "github.com/appscode/voyager/apis/voyager/v1beta1.HTTPIngressBackend", "github.com/appscode/voyager/apis/voyager/v1beta1.IngressRule", "github.com/appscode/voyager/apis/voyager/v1beta1.IngressTLS", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.Toleration"},
},
"github.com/appscode/voyager/apis/voyager/v1beta1.IngressStatus": {
Schema: spec.Schema{
Expand Down
2 changes: 2 additions & 0 deletions apis/voyager/v1beta1/zz_generated.conversion.go
Expand Up @@ -717,6 +717,7 @@ func autoConvert_v1beta1_IngressSpec_To_voyager_IngressSpec(in *IngressSpec, out
out.Affinity = (*core_v1.Affinity)(unsafe.Pointer(in.Affinity))
out.SchedulerName = in.SchedulerName
out.Tolerations = *(*[]core_v1.Toleration)(unsafe.Pointer(&in.Tolerations))
out.ImagePullSecrets = *(*[]core_v1.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
return nil
}

Expand All @@ -735,6 +736,7 @@ func autoConvert_voyager_IngressSpec_To_v1beta1_IngressSpec(in *voyager.IngressS
out.Affinity = (*core_v1.Affinity)(unsafe.Pointer(in.Affinity))
out.SchedulerName = in.SchedulerName
out.Tolerations = *(*[]core_v1.Toleration)(unsafe.Pointer(&in.Tolerations))
out.ImagePullSecrets = *(*[]core_v1.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
return nil
}

Expand Down
5 changes: 5 additions & 0 deletions apis/voyager/v1beta1/zz_generated.deepcopy.go
Expand Up @@ -864,6 +864,11 @@ func (in *IngressSpec) DeepCopyInto(out *IngressSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ImagePullSecrets != nil {
in, out := &in.ImagePullSecrets, &out.ImagePullSecrets
*out = make([]core_v1.LocalObjectReference, len(*in))
copy(*out, *in)
}
return
}

Expand Down
5 changes: 5 additions & 0 deletions apis/voyager/zz_generated.deepcopy.go
Expand Up @@ -817,6 +817,11 @@ func (in *IngressSpec) DeepCopyInto(out *IngressSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ImagePullSecrets != nil {
in, out := &in.ImagePullSecrets, &out.ImagePullSecrets
*out = make([]core_v1.LocalObjectReference, len(*in))
copy(*out, *in)
}
return
}

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/voyager_run.md
Expand Up @@ -19,7 +19,8 @@ voyager run [flags]
--cloud-config string The path to the cloud provider configuration file. Empty string for no configuration file.
-c, --cloud-provider string Name of cloud provider
--custom-templates string Glob pattern of custom HAProxy template files used to override built-in templates
--haproxy-image string haproxy image name to be run (default "appscode/haproxy:1.7.9-5.0.0-rc.2")
--exporter-sidecar-image string Docker image containing Prometheus exporter (default "appscode/voyager:5.0.0-rc.2")
--haproxy-image string Docker image containing HAProxy binary (default "appscode/haproxy:1.7.9-5.0.0-rc.2")
--haproxy.server-metric-fields string Comma-separated list of exported server metrics. See http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.1 (default "2,3,4,5,6,7,8,9,13,14,15,16,17,18,21,24,33,35,38,39,40,41,42,43,44")
--haproxy.timeout duration Timeout for trying to get stats from HAProxy. (default 5s)
-h, --help help for run
Expand Down

0 comments on commit c77bd75

Please sign in to comment.