Skip to content

Commit

Permalink
isolate logic (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola authored Jan 10, 2023
1 parent dfc5465 commit 9ea8baf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export class KubeClient extends Client {

writeLocalJsonFile(this.tmpDir, "namespace", namespaceDef);
await this.createResource(namespaceDef);

// ensure namespace isolation IFF we are running in CI
if (process.env.RUN_IN_CONTAINER === "1")
await this.createStaticResource("namespace-network-policy.yaml");
}

async spawnFromDef(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: internal-access
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: In
values:
- {{namespace}}
- gitlab
- loki
- tempo
- monitoring
- parachain-exporter
policyTypes:
- Ingress

0 comments on commit 9ea8baf

Please sign in to comment.