-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEnvsettings.k8s
39 lines (31 loc) · 1.07 KB
/
Envsettings.k8s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh
test -n "$XCLUSTER" || . ./Envsettings
test -n "$XCLUSTER" || return 0
# Kubernetes settings;
# Make sure the guest /dev/random is connected to the host /dev/urandom
__kvm_opt='-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,max-bytes=1024,period=80000 -cpu qemu64,+sse4.2,+sse4.1,+ssse3'
export __kvm_opt
if test -z "$__mem"; then
export __mem=768
export __mem1=1024
export __mem201=384
export __mem202=384
fi
test -n "$__image" || export __image=$XCLUSTER_WORKSPACE/xcluster/hd-k8s.img
test -r "$__image" || cat <<EOF
The image is not readable [$__image]
Please follow the instructions at;
https://github.com/Nordix/xcluster#xcluster-with-kubernetes
Example;
armurl=http://artifactory.nordix.org/artifactory/cloud-native
curl -L \$armurl/xcluster/images/hd-k8s.img.xz | xz -d > \$__image
EOF
mynetns=$(ip netns id)
if test -z "$KUBECONFIG"; then
if test -n "$mynetns"; then
export KUBECONFIG=$(readlink -f .)/config/kubeconfig.netns.token
else
export KUBECONFIG=$(readlink -f .)/config/kubeconfig.user-space.token
fi
fi
unset mynetns