Skip to content

Commit

Permalink
chore: enable ssl to default ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 27, 2020
1 parent 3f50928 commit 6635f93
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARCH=amd64
# RPM_ARCH could be x86_64,aarch64
RPM_ARCH=x86_64

.PHONY: build-dev-images build-dpdk build-go build-bin lint kind-init kind-init-ha kind-install kind-reload push-dev push-release e2e ut
.PHONY: build-dev-images build-dpdk build-go build-bin lint kind-init kind-init-ha kind-install kind-install-ipv6 kind-reload push-dev push-release e2e ut

build-dev-images: build-bin
docker build -t ${REGISTRY}/kube-ovn:${DEV_TAG} -f dist/images/Dockerfile dist/images/
Expand Down Expand Up @@ -75,7 +75,7 @@ kind-init:
kind-install:
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule-
dist/images/install.sh
ENABLE_SSL=true dist/images/install.sh
kubectl get no -o wide

kind-init-ha:
Expand All @@ -93,7 +93,7 @@ kind-init-ipv6:
kind-install-ipv6:
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule-
IPv6=true dist/images/install.sh
ENABLE_SSL=true IPv6=true dist/images/install.sh

kind-reload:
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
Expand All @@ -116,4 +116,4 @@ ut:
ginkgo -p --slowSpecThreshold=60 test/unittest

scan:
trivy image --exit-code=1 --severity=HIGH --ignore-unfixed kubeovn/kube-ovn:${RELEASE_TAG}
trivy image --light --exit-code=1 --severity=HIGH --ignore-unfixed kubeovn/kube-ovn:${RELEASE_TAG}
3 changes: 2 additions & 1 deletion dist/images/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ for subnet in $(kubectl get subnet -o name); do
done

# Delete Kube-OVN components
kubectl delete cm ovn-config -n kube-system --ignore-not-found=true
kubectl delete cm ovn-config ovn-ic-config ovn-external-gw-config -n kube-system --ignore-not-found=true
kubectl delete secret kube-ovn-tls -n kube-system --ignore-not-found=ture
kubectl delete sa ovn -n kube-system --ignore-not-found=true
kubectl delete clusterrole system:ovn --ignore-not-found=true
kubectl delete clusterrolebinding ovn --ignore-not-found=true
Expand Down
10 changes: 6 additions & 4 deletions dist/images/generate-ssl-docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

docker run --rm -v $PWD:/etc/ovn kubeovn/kube-ovn:v1.5.0 bash generate-ssl.sh
kubectl create secret generic -n kube-system kube-ovn-tls --from-file=cacert=cacert.pem --from-file=cert=ovn-cert.pem --from-file=key=ovn-privkey.pem
rm -rf cacert.pem ovn-cert.pem ovn-privkey.pem ovn-req.pem
exist=$(kubectl get secret -n kube-system kube-ovn-tls --ignore-not-found)
if [[ $exist == "" ]];then
docker run --rm -v $PWD:/etc/ovn kubeovn/kube-ovn:v1.5.0 bash generate-ssl.sh
kubectl create secret generic -n kube-system kube-ovn-tls --from-file=cacert=cacert.pem --from-file=cert=ovn-cert.pem --from-file=key=ovn-privkey.pem
rm -rf cacert.pem ovn-cert.pem ovn-privkey.pem ovn-req.pem
fi
11 changes: 8 additions & 3 deletions dist/images/install-pre-1.16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ HW_OFFLOAD=${HW_OFFLOAD:-false}
IFACE="" # The nic to support container network, if empty will use the nic that the default route use

REGISTRY="kubeovn"
VERSION="v1.5.0"
IMAGE_PULL_POLICY="IfNotPresent"
NAMESPACE="kube-system" # The ns to deploy kube-ovn
POD_CIDR="10.16.0.0/16" # Do NOT overlap with NODE/SVC/JOIN CIDR
SVC_CIDR="10.96.0.0/12" # Do NOT overlap with NODE/POD/JOIN CIDR
Expand All @@ -25,8 +27,6 @@ fi
EXCLUDE_IPS="" # EXCLUDE_IPS for default subnet
LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB
NETWORK_TYPE="geneve" # geneve or vlan
VERSION="v1.5.0"
IMAGE_PULL_POLICY="IfNotPresent"

# VLAN Config only take effect when NETWORK_TYPE is vlan
PROVIDER_NAME="provider"
Expand Down Expand Up @@ -79,7 +79,12 @@ fi

if [[ $ENABLE_SSL = "true" ]];then
echo "[Step 0] Generate SSL key and cert"
bash dist/images/generate-ssl-docker.sh
exist=$(kubectl get secret -n kube-system kube-ovn-tls --ignore-not-found)
if [[ $exist == "" ]];then
docker run --rm -v $PWD:/etc/ovn $REGISTRY/kube-ovn:$VERSION bash generate-ssl.sh
kubectl create secret generic -n kube-system kube-ovn-tls --from-file=cacert=cacert.pem --from-file=cert=ovn-cert.pem --from-file=key=ovn-privkey.pem
rm -rf cacert.pem ovn-cert.pem ovn-privkey.pem ovn-req.pem
fi
echo "-------------------------------"
echo ""
fi
Expand Down
11 changes: 8 additions & 3 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ HW_OFFLOAD=${HW_OFFLOAD:-false}
IFACE="" # The nic to support container network, if empty will use the nic that the default route use

REGISTRY="kubeovn"
VERSION="v1.5.0"
IMAGE_PULL_POLICY="IfNotPresent"
NAMESPACE="kube-system" # The ns to deploy kube-ovn
POD_CIDR="10.16.0.0/16" # Do NOT overlap with NODE/SVC/JOIN CIDR
SVC_CIDR="10.96.0.0/12" # Do NOT overlap with NODE/POD/JOIN CIDR
Expand All @@ -25,8 +27,6 @@ fi
EXCLUDE_IPS="" # EXCLUDE_IPS for default subnet
LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB
NETWORK_TYPE="geneve" # geneve or vlan
VERSION="v1.5.0"
IMAGE_PULL_POLICY="IfNotPresent"

# VLAN Config only take effect when NETWORK_TYPE is vlan
PROVIDER_NAME="provider"
Expand Down Expand Up @@ -79,7 +79,12 @@ fi

if [[ $ENABLE_SSL = "true" ]];then
echo "[Step 0] Generate SSL key and cert"
bash dist/images/generate-ssl-docker.sh
exist=$(kubectl get secret -n kube-system kube-ovn-tls --ignore-not-found)
if [[ $exist == "" ]];then
docker run --rm -v $PWD:/etc/ovn $REGISTRY/kube-ovn:$VERSION bash generate-ssl.sh
kubectl create secret generic -n kube-system kube-ovn-tls --from-file=cacert=cacert.pem --from-file=cert=ovn-cert.pem --from-file=key=ovn-privkey.pem
rm -rf cacert.pem ovn-cert.pem ovn-privkey.pem ovn-req.pem
fi
echo "-------------------------------"
echo ""
fi
Expand Down
2 changes: 2 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ If you want to know the detail steps to install Kube-OVN, please follow the step

For Kubernetes version before 1.17 please use the following command to add the node label

`kubectl label no -lbeta.kubernetes.io/os=linux kubernetes.io/os=linux --overwrite`

1. Add the following label to the Node which will host the OVN DB and the OVN Control Plane:

`kubectl label node <Node on which to deploy OVN DB> kube-ovn/role=master`
Expand Down

0 comments on commit 6635f93

Please sign in to comment.