Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Adding imagePullSecrets support to AEE jobs #326

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/bases/ansibleee.openstack.org_openstackansibleees.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,14 @@ spec:
x-kubernetes-preserve-unknown-fields: true
image:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
x-kubernetes-map-type: atomic
type: array
initContainers:
items:
properties:
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/openstack_ansibleee_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ type OpenStackAnsibleEESpec struct {
// ServiceAccountName allows to specify what ServiceAccountName do we want the ansible execution run with. Without specifying,
// it will run with default serviceaccount
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this Job.
// If specified, these secrets will be passed to individual puller implementations for them to use.
// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
// +kubebuilder:validation:Optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// DNSConfig allows to specify custom dnsservers and search domains
// +kubebuilder:validation:Optional
DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,14 @@ spec:
x-kubernetes-preserve-unknown-fields: true
image:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
x-kubernetes-map-type: atomic
type: array
initContainers:
items:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ spec:
path: backoffLimit
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: 'Image pull secrets for container images. Default: []'
displayName: Image Pull Secrets
path: imagePullSecrets
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: 'RestartPolicy is the policy applied to the Job on whether it
needs to restart the Pod. It can be "OnFailure" or "Never". RestartPolicy
default: Never'
Expand Down
3 changes: 3 additions & 0 deletions controllers/openstack_ansibleee_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ func (r *OpenStackAnsibleEEReconciler) jobForOpenStackAnsibleEE(ctx context.Cont
if len(instance.Spec.ServiceAccountName) > 0 {
job.Spec.Template.Spec.ServiceAccountName = instance.Spec.ServiceAccountName
}
if len(instance.Spec.ImagePullSecrets) > 0 {
job.Spec.Template.Spec.ImagePullSecrets = instance.Spec.ImagePullSecrets
}
// Set primary inventory if specified as string
var existingInventoryMounts string = ""
if len(instance.Spec.Inventory) > 0 {
Expand Down
5 changes: 5 additions & 0 deletions docs/assemblies/openstack_ansibleee.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ OpenStackAnsibleEESpec defines the desired state of OpenStackAnsibleEE
| string
| false

| imagePullSecrets
| ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this Job. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
| []corev1.LocalObjectReference
| false

| dnsConfig
| DNSConfig allows to specify custom dnsservers and search domains
| *corev1.PodDNSConfig
Expand Down