+ # Build Container
+ container_builder = ContainerV3Builder(
+ self.app.name,
+ image_info,
+ config.image_pull_policy,
+ run_as_non_root=security_context_enabled,
+ )
+ container_builder.add_port(name=self.app.name, port=PORT)
+ container_builder.add_tcpsocket_readiness_probe(
+ PORT,
+ initial_delay_seconds=5,
+ timeout_seconds=5,
+ )
+ container_builder.add_tcpsocket_liveness_probe(
+ PORT,
+ initial_delay_seconds=45,
+ timeout_seconds=10,
+ )
+ container_builder.add_envs(
+ {
+ # General configuration
+ "ALLOW_ANONYMOUS_LOGIN": "yes",
+ "OSMNBI_SERVER_ENABLE_TEST": config.enable_test,
+ "OSMNBI_STATIC_DIR": "/app/osm_nbi/html_public",
+ # Kafka configuration
+ "OSMNBI_MESSAGE_HOST": self.kafka.host,
+ "OSMNBI_MESSAGE_DRIVER": "kafka",
+ "OSMNBI_MESSAGE_PORT": self.kafka.port,
+ # Database configuration
+ "OSMNBI_DATABASE_DRIVER": "mongo",
+ # Storage configuration
+ "OSMNBI_STORAGE_DRIVER": "mongo",
+ "OSMNBI_STORAGE_PATH": "/app/storage",
+ "OSMNBI_STORAGE_COLLECTION": "files",
+ # Prometheus configuration
+ "OSMNBI_PROMETHEUS_HOST": self.prometheus_client.hostname,
+ "OSMNBI_PROMETHEUS_PORT": self.prometheus_client.port,
+ # Log configuration
+ "OSMNBI_LOG_LEVEL": config.log_level,
+ }
+ )
+ container_builder.add_secret_envs(
+ secret_name=mongodb_secret_name,
+ envs={
+ "OSMNBI_DATABASE_URI": "uri",
+ "OSMNBI_DATABASE_COMMONKEY": "commonkey",
+ "OSMNBI_STORAGE_URI": "uri",
+ },
+ )
+ if config.auth_backend == "internal":
+ container_builder.add_env("OSMNBI_AUTHENTICATION_BACKEND", "internal")
+ elif config.auth_backend == "keystone":
+ keystone_secret_name = f"{self.app.name}-keystone-secret"
+ pod_spec_builder.add_secret(
+ keystone_secret_name,