File tree Expand file tree Collapse file tree 5 files changed +117
-3
lines changed
addons/kube-network-policies Expand file tree Collapse file tree 5 files changed +117
-3
lines changed Original file line number Diff line number Diff line change
1
+ # See the OWNERS docs at https://go.k8s.io/owners
2
+
3
+ approvers:
4
+ - aojea
5
+ - danwinship
6
+ reviewers:
7
+ - aojea
8
+ - danwinship
Original file line number Diff line number Diff line change
1
+ kind : ClusterRole
2
+ apiVersion : rbac.authorization.k8s.io/v1
3
+ metadata :
4
+ name : system:network-policies
5
+ namespace : kube-system
6
+ labels :
7
+ addonmanager.kubernetes.io/mode : Reconcile
8
+ rules :
9
+ - apiGroups : [""]
10
+ resources :
11
+ - pods
12
+ - nodes
13
+ - namespaces
14
+ verbs :
15
+ - get
16
+ - watch
17
+ - list
18
+ # Watch for changes to Kubernetes NetworkPolicies.
19
+ - apiGroups : ["networking.k8s.io"]
20
+ resources :
21
+ - networkpolicies
22
+ verbs :
23
+ - watch
24
+ - list
25
+ ---
26
+ kind : ClusterRoleBinding
27
+ apiVersion : rbac.authorization.k8s.io/v1
28
+ metadata :
29
+ name : kube-network-policies
30
+ labels :
31
+ addonmanager.kubernetes.io/mode : Reconcile
32
+ roleRef :
33
+ apiGroup : rbac.authorization.k8s.io
34
+ kind : ClusterRole
35
+ name : system:network-policies
36
+ subjects :
37
+ - kind : ServiceAccount
38
+ name : kube-network-policies
39
+ namespace : kube-system
40
+ ---
41
+ apiVersion : v1
42
+ kind : ServiceAccount
43
+ metadata :
44
+ name : kube-network-policies
45
+ namespace : kube-system
46
+ labels :
47
+ k8s-app : kube-network-policies
48
+ kubernetes.io/cluster-service : " true"
49
+ addonmanager.kubernetes.io/mode : Reconcile
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : apps/v1
3
+ kind : DaemonSet
4
+ metadata :
5
+ name : kube-network-policies
6
+ namespace : kube-system
7
+ labels :
8
+ tier : node
9
+ app : kube-network-policies
10
+ k8s-app : kube-network-policies
11
+ addonmanager.kubernetes.io/mode : Reconcile
12
+ spec :
13
+ selector :
14
+ matchLabels :
15
+ app : kube-network-policies
16
+ template :
17
+ metadata :
18
+ labels :
19
+ tier : node
20
+ app : kube-network-policies
21
+ k8s-app : kube-network-policies
22
+ spec :
23
+ hostNetwork : true
24
+ tolerations :
25
+ - operator : Exists
26
+ effect : NoSchedule
27
+ serviceAccountName : kube-network-policies
28
+ containers :
29
+ - name : kube-network-policies
30
+ image : registry.k8s.io/networking/kube-network-policies:v0.1.0
31
+ command :
32
+ - /bin/sh
33
+ - -c
34
+ - /bin/netpol -v 4 1>>/var/log/kube-network-policies.log 2>&1
35
+ resources :
36
+ requests :
37
+ cpu : " 100m"
38
+ memory : " 50Mi"
39
+ securityContext :
40
+ privileged : true
41
+ volumeMounts :
42
+ - mountPath : /var/log
43
+ name : varlog
44
+ readOnly : false
45
+ - mountPath : /lib/modules
46
+ name : lib-modules
47
+ readOnly : true
48
+ volumes :
49
+ - name : varlog
50
+ hostPath :
51
+ path : /var/log
52
+ - name : lib-modules
53
+ hostPath :
54
+ path : /lib/modules
Original file line number Diff line number Diff line change @@ -2984,6 +2984,9 @@ EOF
2984
2984
local -r ds_file=" ${dst_dir} /calico-policy-controller/calico-node-daemonset.yaml"
2985
2985
sed -i -e " s@__CALICO_CNI_DIR__@/home/kubernetes/bin@g" " ${ds_file} "
2986
2986
fi
2987
+ if [[ " ${NETWORK_POLICY_PROVIDER:- } " == " kube-network-policies" ]]; then
2988
+ setup-addon-manifests " addons" " kube-network-policies"
2989
+ fi
2987
2990
if [[ " ${ENABLE_DEFAULT_STORAGE_CLASS:- } " == " true" ]]; then
2988
2991
setup-addon-manifests " addons" " storage-class/gce"
2989
2992
fi
@@ -3249,8 +3252,8 @@ function setup-containerd {
3249
3252
}
3250
3253
EOF
3251
3254
if [[ " ${KUBERNETES_MASTER:- } " != " true" ]]; then
3252
- if [[ " ${NETWORK_POLICY_PROVIDER:- " none" } " != " none " || " ${ENABLE_NETD:- } " == " true" ]]; then
3253
- # Use Kubernetes cni daemonset on node if network policy provider is specified
3255
+ if [[ " ${NETWORK_POLICY_PROVIDER:- " none" } " == " calico " || " ${ENABLE_NETD:- } " == " true" ]]; then
3256
+ # Use Kubernetes cni daemonset on node if network policy provider calico is specified
3254
3257
# or netd is enabled.
3255
3258
cni_template_path=" "
3256
3259
fi
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ readonly node_ssh_supported_providers="gce gke aws"
42
42
readonly gcloud_supported_providers=" gce gke"
43
43
44
44
readonly master_logfiles=" kube-apiserver.log kube-apiserver-audit.log kube-scheduler.log kube-controller-manager.log cloud-controller-manager.log etcd.log etcd-events.log glbc.log cluster-autoscaler.log kube-addon-manager.log konnectivity-server.log fluentd.log kubelet.cov"
45
- readonly node_logfiles=" kube-proxy.log containers/konnectivity-agent-*.log fluentd.log node-problem-detector.log kubelet.cov"
45
+ readonly node_logfiles=" kube-proxy.log containers/konnectivity-agent-*.log fluentd.log node-problem-detector.log kubelet.cov kube-network-policies.log "
46
46
readonly node_systemd_services=" node-problem-detector"
47
47
readonly hollow_node_logfiles=" kubelet-hollow-node-*.log kubeproxy-hollow-node-*.log npd-hollow-node-*.log"
48
48
readonly aws_logfiles=" cloud-init-output.log"
You can’t perform that action at this time.
0 commit comments