@@ -34,6 +34,8 @@ import (
34
34
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
35
35
schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container"
36
36
schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources"
37
+ schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod"
38
+ schedulerPodResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources"
37
39
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
38
40
"github.com/arangodb/kube-arangodb/pkg/deployment/patch"
39
41
"github.com/arangodb/kube-arangodb/pkg/integrations/sidecar"
@@ -125,7 +127,10 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe
125
127
126
128
integration , err := sidecar .NewIntegration (& schedulerContainerResourcesApi.Image {
127
129
Image : util .NewType (r .context .GetOperatorImage ()),
128
- }, spec .Integration .GetSidecar (), r .arangoDeploymentProfileTemplate (cachedStatus ))
130
+ }, spec .Integration .GetSidecar (),
131
+ r .arangoDeploymentProfileTemplate (cachedStatus ),
132
+ r .arangoDeploymentCATemplate (),
133
+ )
129
134
if err != nil {
130
135
return "" , nil , err
131
136
}
@@ -220,6 +225,52 @@ func (r *Resources) arangoDeploymentProfileTemplate(cachedStatus inspectorInterf
220
225
}
221
226
}
222
227
228
+ func (r * Resources ) arangoDeploymentCATemplate () * schedulerApi.ProfileTemplate {
229
+ t := r .context .GetSpec ().TLS
230
+ if ! t .IsSecure () {
231
+ return nil
232
+ }
233
+
234
+ return & schedulerApi.ProfileTemplate {
235
+ Pod : & schedulerPodApi.Pod {
236
+ Volumes : & schedulerPodResourcesApi.Volumes {
237
+ Volumes : []core.Volume {
238
+ {
239
+ Name : "deployment-int-ca" ,
240
+ VolumeSource : core.VolumeSource {
241
+ Secret : & core.SecretVolumeSource {
242
+ SecretName : GetCASecretName (r .context .GetAPIObject ()),
243
+ },
244
+ },
245
+ },
246
+ },
247
+ },
248
+ },
249
+ Container : & schedulerApi.ProfileContainerTemplate {
250
+ All : & schedulerContainerApi.Generic {
251
+ Environments : & schedulerContainerResourcesApi.Environments {
252
+ Env : []core.EnvVar {
253
+ {
254
+ Name : "ARANGO_DEPLOYMENT_CA" ,
255
+ Value : fmt .Sprintf ("/etc/deployment-int/ca/%s" , CACertName ),
256
+ },
257
+ },
258
+ },
259
+ VolumeMounts : & schedulerContainerResourcesApi.VolumeMounts {
260
+ VolumeMounts : []core.VolumeMount {
261
+ {
262
+ Name : "deployment-int-ca" ,
263
+ ReadOnly : true ,
264
+ RecursiveReadOnly : nil ,
265
+ MountPath : "/etc/deployment-int/ca" ,
266
+ },
267
+ },
268
+ },
269
+ },
270
+ },
271
+ }
272
+ }
273
+
223
274
func (r * Resources ) ensureArangoProfilesFactory (ctx context.Context , cachedStatus inspectorInterface.Inspector , expected ... func () (string , * schedulerApi.ArangoProfile , error )) (bool , error ) {
224
275
var changed bool
225
276
0 commit comments