Skip to content

Commit

Permalink
Merge pull request #160 from Abirdcfly/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Abirdcfly authored Jul 26, 2023
2 parents 5c1fd40 + fb57dfa commit f4cb540
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ var _ = Describe("webhook", Label("webhook"), func() {
fmt.Println("check the resource of pod successfully")
})
if LowKubernetesVersion("v1.18") {
Expect(output).To(Equal(`map[cpu:50m memory:629145Ki]`), func() string {
Expect(output).To(Equal(`map[cpu:250m memory:64Mi]`), func() string {
return output
})
} else {
Expect(output).To(Equal(`{"cpu":"50m","memory":"629145Ki"}`), func() string {
Expect(output).To(Equal(`{"cpu":"250m","memory":"64Mi"}`), func() string {
return output
})
}
Expand Down
6 changes: 3 additions & 3 deletions tests/install-infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function build_image {
function install_prometheus_by_helm {
echo "prometheus install start..."
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm upgrade --wait --install prometheus prometheus-community/prometheus --namespace kube-system --set prometheus.service.type=NodePort --set prometheus.service.nodePort=30900
helm upgrade --debug --wait --install prometheus prometheus-community/prometheus --namespace kube-system --set prometheus.service.type=NodePort --set prometheus.service.nodePort=30900 --set kube-state-metrics.securityContext.enabled=false
echo "prometheus install finish!"
}

Expand All @@ -40,14 +40,14 @@ function install_certmanager_by_helm {
CertMangerVersion="v1.8.2"
fi
helm repo add jetstack https://charts.jetstack.io
helm upgrade --wait --install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version $CertMangerVersion --set installCRDs=true
helm upgrade --debug --wait --install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version $CertMangerVersion --set installCRDs=true
echo "cert manager install finish!"
}

function install_metrics_server_by_helm {
echo "metrics-server install start..."
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm upgrade --install metrics-server metrics-server/metrics-server --namespace=metrics-server --create-namespace
helm upgrade --debug --install metrics-server metrics-server/metrics-server --namespace=metrics-server --create-namespace --set securityContext=null
# https://github.com/kubernetes-sigs/metrics-server/issues/917#issuecomment-986732226
kubectl scale --replicas=0 --timeout=${TIMEOUT} -n metrics-server deployment/metrics-server
kubectl patch deploy -n metrics-server metrics-server --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls"}]'
Expand Down
9 changes: 9 additions & 0 deletions tests/prepare-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@ function kind_up_cluster {
# https://github.com/kubernetes-sigs/kind/releases
case $K8S_VERSION in
v1.18 | v1.18.20)
go install sigs.k8s.io/[email protected]
mv $HOME/go/bin/kind /usr/local/bin/kind
kind version
kind_image="kindest/node:v1.18.20@sha256:61c9e1698c1cb19c3b1d8151a9135b379657aee23c59bde4a8d87923fcb43a91"
;;
v1.19 | v1.19.16)
go install sigs.k8s.io/[email protected]
mv $HOME/go/bin/kind /usr/local/bin/kind
kind version
kind_image="kindest/node:v1.19.16@sha256:707469aac7e6805e52c3bde2a8a8050ce2b15decff60db6c5077ba9975d28b98"
;;
v1.20 | v1.20.15)
go install sigs.k8s.io/[email protected]
mv $HOME/go/bin/kind /usr/local/bin/kind
kind version
kind_image="kindest/node:v1.20.15@sha256:d67de8f84143adebe80a07672f370365ec7d23f93dc86866f0e29fa29ce026fe"
;;
v1.21 | v1.21.14)
Expand Down

0 comments on commit f4cb540

Please sign in to comment.