Skip to content

Commit

Permalink
Apply serviceAccounts to deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Aug 29, 2022
1 parent 483a40b commit e69e997
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
65 changes: 65 additions & 0 deletions templates/kiss/kiss-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,68 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kiss-controller
namespace: kiss
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kiss-controller-ansible-playbook
namespace: kiss
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ansible-playbook
subjects:
- apiGroup: ""
kind: ServiceAccount
name: kiss-controller
namespace: kiss
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kiss-controller
namespace: kiss
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kiss-controller
namespace: kiss
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kiss-controller
subjects:
- apiGroup: ""
kind: ServiceAccount
name: kiss-controller
namespace: kiss
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kiss-controller-ansible-playbook
namespace: kiss
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ansible-playbook
subjects:
- apiGroup: ""
kind: ServiceAccount
name: kiss-controller
namespace: kiss
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -21,6 +85,7 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
serviceAccount: kiss-controller
containers:
- name: controller
image: ghcr.io/ulagbulag-village/netai-cloud:master
Expand Down
1 change: 1 addition & 0 deletions templates/kiss/kiss-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
serviceAccount: kiss-controller
containers:
- name: monitor
image: ghcr.io/ulagbulag-village/netai-cloud:master
Expand Down
12 changes: 12 additions & 0 deletions templates/kiss/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ spec:
policyTypes:
- Ingress
- Egress
egress:
- to:
- ipBlock:
cidr: 169.254.0.0/16 # nodelocaldns
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand All @@ -28,8 +32,12 @@ spec:
- Egress
egress:
- to:
- ipBlock:
cidr: 10.0.0.0/11
- ipBlock:
cidr: 10.32.0.0/12
- ipBlock:
cidr: 10.112.0.0/12
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand All @@ -49,6 +57,10 @@ spec:
cidr: 10.32.0.0/12
- ipBlock:
cidr: 0.0.0.0/0 # TODO: disable it when kiss is deployed
egress:
- to:
- ipBlock:
cidr: 10.0.0.0/8
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down

0 comments on commit e69e997

Please sign in to comment.