80
80
# kubectl
81
81
curl -L https://dl.k8s.io/${{ env.K8S_VERSION }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
82
82
# kind
83
- curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/v0.17 .0/kind-linux-amd64
83
+ curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/v0.20 .0/kind-linux-amd64
84
84
# Install
85
85
sudo cp ${TMP_DIR}/ginkgo /usr/local/bin/ginkgo
86
86
sudo cp ${TMP_DIR}/e2e.test /usr/local/bin/e2e.test
@@ -103,6 +103,12 @@ jobs:
103
103
ipFamily: ${IP_FAMILY}
104
104
nodes:
105
105
- role: control-plane
106
+ kubeadmConfigPatchesJSON6902:
107
+ - kind: ClusterConfiguration
108
+ patch: |
109
+ - op: add
110
+ path: /apiServer/certSANs/-
111
+ value: konnectivity-server.kube-system.svc.cluster.local
106
112
kubeadmConfigPatches:
107
113
- |
108
114
kind: ClusterConfiguration
@@ -121,7 +127,10 @@ jobs:
121
127
extraMounts:
122
128
- hostPath: ./examples/kind/egress_selector_configuration.yaml
123
129
containerPath: /etc/kubernetes/konnectivity-server-config/egress_selector_configuration.yaml
130
+ - role: worker
131
+ - role: worker
124
132
EOF
133
+
125
134
# dump the kubeconfig for later
126
135
/usr/local/bin/kind get kubeconfig --name ${{ env.KIND_CLUSTER_NAME}} > _artifacts/kubeconfig.conf
127
136
@@ -143,79 +152,81 @@ jobs:
143
152
kubectl apply -f examples/kind/konnectivity-server.yaml
144
153
kubectl apply -f examples/kind/konnectivity-agent-ds.yaml
145
154
146
- # - name: Get Cluster status
147
- # run: |
148
- # # wait network is ready
149
- # sleep 5
150
- # /usr/local/bin/kubectl get nodes -o wide
151
- # /usr/local/bin/kubectl get pods -A
152
- # /usr/local/bin/kubectl wait --timeout=1m --for=condition=ready pods --namespace=kube-system -l k8s-app=konnectivity-agent
153
- # /usr/local/bin/kubectl wait --timeout=1m --for=condition=ready pods --namespace=kube-system -l k8s-app=konnectivity-server
154
- # # smoke test
155
- # /usr/local/bin/kubectl run test --image httpd:2
156
- # /usr/local/bin/kubectl wait --timeout=1m --for=condition=ready pods test
157
- # /usr/local/bin/kubectl logs test
158
-
159
- # - name: Workaround CoreDNS for IPv6 airgapped
160
- # if: ${{ matrix.ipFamily == 'ipv6' }}
161
- # run: |
162
- # # Patch CoreDNS to work in Github CI
163
- # # 1. Github CI doesn´t offer IPv6 connectivity, so CoreDNS should be configured
164
- # # to work in an offline environment:
165
- # # https://github.com/coredns/coredns/issues/2494#issuecomment-457215452
166
- # # 2. Github CI adds following domains to resolv.conf search field:
167
- # # .net.
168
- # # CoreDNS should handle those domains and answer with NXDOMAIN instead of SERVFAIL
169
- # # otherwise pods stops trying to resolve the domain.
170
- # # Get the current config
171
- # original_coredns=$(/usr/local/bin/kubectl get -oyaml -n=kube-system configmap/coredns)
172
- # echo "Original CoreDNS config:"
173
- # echo "${original_coredns}"
174
- # # Patch it
175
- # fixed_coredns=$(
176
- # printf '%s' "${original_coredns}" | sed \
177
- # -e 's/^.*kubernetes cluster\.local/& net/' \
178
- # -e '/^.*upstream$/d' \
179
- # -e '/^.*fallthrough.*$/d' \
180
- # -e '/^.*forward . \/etc\/resolv.conf$/d' \
181
- # -e '/^.*loop$/d' \
182
- # )
183
- # echo "Patched CoreDNS config:"
184
- # echo "${fixed_coredns}"
185
- # printf '%s' "${fixed_coredns}" | /usr/local/bin/kubectl apply -f -
186
-
187
- # - name: Run tests
188
- # run: |
189
- # export KUBERNETES_CONFORMANCE_TEST='y'
190
- # export E2E_REPORT_DIR=${PWD}/_artifacts
191
-
192
- # # Run tests
193
- # /usr/local/bin/ginkgo --nodes=25 \
194
- # --focus="\[Conformance\]" \
195
- # --skip="Feature|Federation|machinery|PerformanceDNS|DualStack|Disruptive|Serial|Slow|KubeProxy|LoadBalancer|GCE|Netpol|NetworkPolicy|NodeConformance" \
196
- # /usr/local/bin/e2e.test \
197
- # -- \
198
- # --kubeconfig=${PWD}/_artifacts/kubeconfig.conf \
199
- # --provider=local \
200
- # --dump-logs-on-failure=false \
201
- # --report-dir=${E2E_REPORT_DIR} \
202
- # --disable-log-dump=true
203
-
204
- # - name: Upload Junit Reports
205
- # if: always()
206
- # uses: actions/upload-artifact@v2
207
- # with:
208
- # name: kind-junit-${{ env.JOB_NAME }}-${{ github.run_id }}
209
- # path: './_artifacts/*.xml'
210
-
211
- # - name: Export logs
212
- # if: always()
213
- # run: |
214
- # /usr/local/bin/kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug ./_artifacts/logs
215
-
216
- # - name: Upload logs
217
- # if: always()
218
- # uses: actions/upload-artifact@v2
219
- # with:
220
- # name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
221
- # path: ./_artifacts/logs
155
+ - name : Get Cluster status
156
+ run : |
157
+ # wait network is ready
158
+ sleep 5
159
+ /usr/local/bin/kubectl get nodes -o wide
160
+ /usr/local/bin/kubectl get pods -A
161
+ /usr/local/bin/kubectl wait --timeout=1m --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-dns
162
+ # smoke test
163
+ /usr/local/bin/kubectl run test --image httpd:2
164
+ /usr/local/bin/kubectl wait --timeout=1m --for=condition=ready pods test
165
+ /usr/local/bin/kubectl get pods -A -owide
166
+ /usr/local/bin/kubectl wait --timeout=1m --for=condition=ready pods --namespace=kube-system -l k8s-app=konnectivity-agent
167
+ /usr/local/bin/kubectl logs test
168
+
169
+
170
+ - name : Workaround CoreDNS for IPv6 airgapped
171
+ if : ${{ matrix.ipFamily == 'ipv6' }}
172
+ run : |
173
+ # Patch CoreDNS to work in Github CI
174
+ # 1. Github CI doesn´t offer IPv6 connectivity, so CoreDNS should be configured
175
+ # to work in an offline environment:
176
+ # https://github.com/coredns/coredns/issues/2494#issuecomment-457215452
177
+ # 2. Github CI adds following domains to resolv.conf search field:
178
+ # .net.
179
+ # CoreDNS should handle those domains and answer with NXDOMAIN instead of SERVFAIL
180
+ # otherwise pods stops trying to resolve the domain.
181
+ # Get the current config
182
+ original_coredns=$(/usr/local/bin/kubectl get -oyaml -n=kube-system configmap/coredns)
183
+ echo "Original CoreDNS config:"
184
+ echo "${original_coredns}"
185
+ # Patch it
186
+ fixed_coredns=$(
187
+ printf '%s' "${original_coredns}" | sed \
188
+ -e 's/^.*kubernetes cluster\.local/& net/' \
189
+ -e '/^.*upstream$/d' \
190
+ -e '/^.*fallthrough.*$/d' \
191
+ -e '/^.*forward . \/etc\/resolv.conf$/d' \
192
+ -e '/^.*loop$/d' \
193
+ )
194
+ echo "Patched CoreDNS config:"
195
+ echo "${fixed_coredns}"
196
+ printf '%s' "${fixed_coredns}" | /usr/local/bin/kubectl apply -f -
197
+
198
+ - name : Run tests
199
+ run : |
200
+ export KUBERNETES_CONFORMANCE_TEST='y'
201
+ export E2E_REPORT_DIR=${PWD}/_artifacts
202
+
203
+ # Run tests
204
+ /usr/local/bin/ginkgo --nodes=25 \
205
+ --focus="\[Conformance\]" \
206
+ --skip="Feature|Federation|machinery|PerformanceDNS|DualStack|Disruptive|Serial|Slow|KubeProxy|LoadBalancer|GCE|Netpol|NetworkPolicy|NodeConformance" \
207
+ /usr/local/bin/e2e.test \
208
+ -- \
209
+ --kubeconfig=${PWD}/_artifacts/kubeconfig.conf \
210
+ --provider=local \
211
+ --dump-logs-on-failure=false \
212
+ --report-dir=${E2E_REPORT_DIR} \
213
+ --disable-log-dump=true
214
+
215
+ - name : Upload Junit Reports
216
+ if : always()
217
+ uses : actions/upload-artifact@v2
218
+ with :
219
+ name : kind-junit-${{ env.JOB_NAME }}-${{ github.run_id }}
220
+ path : ' ./_artifacts/*.xml'
221
+
222
+ - name : Export logs
223
+ if : always()
224
+ run : |
225
+ /usr/local/bin/kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug ./_artifacts/logs
226
+
227
+ - name : Upload logs
228
+ if : always()
229
+ uses : actions/upload-artifact@v2
230
+ with :
231
+ name : kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
232
+ path : ./_artifacts/logs
0 commit comments