parent
937c3db160
commit
983e1b84cc
|
@ -219,6 +219,19 @@ namespace KubernetesWorkflow
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new V1NetworkPolicyIngressRule
|
||||
{
|
||||
FromProperty = new List<V1NetworkPolicyPeer>
|
||||
{
|
||||
new V1NetworkPolicyPeer
|
||||
{
|
||||
NamespaceSelector = new V1LabelSelector
|
||||
{
|
||||
MatchLabels = GetPrometheusNamespaceSelector()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Egress = new List<V1NetworkPolicyEgressRule>
|
||||
|
@ -371,6 +384,11 @@ namespace KubernetesWorkflow
|
|||
return new Dictionary<string, string> { { "kubernetes.io/metadata.name", "default" } };
|
||||
}
|
||||
|
||||
private IDictionary<string, string> GetPrometheusNamespaceSelector()
|
||||
{
|
||||
return new Dictionary<string, string> { { "kubernetes.io/metadata.name", "monitoring" } };
|
||||
}
|
||||
|
||||
private IDictionary<string, string> GetAnnotations(ContainerRecipe[] containerRecipes)
|
||||
{
|
||||
return containerRecipes.First().PodAnnotations.GetAnnotations();
|
||||
|
|
Loading…
Reference in New Issue