Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: network separtion by namespaces #8

Open
wants to merge 1 commit into
base: self-managed-k8s-security-groups
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions deploy-namespace-separation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: namespace-a
labels:
team: a
---
apiVersion: v1
kind: Namespace
metadata:
name: namespace-b
labels:
team: b
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-security-demo
namespace: namespace-a
labels:
app: k8s-security-demo
spec:
replicas: 1
selector:
matchLabels:
app: k8s-security-demo
template:
metadata:
labels:
app: k8s-security-demo
spec:
containers:
- name: hello
image: ironcore864/k8s-security-demo:pod-as-non-root
ports:
- containerPort: 8080
securityContext:
runAsNonRoot: True
---
kind: Service
apiVersion: v1
metadata:
name: k8s-security-demo
namespace: namespace-a
spec:
selector:
app: k8s-security-demo
ports:
- port: 80
targetPort: 8080
11 changes: 11 additions & 0 deletions testpod-namespace-separation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Pod
metadata:
name: testpod
namespace: namespace-b
spec:
containers:
- name: curl
image: curlimages/curl
command: [ "sleep", "600" ]