Skip to content

Commit

Permalink
feat: support hierarchical imagePullSecrets configuration in AlluxioR…
Browse files Browse the repository at this point in the history
…untime (#4242)

Signed-off-by: EvanCley <[email protected]>
  • Loading branch information
EvanCley authored Aug 5, 2024
1 parent 5c995bd commit 79073df
Show file tree
Hide file tree
Showing 16 changed files with 450 additions and 53 deletions.
10 changes: 10 additions & 0 deletions api/v1alpha1/alluxioruntime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ type AlluxioCompTemplateSpec struct {
// PodMetadata defines labels and annotations that will be propagated to Alluxio's pods
// +optional
PodMetadata PodMetadata `json:"podMetadata,omitempty"`

// ImagePullSecrets that will be used to pull images
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

// AlluxioFuseSpec is a description of the Alluxio Fuse
Expand All @@ -103,6 +106,9 @@ type AlluxioFuseSpec struct {
// One of the three policies: `Always`, `IfNotPresent`, `Never`
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

// ImagePullSecrets that will be used to pull images
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

// Options for JVM
JvmOptions []string `json:"jvmOptions,omitempty"`

Expand Down Expand Up @@ -230,6 +236,10 @@ type AlluxioRuntimeSpec struct {
// RuntimeManagement defines policies when managing the runtime
// +optional
RuntimeManagement RuntimeManagement `json:"management,omitempty"`

// ImagePullSecrets that will be used to pull images
// +optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
48 changes: 45 additions & 3 deletions api/v1alpha1/openapi_generated.go

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

15 changes: 15 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

7 changes: 5 additions & 2 deletions charts/alluxio/templates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ spec:
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- if .Values.fuse.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- toYaml .Values.fuse.imagePullSecrets | nindent 8 }}
{{- else if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
{{- if .Values.fuse.criticalPod }}
priorityClassName: system-node-critical
Expand Down
7 changes: 5 additions & 2 deletions charts/alluxio/templates/master/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ spec:
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- if .Values.master.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- toYaml .Values.master.imagePullSecrets | nindent 8 }}
{{- else if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- if .Values.master.hostNetwork }}
Expand Down
7 changes: 5 additions & 2 deletions charts/alluxio/templates/worker/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ spec:
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- if .Values.worker.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- toYaml .Values.worker.imagePullSecrets | nindent 8 }}
{{- else if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- if .Values.worker.hostNetwork }}
Expand Down
5 changes: 5 additions & 0 deletions charts/alluxio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ tolerations: []
## Master ##

master:
imagePullSecrets: []

# Metadata for Alluxio Master Pod(including both master and job master component's label)
labels:
# label1: value1
Expand Down Expand Up @@ -216,6 +218,8 @@ apiGateway:
## Worker ##

worker:
imagePullSecrets: []

# Metadata for Alluxio Worker Pod(including both worker and job worker component's label)
labels:
# label1: value1
Expand Down Expand Up @@ -367,6 +371,7 @@ fuse:
image: alluxio/alluxio-fuse
imageTag: 2.4.0-SNAPSHOT
imagePullPolicy: IfNotPresent
imagePullSecrets: []
# Change both to true to deploy FUSE
enabled: false
clientEnabled: false
Expand Down
112 changes: 112 additions & 0 deletions charts/fluid/fluid/crds/data.fluid.io_alluxioruntimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ spec:
description: Environment variables that will be used by Alluxio
component. <br>
type: object
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
jvmOptions:
description: Options for JVM
items:
Expand Down Expand Up @@ -316,6 +332,22 @@ spec:
description: 'One of the three policies: `Always`, `IfNotPresent`,
`Never`'
type: string
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
imageTag:
description: Image Tag for Alluxio Fuse(e.g. 2.3.0-SNAPSHOT)
type: string
Expand Down Expand Up @@ -471,6 +503,22 @@ spec:
For now, only "hdfs-site.xml" and "core-site.xml" are supported. It must take the filename of the conf file as the key and content
of the file as the value.
type: string
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
initUsers:
description: The spec of init users
properties:
Expand Down Expand Up @@ -565,6 +613,22 @@ spec:
description: Environment variables that will be used by Alluxio
component. <br>
type: object
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
jvmOptions:
description: Options for JVM
items:
Expand Down Expand Up @@ -735,6 +799,22 @@ spec:
description: Environment variables that will be used by Alluxio
component. <br>
type: object
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
jvmOptions:
description: Options for JVM
items:
Expand Down Expand Up @@ -950,6 +1030,22 @@ spec:
description: Environment variables that will be used by Alluxio
component. <br>
type: object
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
jvmOptions:
description: Options for JVM
items:
Expand Down Expand Up @@ -4609,6 +4705,22 @@ spec:
description: Environment variables that will be used by Alluxio
component. <br>
type: object
imagePullSecrets:
description: ImagePullSecrets that will be used to pull images
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
type: array
jvmOptions:
description: Options for JVM
items:
Expand Down
Loading

0 comments on commit 79073df

Please sign in to comment.