@@ -42,6 +42,8 @@ const (
42
42
WhiskerServiceAccountName = WhiskerName
43
43
WhiskerDeploymentName = WhiskerName
44
44
WhiskerRoleName = WhiskerName
45
+ GoldmaneServerSecret = "goldmane-server-secret"
46
+ GoldmaneServiceName = "goldmane"
45
47
46
48
GuardianContainerName = "guardian"
47
49
GoldmaneContainerName = "goldmane"
@@ -64,6 +66,7 @@ type Configuration struct {
64
66
TunnelSecret * corev1.Secret
65
67
TrustedCertBundle certificatemanagement.TrustedBundleRO
66
68
ManagementClusterConnection * operatorv1.ManagementClusterConnection
69
+ GoldmaneServerKeyPair certificatemanagement.KeyPairInterface
67
70
}
68
71
69
72
type Component struct {
@@ -185,25 +188,43 @@ func (c *Component) whiskerBackendContainer() corev1.Container {
185
188
{Name : "GOLDMANE_HOST" , Value : "localhost:7443" },
186
189
},
187
190
SecurityContext : securitycontext .NewNonRootContext (),
191
+ VolumeMounts : c .cfg .TrustedCertBundle .VolumeMounts (rmeta .OSTypeLinux ),
188
192
}
189
193
}
190
194
191
195
func (c * Component ) goldmaneContainer () corev1.Container {
196
+ var volumeMounts []corev1.VolumeMount
197
+
192
198
env := []corev1.EnvVar {
193
199
{Name : "LOG_LEVEL" , Value : "INFO" },
194
200
{Name : "PORT" , Value : "7443" },
195
201
}
196
- var volumeMounts []corev1.VolumeMount
202
+
203
+ if c .cfg .GoldmaneServerKeyPair != nil {
204
+ env = append (env , corev1.EnvVar {
205
+ Name : "SERVER_KEY_PATH" ,
206
+ Value : c .cfg .GoldmaneServerKeyPair .VolumeMountKeyFilePath (),
207
+ })
208
+ env = append (env , corev1.EnvVar {
209
+ Name : "SERVER_CERT_PATH" ,
210
+ Value : c .cfg .GoldmaneServerKeyPair .VolumeMountCertificateFilePath (),
211
+ })
212
+
213
+ volumeMounts = append (volumeMounts , c .cfg .GoldmaneServerKeyPair .VolumeMount (c .SupportedOSType ()))
214
+ }
215
+
197
216
if c .cfg .ManagementClusterConnection != nil {
198
217
env = append (env ,
199
218
corev1.EnvVar {
200
219
Name : "PUSH_URL" ,
201
- Value : "https://localhost:8080/api/v1/flows/bulk" },
220
+ Value : "https://localhost:8080/api/v1/flows/bulk" ,
221
+ },
202
222
corev1.EnvVar {
203
223
Name : "CA_CERT_PATH" ,
204
- Value : c .cfg .TrustedCertBundle .MountPath ()},
224
+ Value : c .cfg .TrustedCertBundle .MountPath (),
225
+ },
205
226
)
206
- volumeMounts = c .cfg .TrustedCertBundle .VolumeMounts (c .SupportedOSType ())
227
+ volumeMounts = append ( volumeMounts , c .cfg .TrustedCertBundle .VolumeMounts (c .SupportedOSType ()) ... )
207
228
}
208
229
209
230
return corev1.Container {
@@ -219,7 +240,7 @@ func (c *Component) goldmaneContainer() corev1.Container {
219
240
func (c * Component ) goldmaneService () * corev1.Service {
220
241
return & corev1.Service {
221
242
ObjectMeta : metav1.ObjectMeta {
222
- Name : "goldmane" ,
243
+ Name : GoldmaneServiceName ,
223
244
Namespace : WhiskerNamespace ,
224
245
},
225
246
Spec : corev1.ServiceSpec {
@@ -261,6 +282,10 @@ func (c *Component) deployment() *appsv1.Deployment {
261
282
ctrs := []corev1.Container {c .whiskerContainer (), c .whiskerBackendContainer (), c .goldmaneContainer ()}
262
283
volumes := []corev1.Volume {c .cfg .TrustedCertBundle .Volume ()}
263
284
285
+ if c .cfg .GoldmaneServerKeyPair != nil {
286
+ volumes = append (volumes , c .cfg .GoldmaneServerKeyPair .Volume ())
287
+ }
288
+
264
289
if c .cfg .ManagementClusterConnection != nil {
265
290
ctrs = append (ctrs , c .guardianContainer ())
266
291
volumes = append (volumes , secretVolume (c .cfg .TunnelSecret ))
0 commit comments