Skip to content

Commit 23e23e6

Browse files
committed
expose podManagementPolicy
Signed-off-by: Jordan Rodgers <jrodgers@mux.com>
1 parent 7e3ecde commit 23e23e6

11 files changed

+44
-4
lines changed

api/common_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type KubernetesConfig struct {
1414
ExistingPasswordSecret *ExistingPasswordSecret `json:"redisSecret,omitempty"`
1515
ImagePullSecrets *[]corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
1616
UpdateStrategy appsv1.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"`
17+
PodManagementPolicy appsv1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`
1718
Service *ServiceConfig `json:"service,omitempty"`
1819
IgnoreAnnotations []string `json:"ignoreAnnotations,omitempty"`
1920
}

config/crd/bases/redis.redis.opstreelabs.in_redis.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,10 @@ spec:
11071107
type: string
11081108
type: object
11091109
type: array
1110+
podManagementPolicy:
1111+
description: PodManagementPolicyType defines the policy for creating
1112+
pods under a stateful set.
1113+
type: string
11101114
redisSecret:
11111115
description: ExistingPasswordSecret is the struct to access the
11121116
existing secret
@@ -5795,6 +5799,10 @@ spec:
57955799
type: string
57965800
type: object
57975801
type: array
5802+
podManagementPolicy:
5803+
description: PodManagementPolicyType defines the policy for creating
5804+
pods under a stateful set.
5805+
type: string
57985806
redisSecret:
57995807
description: ExistingPasswordSecret is the struct to access the
58005808
existing secret

config/crd/bases/redis.redis.opstreelabs.in_redisclusters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ spec:
159159
type: string
160160
type: object
161161
type: array
162+
podManagementPolicy:
163+
description: PodManagementPolicyType defines the policy for creating
164+
pods under a stateful set.
165+
type: string
162166
redisSecret:
163167
description: ExistingPasswordSecret is the struct to access the
164168
existing secret
@@ -6411,6 +6415,10 @@ spec:
64116415
type: string
64126416
type: object
64136417
type: array
6418+
podManagementPolicy:
6419+
description: PodManagementPolicyType defines the policy for creating
6420+
pods under a stateful set.
6421+
type: string
64146422
redisSecret:
64156423
description: ExistingPasswordSecret is the struct to access the
64166424
existing secret

config/crd/bases/redis.redis.opstreelabs.in_redisreplications.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,10 @@ spec:
11091109
type: string
11101110
type: object
11111111
type: array
1112+
podManagementPolicy:
1113+
description: PodManagementPolicyType defines the policy for creating
1114+
pods under a stateful set.
1115+
type: string
11121116
redisSecret:
11131117
description: ExistingPasswordSecret is the struct to access the
11141118
existing secret
@@ -5803,6 +5807,10 @@ spec:
58035807
type: string
58045808
type: object
58055809
type: array
5810+
podManagementPolicy:
5811+
description: PodManagementPolicyType defines the policy for creating
5812+
pods under a stateful set.
5813+
type: string
58065814
redisSecret:
58075815
description: ExistingPasswordSecret is the struct to access the
58085816
existing secret

config/crd/bases/redis.redis.opstreelabs.in_redissentinels.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,10 @@ spec:
11101110
type: string
11111111
type: object
11121112
type: array
1113+
podManagementPolicy:
1114+
description: PodManagementPolicyType defines the policy for creating
1115+
pods under a stateful set.
1116+
type: string
11131117
redisSecret:
11141118
description: ExistingPasswordSecret is the struct to access the
11151119
existing secret
@@ -3426,6 +3430,10 @@ spec:
34263430
type: string
34273431
type: object
34283432
type: array
3433+
podManagementPolicy:
3434+
description: PodManagementPolicyType defines the policy for creating
3435+
pods under a stateful set.
3436+
type: string
34293437
redisSecret:
34303438
description: ExistingPasswordSecret is the struct to access the
34313439
existing secret

docs/content/en/docs/CRD Reference/Redis API/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ _Appears in:_
5656
| `redisSecret` _[ExistingPasswordSecret](#existingpasswordsecret)_ | |
5757
| `imagePullSecrets` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#localobjectreference-v1-core)_ | |
5858
| `updateStrategy` _[StatefulSetUpdateStrategy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetupdatestrategy-v1-apps)_ | |
59+
| `podManagementPolicy` _[PodManagementPolicy](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies)_ | |
5960

6061
#### Redis
6162

k8sutils/redis-cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func generateRedisClusterParams(cr *redisv1beta2.RedisCluster, replicas int32, e
4545
Tolerations: params.Tolerations,
4646
ServiceAccountName: cr.Spec.ServiceAccountName,
4747
UpdateStrategy: cr.Spec.KubernetesConfig.UpdateStrategy,
48+
PodManagementPolicy: cr.Spec.KubernetesConfig.PodManagementPolicy,
4849
IgnoreAnnotations: cr.Spec.KubernetesConfig.IgnoreAnnotations,
4950
HostNetwork: cr.Spec.HostNetwork,
5051
}

k8sutils/redis-replication.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func generateRedisReplicationParams(cr *redisv1beta2.RedisReplication) statefulS
9292
Tolerations: cr.Spec.Tolerations,
9393
TerminationGracePeriodSeconds: cr.Spec.TerminationGracePeriodSeconds,
9494
UpdateStrategy: cr.Spec.KubernetesConfig.UpdateStrategy,
95+
PodManagementPolicy: cr.Spec.KubernetesConfig.PodManagementPolicy,
9596
IgnoreAnnotations: cr.Spec.KubernetesConfig.IgnoreAnnotations,
9697
}
9798
if cr.Spec.KubernetesConfig.ImagePullSecrets != nil {

k8sutils/redis-sentinel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func generateRedisSentinelParams(cr *redisv1beta2.RedisSentinel, replicas int32,
9898
Tolerations: cr.Spec.Tolerations,
9999
ServiceAccountName: cr.Spec.ServiceAccountName,
100100
UpdateStrategy: cr.Spec.KubernetesConfig.UpdateStrategy,
101+
PodManagementPolicy: cr.Spec.KubernetesConfig.PodManagementPolicy,
101102
IgnoreAnnotations: cr.Spec.KubernetesConfig.IgnoreAnnotations,
102103
}
103104

k8sutils/redis-standalone.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func generateRedisStandaloneParams(cr *redisv1beta2.Redis) statefulSetParameters
8888
TerminationGracePeriodSeconds: cr.Spec.TerminationGracePeriodSeconds,
8989
Tolerations: cr.Spec.Tolerations,
9090
UpdateStrategy: cr.Spec.KubernetesConfig.UpdateStrategy,
91+
PodManagementPolicy: cr.Spec.KubernetesConfig.PodManagementPolicy,
9192
IgnoreAnnotations: cr.Spec.KubernetesConfig.IgnoreAnnotations,
9293
}
9394
if cr.Spec.KubernetesConfig.ImagePullSecrets != nil {

0 commit comments

Comments
 (0)