diff --git a/KubernetesWorkflow/K8sController.cs b/KubernetesWorkflow/K8sController.cs index 782632d..90d0b32 100644 --- a/KubernetesWorkflow/K8sController.cs +++ b/KubernetesWorkflow/K8sController.cs @@ -165,6 +165,19 @@ namespace KubernetesWorkflow PodSelector = new V1LabelSelector {} } } + }, + new V1NetworkPolicyIngressRule + { + FromProperty = new List + { + new V1NetworkPolicyPeer + { + NamespaceSelector = new V1LabelSelector + { + MatchLabels = GetRunnerNamespaceSelector() + } + } + } } }, Egress = new List @@ -310,6 +323,11 @@ namespace KubernetesWorkflow return new Dictionary { { "codex-test-node", "dist-test-" + workflowNumberSource.WorkflowNumber } }; } + private IDictionary GetRunnerNamespaceSelector() + { + return new Dictionary { { "kubernetes.io/metadata.name", "default" } }; + } + private V1ObjectMeta CreateDeploymentMetadata() { return new V1ObjectMeta