File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,13 @@ jobs:
120
120
121
121
- name : Install kube-network-policies
122
122
run : |
123
+ # stop kindnet of applying network policies
124
+ kubectl -n kube-system set image ds kindnet kindnet-cni=docker.io/kindest/kindnetd:v20230809-80a64d96
123
125
# preload kube-network-policies image
124
126
docker load --input kube-network-policies-image.tar
125
127
/usr/local/bin/kind load docker-image registry.k8s.io/networking/kube-network-policies:test --name ${{ env.KIND_CLUSTER_NAME}}
126
128
sed -i s#registry.k8s.io/networking/kube-network-policies.*#registry.k8s.io/networking/kube-network-policies:test# install.yaml
127
129
/usr/local/bin/kubectl apply -f ./install.yaml
128
- # stop kindnet of checking network policies
129
- kubectl -n kube-system delete clusterrolebinding kindnet
130
130
131
131
- name : Get Cluster status
132
132
run : |
Original file line number Diff line number Diff line change @@ -109,15 +109,15 @@ jobs:
109
109
110
110
- name : Install kube-network-policies
111
111
run : |
112
+ # stop kindnet of applying network policies
113
+ kubectl -n kube-system set image ds kindnet kindnet-cni=docker.io/kindest/kindnetd:v20230809-80a64d96
112
114
/usr/local/bin/kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/network-policy-api/main/config/crd/experimental/policy.networking.k8s.io_adminnetworkpolicies.yaml
113
115
/usr/local/bin/kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/network-policy-api/main/config/crd/experimental/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml
114
116
# preload kube-network-policies image
115
117
docker load --input kube-network-policies-image.tar
116
118
/usr/local/bin/kind load docker-image registry.k8s.io/networking/kube-network-policies:test --name ${{ env.KIND_CLUSTER_NAME}}
117
119
sed -i s#registry.k8s.io/networking/kube-network-policies.*#registry.k8s.io/networking/kube-network-policies:test# install-anp.yaml
118
120
/usr/local/bin/kubectl apply -f ./install-anp.yaml
119
- # stop kindnet of checking network policies
120
- kubectl -n kube-system delete clusterrolebinding kindnet
121
121
122
122
- name : Get Cluster status
123
123
run : |
Original file line number Diff line number Diff line change 136
136
# Patch kube-proxy to set the verbosity level
137
137
kubectl patch -n kube-system daemonset/kube-proxy \
138
138
--type=' json' -p=' [{"op": "add", "path": "/spec/template/spec/containers/0/command/-", "value": "--v=' " ${KIND_CLUSTER_LOG_LEVEL} " ' " }]'
139
+
140
+ # stop kindnet of applying network policies
141
+ kubectl -n kube-system set image ds kindnet kindnet-cni=docker.io/kindest/kindnetd:v20230809-80a64d96
139
142
}
140
143
141
144
# run e2es with ginkgo-e2e.sh
@@ -208,8 +211,6 @@ run_tests() {
208
211
}
209
212
210
213
install_kube_network_policy () {
211
- # stop kindnet of checking network policies
212
- kubectl -n kube-system delete clusterrolebinding kindnet
213
214
# Install kube-network-policies
214
215
export IMAGE_NAME=" registry.k8s.io/networking/kube-network-policies"
215
216
# Build the image
Original file line number Diff line number Diff line change 34
34
printf ' %s' " ${_install} " | kubectl apply -f -
35
35
kubectl wait --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-network-policies
36
36
37
- # stop kindnet of checking network policies
38
- kubectl -n kube-system delete clusterrolebinding kindnet
37
+ # stop kindnet of applying network policies
38
+ kubectl -n kube-system set image ds kindnet kindnet-cni=docker.io/kindest/kindnetd:v20230809-80a64d96
39
39
40
40
# Expose a webserver in the default namespace
41
41
kubectl run web --image=httpd:2 --labels=" app=web" --expose --port=80
You can’t perform that action at this time.
0 commit comments