Skip to content

Commit

Permalink
See what happens when we whitelist a NS without RBAC access
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta committed Mar 25, 2019
1 parent ebc1535 commit c89a1b3
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flux-system/deployment-flux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- --ssh-keygen-dir=/var/fluxd/keygen
- [email protected]:2opremio/locked-down-flux.git
- --git-branch=deploy
- --git-path=helloworld-flux/
- --git-path=helloworld-flux,helloworld2-flux
- --git-ci-skip
- --k8s-namespace-whitelist=helloworld
- --k8s-namespace-whitelist=helloworld,helloworld2
- --listen-metrics=:3031
35 changes: 35 additions & 0 deletions helloworld2-flux/deployment-echoserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: helloworld2
labels:
app: echoserver
component: echoserver
annotations:
flux.weave.works/tag.echoserver: semver:*
spec:
replicas: 1
selector:
matchLabels:
app: echoserver
component: echoserver
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: echoserver
component: echoserver
spec:
containers:
- name: echoserver
image: gcr.io/google-samples/hello-app:1.0
ports:
- name: web
containerPort: 8080
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
automountServiceAccountToken: false
5 changes: 5 additions & 0 deletions helloworld2-flux/namespace-helloworld2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: helloworld2
20 changes: 20 additions & 0 deletions helloworld2-flux/networkpolicy-echoserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: echoserver
namespace: helloworld2
labels:
app: echoserver
spec:
podSelector:
matchLabels:
app: echoserver
component: echoserver
policyTypes:
- Ingress
- Egress
ingress:
- ports:
- protocol: TCP
port: 8080
18 changes: 18 additions & 0 deletions helloworld2-flux/service-echoserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: v1
kind: Service
metadata:
name: echoserver
namespace: helloworld2
labels:
app: echoserver
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: http
selector:
app: echoserver
component: echoserver

0 comments on commit c89a1b3

Please sign in to comment.