Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(operator): add imagePullSecrets support #197 #277

Merged
merged 1 commit into from
Jan 8, 2025
Merged
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
5 changes: 5 additions & 0 deletions api/v1alpha1/dragonfly_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ type DragonflySpec struct {
// +kubebuilder:default:="Always"
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

// (Optional) imagePullSecrets to set to Dragonfly
// +optional
// +kubebuilder:validation:Optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

// (Optional) Dragonfly container args to pass to the container
// Refer to the Dragonfly documentation for the list of supported args
// +optional
Expand Down
38 changes: 38 additions & 0 deletions config/crd/bases/dragonflydb.io_dragonflies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,25 @@ spec:
description: (Optional) imagePullPolicy to set to Dragonfly, default
is Always
type: string
imagePullSecrets:
description: List of Secret resource containing access credentials to the registry. Required if the docker registry is private.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: array
initContainers:
description: (Optional) Dragonfly pod init containers
items:
Expand Down Expand Up @@ -1434,6 +1453,25 @@ spec:
Cannot be updated.
More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
type: string
imagePullSecrets:
description: List of Secret resource containing access credentials to the registry. Required if the docker registry is private.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: array
lifecycle:
description: |-
Actions that the management system should take in response to container lifecycle events.
Expand Down
1 change: 1 addition & 0 deletions internal/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func GetDragonflyResources(ctx context.Context, df *resourcesv1.Dragonfly) ([]cl
},
},
Spec: corev1.PodSpec{
ImagePullSecrets: df.Spec.ImagePullSecrets,
Containers: []corev1.Container{
{
Name: "dragonfly",
Expand Down
Loading