Skip to content

Commit

Permalink
Semantic fix
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Glazychev <[email protected]>
  • Loading branch information
glazychev-art committed Mar 24, 2022
1 parent 2da7f8c commit 38199a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ jobs:
git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false )
packet:
name: packet (Calico ${{ matrix.calico }})
name: packet (CNI ${{ matrix.CNI }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
calico: ["off", "on"]
CNI: ["default", "calico"]
steps:
- name: Set up /bin permissions # 1. Set up /bin permissions
run: |
Expand All @@ -94,11 +94,11 @@ jobs:
- name: Compute suffix # 5. Compute suffix for cloudtest input and output paths
id: suffix
run: |
if [[ "${CALICO}" == "on" ]]; then
if [[ "${CNI}" == "calico" ]]; then
echo ::set-output name=val::_calico
fi
env:
CALICO: ${{ matrix.calico }}
CNI: ${{ matrix.CNI }}
- name: Checkout files # 6. Checkout files
uses: actions/checkout@v2
with:
Expand All @@ -111,7 +111,7 @@ jobs:
PACKET_AUTH_TOKEN: ${{ secrets.PACKET_AUTH_TOKEN }}
PACKET_PROJECT_ID: 383890d0-f5d1-4de1-881a-4d1ede549d18
KUBERNETES_VERSION: ${{ secrets.NSM_KUBERNETES_VERSION }}
CALICO: ${{ matrix.calico }}
CNI: ${{ matrix.CNI }}
suffix: ${{ steps.suffix.outputs.val }}
- name: Publish test report # 8. Publish test report
uses: mikepenz/[email protected]
Expand All @@ -120,7 +120,7 @@ jobs:
report_paths: "**/cloud_test${{ steps.suffix.outputs.val }}/results/junit.xml"
suite_regex: "Test*"
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: "JUnit Test Report (Calico ${{ matrix.calico }})"
check_name: "JUnit Test Report (CNI ${{ matrix.CNI }})"
- name: Upload logs # 9. Upload logs
uses: actions/upload-artifact@v2
if: ${{ always() }}
Expand Down
8 changes: 4 additions & 4 deletions scripts/create-kubernetes-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sshkey=$3
SSH_CONFIG="ssh_config"
SSH_OPTS="-F ${SSH_CONFIG} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i ${sshkey}"

if [[ "$CALICO" == "on" ]]; then # calico
if [[ "$CNI" == "calico" ]]; then # calico
# Use a new 10.0.0.${base_ip}/30 subnet to prevent IP addresses collisions
# ${base_ip} should be <= 248, because 10.0.0.252/30 subnet is reserved for manual testing
base_ip=$(( GITHUB_RUN_NUMBER % 63 * 4 ))
Expand All @@ -19,7 +19,7 @@ if [[ "$CALICO" == "on" ]]; then # calico
CALICO_INTERFACE="eno2"
fi

ENVS="KUBERNETES_VERSION CALICO"
ENVS="KUBERNETES_VERSION CNI"

# wait_pids pid_1 ... pid_n
source scripts/include/wait-pids.sh
Expand Down Expand Up @@ -52,7 +52,7 @@ pids=""
pids+=" $!"
wait_pids "${pids}" "SR-IOV config failed" || exit 21

if [[ "$CALICO" == "on" ]]; then # calico
if [[ "$CNI" == "calico" ]]; then # calico
# 3. Create Calico scripts directory on nodes.
ssh ${SSH_OPTS} root@${master_ip} mkdir -p calico || exit 31
ssh ${SSH_OPTS} root@${worker_ip} mkdir -p calico || exit 32
Expand Down Expand Up @@ -123,7 +123,7 @@ wait_pids "${pids}" "worker join failed" || exit 94
# 10. Save KUBECONFIG to file.
scp ${SSH_OPTS} root@${master_ip}:.kube/config ${KUBECONFIG} || exit 101

if [[ "$CALICO" == "on" ]]; then # calico
if [[ "$CNI" == "calico" ]]; then # calico
# 11. Setup cluster nodes IPs.
scp ${SSH_OPTS} scripts/calico/setup-node-ip.sh root@${master_ip}:calico/setup-node-ip.sh || exit 111
scp ${SSH_OPTS} scripts/calico/setup-node-ip.sh root@${worker_ip}:calico/setup-node-ip.sh || exit 112
Expand Down
10 changes: 5 additions & 5 deletions scripts/k8s/start-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ calico_ip="$2"

K8S_DIR=$(dirname "$0")

if [[ "$CALICO" != "on" ]]; then # not calico
ip="${public_ip}"
else
if [[ "$CNI" == "calico" ]]; then # calico
ip="${calico_ip}"
else
ip="${public_ip}"
fi

kubeadm init \
Expand All @@ -24,13 +24,13 @@ mkdir -p ~/.kube
cp -f /etc/kubernetes/admin.conf ~/.kube/config
chown "$(id -u):$(id -g)" ~/.kube/config

if [[ "$CALICO" != "on" ]]; then # not calico
if [[ "$CNI" == "default" ]]; then
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')&env.IPALLOC_RANGE=192.168.0.0/16"
fi

kubectl taint nodes --all node-role.kubernetes.io/master-

if [[ "$CALICO" == "on" ]]; then # calico
if [[ "$CNI" == "calico" ]]; then # calico
kubectl -n kube-system get configmap kubeadm-config -o jsonpath='{.data.ClusterConfiguration}' > kubeadm.yaml
sed -i "/^apiServer:$/a \ \ certSANs:\n - \"${public_ip}\"\n - \"${calico_ip}\"" kubeadm.yaml

Expand Down

0 comments on commit 38199a4

Please sign in to comment.