Skip to content

networkop/init-wait questions #13

@qlyoung

Description

@qlyoung
  1. networkop/init-wait is only available for amd64 so I built it myself:
    Dockerfile:
FROM alpine
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh (copied from your amd64 image):

#!/bin/sh

INTFS=${1:-1}
SLEEP=${2:-0}

int_calc () 
{
    index=0
    for i in $(ls -1v /sys/class/net/ | grep 'eth\|ens\|eno'); do
      let index=index+1
    done
    MYINT=$index
}

int_calc

echo "Waiting for all $INTFS interfaces to be connected"
while [ "$MYINT" -lt "$INTFS" ]; do
  echo "Connected $MYINT interfaces out of $INTFS"
  sleep 1
  int_calc
done

echo "Sleeping $SLEEP seconds before boot"
sleep $SLEEP

Have I got this close enough? Or is there source for it somewhere that I missed?

It seems to be working sometimes, but not others:

root@clusterpi-69 ~# kubectl get pod
NAME                        READY   STATUS     RESTARTS   AGE
k8s-topo-86cbbdbddb-5ks5m   1/1     Running    0          164m
frr-192-0-2-1               0/1     Init:0/1   0          2m26s
frr-192-0-2-7               0/1     Init:0/1   0          2m27s
frr-192-0-2-3               0/1     Init:0/1   0          2m27s
frr-192-0-2-9               0/1     Init:0/1   0          2m27s
frr-192-0-2-4               0/1     Init:0/1   0          2m27s
frr-192-0-2-5               0/1     Init:0/1   0          2m26s
frr-192-0-2-8               1/1     Running    0          2m26s
frr-192-0-2-0               1/1     Running    0          2m27s
frr-192-0-2-6               1/1     Running    0          2m28s
frr-192-0-2-2               1/1     Running    0          2m26s

E.g., frr-192-0-2-1:

root@clusterpi-69 /v/l/r/k/a/e/c/net.d# kubectl exec -it frr-192-0-2-1 --container init-frr-192-0-2-1 -- ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: eth0@if65: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue state UP 
    link/ether ea:5b:bf:92:f6:9c brd ff:ff:ff:ff:ff:ff
68: eth1@if67: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP 
    link/ether c6:0e:85:41:be:4d brd ff:ff:ff:ff:ff:ff

Per the topology, this should have eth1 and eth2, but only one has been created. I guess this is a meshnet-cni bug or a misconfig, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions