Skip to content

Commit 4f50788

Browse files
committed
chore: improved validate ci
1 parent ec8e726 commit 4f50788

File tree

1 file changed

+91
-5
lines changed

1 file changed

+91
-5
lines changed

test/manifest.yaml

Lines changed: 91 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,98 @@ metadata:
4747
spec:
4848
selector:
4949
app: postgres
50-
type: NodePort
50+
type: NodePort
5151
ports:
52-
- name: postgres
53-
port: 5432
54-
targetPort: 5432
55-
nodePort: 30000
52+
- name: postgres
53+
port: 5432
54+
targetPort: 5432
55+
nodePort: 30000
56+
---
57+
apiVersion: networking.k8s.io/v1
58+
kind: NetworkPolicy
59+
metadata:
60+
name: controller
61+
namespace: project
62+
labels:
63+
app: controller
64+
app.kubernetes.io/name: controller
65+
app.kubernetes.io/version: "0.12.11"
66+
spec:
67+
podSelector:
68+
matchLabels:
69+
app: controller
70+
policyTypes:
71+
- Ingress
72+
- Egress
73+
egress:
74+
# Kubernetes apiserver access
75+
- to:
76+
- ipBlock:
77+
cidr: 0.0.0.0/0
78+
ports:
79+
- port: 443
80+
protocol: TCP
81+
- port: 6443
82+
protocol: TCP
83+
# DNS egress
84+
- to:
85+
- podSelector:
86+
matchLabels:
87+
k8s-app: kube-dns
88+
ports:
89+
- port: 53
90+
protocol: UDP
91+
ingress:
92+
# prometheus metrics scraping support
93+
- from:
94+
- namespaceSelector:
95+
matchLabels:
96+
name: monitoring
97+
podSelector:
98+
matchLabels:
99+
app: prometheus
100+
ports:
101+
- port: http
102+
protocol: TCP
103+
---
104+
# Scoped service account
105+
apiVersion: v1
106+
kind: ServiceAccount
107+
metadata:
108+
name: controller
109+
labels:
110+
app: controller
111+
app.kubernetes.io/name: controller
112+
app.kubernetes.io/version: "0.12.11"
113+
namespace: project
114+
automountServiceAccountToken: true
115+
---
116+
# Access for the service account
117+
kind: ClusterRole
118+
apiVersion: rbac.authorization.k8s.io/v1
119+
metadata:
120+
name: controller
121+
rules:
122+
- apiGroups: ["demeter.run"]
123+
resources: ["dbsyncports", "dbsyncports/status", "dbsyncports/finalizers"]
124+
verbs: ["get", "list", "watch", "patch", "update"]
125+
- apiGroups: ["events.k8s.io"]
126+
resources: ["events"]
127+
verbs: ["create"]
128+
---
129+
# Binding the role to the account
130+
kind: ClusterRoleBinding
131+
apiVersion: rbac.authorization.k8s.io/v1
132+
metadata:
133+
name: controller
134+
subjects:
135+
- kind: ServiceAccount
136+
namespace: project
137+
name: controller
138+
roleRef:
139+
kind: ClusterRole
140+
name: controller
141+
apiGroup: rbac.authorization.k8s.io
56142
---
57143
# Run controller
58144
apiVersion: apps/v1

0 commit comments

Comments
 (0)