getAzuriteDeployment get the deployment for Azurite
(namespace string)
| 263 | |
| 264 | // getAzuriteDeployment get the deployment for Azurite |
| 265 | func getAzuriteDeployment(namespace string) appsv1.Deployment { |
| 266 | replicas := int32(1) |
| 267 | seccompProfile := &corev1.SeccompProfile{ |
| 268 | Type: corev1.SeccompProfileTypeRuntimeDefault, |
| 269 | } |
| 270 | |
| 271 | azuriteDeployment := appsv1.Deployment{ |
| 272 | ObjectMeta: metav1.ObjectMeta{ |
| 273 | Name: "azurite", |
| 274 | Namespace: namespace, |
| 275 | Labels: map[string]string{"app": "azurite"}, |
| 276 | }, |
| 277 | Spec: appsv1.DeploymentSpec{ |
| 278 | Replicas: &replicas, |
| 279 | Selector: &metav1.LabelSelector{ |
| 280 | MatchLabels: map[string]string{"app": "azurite"}, |
| 281 | }, |
| 282 | Template: corev1.PodTemplateSpec{ |
| 283 | ObjectMeta: metav1.ObjectMeta{ |
| 284 | Labels: map[string]string{"app": "azurite"}, |
| 285 | }, |
| 286 | Spec: corev1.PodSpec{ |
| 287 | Containers: []corev1.Container{ |
| 288 | { |
| 289 | Image: azuriteImage, |
| 290 | Name: "azurite", |
| 291 | Command: []string{"azurite"}, |
| 292 | Args: []string{ |
| 293 | "--skipApiVersionCheck", |
| 294 | "-l", "/data", "--cert", "/etc/ssl/certs/azurite.pem", |
| 295 | "--key", "/etc/ssl/certs/azurite-key.pem", |
| 296 | "--oauth", "basic", "--blobHost", "0.0.0.0", |
| 297 | }, |
| 298 | Env: []corev1.EnvVar{ |
| 299 | { |
| 300 | Name: "AZURITE_ACCOUNTS", |
| 301 | ValueFrom: &corev1.EnvVarSource{ |
| 302 | SecretKeyRef: &corev1.SecretKeySelector{ |
| 303 | LocalObjectReference: corev1.LocalObjectReference{ |
| 304 | Name: "azurite", |
| 305 | }, |
| 306 | Key: "AZURITE_ACCOUNTS", |
| 307 | }, |
| 308 | }, |
| 309 | }, |
| 310 | }, |
| 311 | Ports: []corev1.ContainerPort{ |
| 312 | { |
| 313 | ContainerPort: 10000, |
| 314 | }, |
| 315 | }, |
| 316 | VolumeMounts: []corev1.VolumeMount{ |
| 317 | { |
| 318 | MountPath: "/data", |
| 319 | Name: "data-volume", |
| 320 | }, |
| 321 | { |
| 322 | MountPath: "/etc/ssl/certs", |