Skip to content

Commit ea6fd93

Browse files
committed
[imagePullPolicy] Switch imagePullPolicy from Always to IfNotPresent
Use IfNotPresent instead of PullAlways for container image pull policy in aodh, ceilometer, availability, and mysqld-exporter statefulsets to avoid unnecessary image pulls. Jira: https://redhat.atlassian.net/browse/OSPRH-28872
1 parent 2e5cb81 commit ea6fd93

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

internal/autoscaling/aodh_statefulset.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func AodhStatefulSet(
136136
var replicas int32 = 1
137137

138138
apiContainer := corev1.Container{
139-
ImagePullPolicy: corev1.PullAlways,
139+
ImagePullPolicy: corev1.PullIfNotPresent,
140140
Command: []string{
141141
"/bin/bash",
142142
},
@@ -148,7 +148,7 @@ func AodhStatefulSet(
148148
}
149149

150150
evaluatorContainer := corev1.Container{
151-
ImagePullPolicy: corev1.PullAlways,
151+
ImagePullPolicy: corev1.PullIfNotPresent,
152152
Command: []string{
153153
"/bin/bash",
154154
},
@@ -160,7 +160,7 @@ func AodhStatefulSet(
160160
}
161161

162162
notifierContainer := corev1.Container{
163-
ImagePullPolicy: corev1.PullAlways,
163+
ImagePullPolicy: corev1.PullIfNotPresent,
164164
Command: []string{
165165
"/bin/bash",
166166
},
@@ -172,7 +172,7 @@ func AodhStatefulSet(
172172
}
173173

174174
listenerContainer := corev1.Container{
175-
ImagePullPolicy: corev1.PullAlways,
175+
ImagePullPolicy: corev1.PullIfNotPresent,
176176
Command: []string{
177177
"/bin/bash",
178178
},

internal/availability/statefulset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func KSMStatefulSet(
125125
}
126126

127127
container := corev1.Container{
128-
ImagePullPolicy: corev1.PullAlways,
128+
ImagePullPolicy: corev1.PullIfNotPresent,
129129
Image: instance.Spec.KSMImage,
130130
Name: KSMServiceName,
131131
Args: args,

internal/ceilometer/statefulset.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func StatefulSet(
137137
}
138138

139139
centralAgentContainer := corev1.Container{
140-
ImagePullPolicy: corev1.PullAlways,
140+
ImagePullPolicy: corev1.PullIfNotPresent,
141141
Command: []string{
142142
"/bin/bash",
143143
},
@@ -149,7 +149,7 @@ func StatefulSet(
149149
LivenessProbe: centralLivenessProbe,
150150
}
151151
notificationAgentContainer := corev1.Container{
152-
ImagePullPolicy: corev1.PullAlways,
152+
ImagePullPolicy: corev1.PullIfNotPresent,
153153
Command: []string{
154154
"/bin/bash",
155155
},
@@ -161,7 +161,7 @@ func StatefulSet(
161161
LivenessProbe: notificationLivenessProbe,
162162
}
163163
sgCoreContainer := corev1.Container{
164-
ImagePullPolicy: corev1.PullAlways,
164+
ImagePullPolicy: corev1.PullIfNotPresent,
165165
Image: instance.Spec.SgCoreImage,
166166
Name: "sg-core",
167167
VolumeMounts: getSgCoreVolumeMounts(),
@@ -175,7 +175,7 @@ func StatefulSet(
175175
},
176176
}
177177
proxyContainer := corev1.Container{
178-
ImagePullPolicy: corev1.PullAlways,
178+
ImagePullPolicy: corev1.PullIfNotPresent,
179179
Image: instance.Spec.ProxyImage,
180180
Name: "proxy-httpd",
181181
Ports: []corev1.ContainerPort{{

internal/mysqldexporter/statefulset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func StatefulSet(
100100
}
101101

102102
mysqldExporterContainer := corev1.Container{
103-
ImagePullPolicy: corev1.PullAlways,
103+
ImagePullPolicy: corev1.PullIfNotPresent,
104104
Args: args,
105105
Image: instance.Spec.MysqldExporterImage,
106106
Name: ServiceName,

0 commit comments

Comments
 (0)