outposts: make k8s service type configurable

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-05 15:37:56 +02:00
parent 9a15a66d85
commit b266a2cdfb
2 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,11 @@ class ServiceReconciler(KubernetesObjectReconciler[V1Service]):
selector_labels = DeploymentReconciler(self.controller).get_pod_meta()
return V1Service(
metadata=meta,
spec=V1ServiceSpec(ports=ports, selector=selector_labels, type="ClusterIP"),
spec=V1ServiceSpec(
ports=ports,
selector=selector_labels,
type=self.controller.outpost.config.kubernetes_service_type,
),
)
def create(self, reference: V1Service):

View File

@ -61,6 +61,7 @@ class OutpostConfig:
kubernetes_namespace: str = field(default="default")
kubernetes_ingress_annotations: dict[str, str] = field(default_factory=dict)
kubernetes_ingress_secret_name: str = field(default="authentik-outpost")
kubernetes_service_type: str = field(default="ClusterIP")
class OutpostModel(Model):