Skip to content

Commit

Permalink
Fix calico install on first start
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Boudvillain <pierre.boudvil1@gmail.com>
  • Loading branch information
21repierre committed Jul 18, 2023
1 parent fddc361 commit d0a7733
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions boot/rootlesskit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rk_state_dir=$XDG_RUNTIME_DIR/usernetes/rootlesskit
: ${U7S_ROOTLESSKIT_FLAGS=}
: ${U7S_ROOTLESSKIT_PORTS=}
: ${U7S_FLANNEL=}
: ${U7S_CALICO=}
: ${U7S_CALICO=0}

: ${_U7S_CHILD=0}
if [[ $_U7S_CHILD == 0 ]]; then
Expand Down Expand Up @@ -66,8 +66,9 @@ else

# Copy CNI config to /etc/cni/net.d (Likely to be hardcoded in CNI installers)
mkdir -p /etc/cni/net.d
# Disabled default cni because we are using calico
if [[ $U7S_CALICO != 1 ]]; then

# Disable bridge cni when using calico
if [[ $U7S_CALICO == 0 ]]; then
cp -f $U7S_BASE_DIR/config/cni_net.d/* /etc/cni/net.d
fi
if [[ $U7S_FLANNEL == 1 ]]; then
Expand Down
10 changes: 7 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ EOF
fi
fi

# Need to enable calico before starting rootlesskit
if [ "$cni" = "calico" ]; then
cat <<EOF >>${config_dir}/usernetes/env
U7S_CALICO=1
EOF
fi

### Secret encryption
if [ ! -f ${config_dir}/usernetes/master/secrets-encryption.yml ]; then
INFO "Enabling secrets encryption"
Expand Down Expand Up @@ -492,9 +499,6 @@ subjects:
name: kubernetes
EOF
if [ "$cni" = "calico" ]; then
cat <<EOF >>${config_dir}/usernetes/env
U7S_CALICO=1
EOF
INFO "Installing calico"
set -x
kubectl create -f ${base}/manifests/calico/tigera-operator.yml
Expand Down

0 comments on commit d0a7733

Please sign in to comment.