apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: k8s-mgmt-pod spec: podSelector: matchLabels: app.kubernetes.io/name: k8s-mgmt-pod policyTypes: - Ingress ingress: # Starting point only. Adjust these selectors to the namespaces or pods that should reach the bastion. - from: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: k8s-mgmt-pod - namespaceSelector: matchLabels: k8s-mgmt-pod-access: "true" ports: - protocol: TCP port: 22 - protocol: TCP port: 3000