-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now with k8s 1.29.x and networkpolicy support. Also installs espejo with a rule to create an approximation of APPUiO's default network policies in each appcat namespace.
- Loading branch information
Showing
14 changed files
with
629 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
control-plane: controller-manager | ||
name: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# permissions to do leader election. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: leader-election-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: leader-election-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: leader-election-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: espejo | ||
namespace: system | ||
spec: | ||
selector: | ||
matchLabels: | ||
control-plane: controller-manager | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
control-plane: controller-manager | ||
spec: | ||
securityContext: | ||
runAsUser: 65532 | ||
containers: | ||
- name: operator | ||
image: quay.io/vshn/espejo:v0.5.0 | ||
args: | ||
- --enable-leader-election | ||
resources: | ||
limits: | ||
cpu: 300m | ||
memory: 100Mi | ||
requests: | ||
cpu: 20m | ||
memory: 50Mi | ||
env: | ||
- name: WATCH_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
terminationGracePeriodSeconds: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: kube-network-policies | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- namespaces | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "networking.k8s.io" | ||
resources: | ||
- networkpolicies | ||
verbs: | ||
- list | ||
- watch | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: kube-network-policies | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kube-network-policies | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kube-network-policies | ||
namespace: kube-system | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kube-network-policies | ||
namespace: kube-system | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: kube-network-policies | ||
namespace: kube-system | ||
labels: | ||
tier: node | ||
app: kube-network-policies | ||
k8s-app: kube-network-policies | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: kube-network-policies | ||
template: | ||
metadata: | ||
labels: | ||
tier: node | ||
app: kube-network-policies | ||
k8s-app: kube-network-policies | ||
spec: | ||
hostNetwork: true | ||
dnsPolicy: ClusterFirst | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
tolerations: | ||
- operator: Exists | ||
effect: NoSchedule | ||
serviceAccountName: kube-network-policies | ||
containers: | ||
- name: kube-network-policies | ||
image: registry.k8s.io/networking/kube-network-policies:v0.6.0 | ||
args: | ||
- /bin/netpol | ||
- --hostname-override=$(MY_NODE_NAME) | ||
- --v=2 | ||
- --nfqueue-id=98 | ||
volumeMounts: | ||
- name: lib-modules | ||
mountPath: /lib/modules | ||
readOnly: true | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
memory: "50Mi" | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: ["NET_ADMIN"] | ||
env: | ||
- name: MY_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
volumes: | ||
- name: lib-modules | ||
hostPath: | ||
path: /lib/modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: manager-role | ||
rules: | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces/status | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- sync.appuio.ch | ||
resources: | ||
- syncconfigs | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- sync.appuio.ch | ||
resources: | ||
- syncconfigs/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- networking.k8s.io | ||
resources: | ||
- networkpolicies | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: manager-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: manager-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: system |
Oops, something went wrong.