Skip to content

Commit

Permalink
homelab: add cilium policies to argocd
Browse files Browse the repository at this point in the history
Signed-off-by: aserowy <serowy@hotmail.com>
  • Loading branch information
aserowy committed Nov 9, 2024
1 parent 798cd00 commit dd57215
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions cluster/homelab/argocd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,73 @@
};
global.networkPolicy.create = true;
};
};

resources = {
ciliumNetworkPolicies = {
allow-world-egress.spec = {
endpointSelector.matchLabels."app.kubernetes.io/name" = "argocd-repo-server";
egress = [
{
toEndpoints = [
{
matchLabels = {
"k8s:io.kubernetes.pod.namespace" = "kube-system";
"k8s:k8s-app" = "kube-dns";
};
}
];
toPorts = [
{
ports = [
{
port = "53";
protocol = "ANY";
}
];
rules.dns = [
{ matchPattern = "*"; }
];
}
];
}
{
toFQDNs = [
{ matchName = "github.com"; }
];
toPorts = [
{
ports = [
{
port = "443";
protocol = "TCP";
}
];
}
];
}
];
};

allow-kube-apiserver-egress.spec = {
endpointSelector.matchLabels."app.kubernetes.io/part-of" = "argocd";
egress = [
{
toEntities = [ "kube-apiserver" ];
toPorts = [
{
ports = [
{
port = "6443";
protocol = "TCP";
}
];
}
];
}
];
};
};
};
};
}

0 comments on commit dd57215

Please sign in to comment.