Compare commits

..

1 Commits

Author SHA1 Message Date
Craig Sterrett 4556ca4ae9 Added --force flag to swupd repair command
Running setup_system.sh on a system setting the OS version to keep setup_system from upgrading the OS causes an error because a package has been removed. Need to add the --force flag to the
sudo swupd repair -m "${CLR_VER}" --picky command

Closes issue #297
2020-01-09 13:02:22 -08:00
28 changed files with 25 additions and 269 deletions
Vendored
-56
View File
@@ -1,56 +0,0 @@
pipeline {
agent {
label 'clearlinux'
}
options {
timeout(time: 1, unit: "HOURS")
}
triggers {
cron('H */12 * * *')
}
environment {
CLR_K8S_PATH="${env.WORKSPACE}/clr-k8s-examples"
}
stages {
stage('Setup system') {
steps {
dir(path: "$CLR_K8S_PATH") {
sh './setup_system.sh'
}
}
}
stage('Init') {
steps {
dir(path: "$CLR_K8S_PATH") {
sh './create_stack.sh init'
sh 'mkdir -p $HOME/.kube'
sh 'sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config'
sh 'sudo chown $(id -u):$(id -g) $HOME/.kube/config'
sh 'kubectl version'
}
}
}
stage('CNI') {
steps {
dir(path: "$CLR_K8S_PATH") {
sh './create_stack.sh cni'
sh 'kubectl rollout status deployment/coredns -n kube-system --timeout=5m'
sh 'kubectl get pods -n kube-system'
}
}
}
stage('Reset Stack') {
steps {
dir(path: "$CLR_K8S_PATH") {
sh './reset_stack.sh'
}
}
}
}
post {
always {
sh 'uname -a'
sh 'swupd info'
}
}
}
@@ -1,2 +0,0 @@
resources:
- flannel/Documentation/kube-flannel.yml
@@ -1,11 +1,7 @@
resources: resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml - rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml - rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/storageclass.yaml - rook/cluster/examples/kubernetes/ceph/storageclass.yaml
patchesStrategicMerge: patchesStrategicMerge:
- patch_operator.yaml - patch_operator.yaml
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -1,10 +0,0 @@
---
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
storage:
directories:
- path: /var/lib/rook
@@ -1,10 +0,0 @@
resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
patchesStrategicMerge:
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -1,22 +0,0 @@
---
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
mon:
allowMultiplePerNode: true
storage:
directories:
- path: /var/lib/rook
---
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
namespace: rook-ceph
spec:
replicated:
requireSafeReplicaSize: false
size: 1
@@ -1,4 +1,3 @@
---
apiVersion: ceph.rook.io/v1 apiVersion: ceph.rook.io/v1
kind: CephCluster kind: CephCluster
metadata: metadata:
@@ -7,4 +6,4 @@ metadata:
spec: spec:
storage: storage:
directories: directories:
- path: /var/lib/rook - path: /var/lib/rook
@@ -1,10 +0,0 @@
resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
patchesStrategicMerge:
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -1,22 +0,0 @@
---
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
mon:
allowMultiplePerNode: true
storage:
directories:
- path: /var/lib/rook
---
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
namespace: rook-ceph
spec:
replicated:
requireSafeReplicaSize: false
size: 1
@@ -1,4 +1,3 @@
---
apiVersion: ceph.rook.io/v1 apiVersion: ceph.rook.io/v1
kind: CephCluster kind: CephCluster
metadata: metadata:
@@ -7,4 +6,4 @@ metadata:
spec: spec:
storage: storage:
directories: directories:
- path: /var/lib/rook - path: /var/lib/rook
@@ -1,10 +0,0 @@
resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
patchesStrategicMerge:
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -1,22 +0,0 @@
---
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
mon:
allowMultiplePerNode: true
storage:
directories:
- path: /var/lib/rook
---
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
namespace: rook-ceph
spec:
replicated:
requireSafeReplicaSize: false
size: 1
@@ -1,10 +0,0 @@
resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
patchesStrategicMerge:
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -1,10 +0,0 @@
---
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
storage:
directories:
- path: /var/lib/rook
@@ -1,10 +0,0 @@
resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
patchesStrategicMerge:
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -1,22 +0,0 @@
---
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
mon:
allowMultiplePerNode: true
storage:
directories:
- path: /var/lib/rook
---
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
namespace: rook-ceph
spec:
replicated:
requireSafeReplicaSize: false
size: 1
@@ -38,7 +38,7 @@ add_pair_ns() {
ln -sfT $CNI_NETNS /var/run/netns/$CNI_CONTAINERID ln -sfT $CNI_NETNS /var/run/netns/$CNI_CONTAINERID
ip netns exec $CNI_CONTAINERID ip link add $CNI_IFNAME type veth peer name $peer ip netns exec $CNI_CONTAINERID ip link add $CNI_IFNAME type veth peer name $peer
ip netns exec $CNI_CONTAINERID ip link set $CNI_IFNAME addr $mac up alias $vfpci ip netns exec $CNI_CONTAINERID ip link set $CNI_IFNAME addr $mac up
ip netns exec $CNI_CONTAINERID ip link set $peer up ip netns exec $CNI_CONTAINERID ip link set $peer up
ip netns exec $CNI_CONTAINERID ip addr add $ip dev $CNI_IFNAME ip netns exec $CNI_CONTAINERID ip addr add $ip dev $CNI_IFNAME
} }
-15
View File
@@ -162,18 +162,3 @@ Grafana is available at this URL http://localhost:3000 . Default credentials are
## Cleaning up the cluster (Hard reset to a clean state) ## Cleaning up the cluster (Hard reset to a clean state)
Run `reset_stack.sh` on all the nodes Run `reset_stack.sh` on all the nodes
## Additional Components
### Rook
The default Rook configuration provided is intended for testing purposes only
and is not suitable for a production environment. By default Rook is configured
to provide local storage (/var/lib/rook) and will be provisioned differently
depending on whether or not you startup a single node Kubernetes cluster, or
a multiple node Kubernetes cluster.
- When starting up a single node Kubernetes cluster, Rook will be configured
to start up a single replica, and will allow multiple monitors on the same node.
- When multiple Kubernetes worker nodes are detected, Rook will be configured
to startup a replica on each available node and will schedule monitor processes
on separate nodes providing greater reliability.
+6 -8
View File
@@ -18,10 +18,10 @@ HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
# versions # versions
CANAL_VER="${CLRK8S_CANAL_VER:-v3.10}" CANAL_VER="${CLRK8S_CANAL_VER:-v3.10}"
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.6.4}" CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.6.4}"
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-960b3243b9a7faccdfe7b3c09097105e68030ea7}" FLANNEL_VER="${CLRK8S_FLANNEL_VER:-16b0fe66285d1ad1f42b154ab852682f6fafb1a7}"
K8S_VER="${CLRK8S_K8S_VER:-}" K8S_VER="${CLRK8S_K8S_VER:-}"
KATA_VER="${CLRK8S_KATA_VER:-1.9.1-kernel-config}" KATA_VER="${CLRK8S_KATA_VER:-1.9.1-kernel-config}"
ROOK_VER="${CLRK8S_ROOK_VER:-v1.2.6}" ROOK_VER="${CLRK8S_ROOK_VER:-v1.1.7}"
METRICS_VER="${CLRK8S_METRICS_VER:-v0.3.6}" METRICS_VER="${CLRK8S_METRICS_VER:-v0.3.6}"
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}" DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}"
INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.26.1}" INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.26.1}"
@@ -33,7 +33,6 @@ CNI=${CLRK8S_CNI:-"canal"}
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-"crio"}"; fi if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-"crio"}"; fi
NFD_VER="${CLRK8S_NFD_VER:-v0.4.0}" NFD_VER="${CLRK8S_NFD_VER:-v0.4.0}"
mode="multinode"
function print_usage_exit() { function print_usage_exit() {
exit_code=${1:-0} exit_code=${1:-0}
@@ -109,7 +108,6 @@ function cluster_init() {
#Ensure single node k8s works #Ensure single node k8s works
if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then
kubectl taint nodes --all node-role.kubernetes.io/master- kubectl taint nodes --all node-role.kubernetes.io/master-
mode="standalone"
fi fi
} }
@@ -170,7 +168,7 @@ function cni() {
function metrics() { function metrics() {
METRICS_VER="${1:-$METRICS_VER}" METRICS_VER="${1:-$METRICS_VER}"
METRICS_URL="https://github.com/kubernetes-sigs/metrics-server.git" METRICS_URL="https://github.com/kubernetes-incubator/metrics-server.git"
METRICS_DIR="1-core-metrics" METRICS_DIR="1-core-metrics"
get_repo "${METRICS_URL}" "${METRICS_DIR}/overlays/${METRICS_VER}" get_repo "${METRICS_URL}" "${METRICS_DIR}/overlays/${METRICS_VER}"
set_repo_version "${METRICS_VER}" "${METRICS_DIR}/overlays/${METRICS_VER}/metrics-server" set_repo_version "${METRICS_VER}" "${METRICS_DIR}/overlays/${METRICS_VER}/metrics-server"
@@ -210,9 +208,9 @@ function storage() {
ROOK_DIR=7-rook ROOK_DIR=7-rook
# get and apply rook # get and apply rook
get_repo "${ROOK_URL}" "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}" get_repo "${ROOK_URL}" "${ROOK_DIR}/overlays/${ROOK_VER}"
set_repo_version "${ROOK_VER}" "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}/rook" set_repo_version "${ROOK_VER}" "${ROOK_DIR}/overlays/${ROOK_VER}/rook"
kubectl apply -k "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}" kubectl apply -k "${ROOK_DIR}/overlays/${ROOK_VER}"
# wait for the rook OSDs to run which means rooks should be ready # wait for the rook OSDs to run which means rooks should be ready
while [[ $(kubectl get po --all-namespaces | grep -e 'osd.*Running.*' -c) -lt 1 ]]; do while [[ $(kubectl get po --all-namespaces | grep -e 'osd.*Running.*' -c) -lt 1 ]]; do
echo "Waiting for Rook OSD" echo "Waiting for Rook OSD"
+15 -20
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o errexit set -o errexit
set -o nounset set -o nounset
@@ -8,9 +9,8 @@ CLR_VER=${CLRK8S_CLR_VER:-""}
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""} HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
# set no proxy # set no proxy
NO_PROXY_ARRAY=(.svc 10.0.0.0/8 ) ADD_NO_PROXY=".svc,10.0.0.0/8,192.168.0.0/16"
NO_PROXY_ARRAY+=( $(hostname -I | awk -F. '{print $1"."$2"."$3".0/24"}')) ADD_NO_PROXY+=",$(hostname -I | sed 's/[[:space:]]/,/g')"
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-crio}"; fi if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-crio}"; fi
# update os version # update os version
@@ -144,15 +144,9 @@ function ensure_system_ready() {
# add proxy if found # add proxy if found
function setup_proxy() { function setup_proxy() {
set +o nounset set +o nounset
set +o errexit
if [[ ${http_proxy} ]] || [[ ${HTTP_PROXY} ]]; then if [[ ${http_proxy} ]] || [[ ${HTTP_PROXY} ]]; then
echo "Setting up proxy stuff...." echo "Setting up proxy stuff...."
# Setup IP for users too # Setup IP for users too
for ip in "${NO_PROXY_ARRAY[@]}"
do
result=`grep no_proxy /etc/profile.d/proxy.sh | grep $ip`
[ -z "$result" ] && ADD_NO_PROXY+="$ip,"
done
sed_val=${ADD_NO_PROXY//\//\\/} sed_val=${ADD_NO_PROXY//\//\\/}
[ -f /etc/environment ] && sudo sed -i "/no_proxy/I s/$/,${sed_val}/g" /etc/environment [ -f /etc/environment ] && sudo sed -i "/no_proxy/I s/$/,${sed_val}/g" /etc/environment
if [ -f /etc/profile.d/proxy.sh ]; then if [ -f /etc/profile.d/proxy.sh ]; then
@@ -161,18 +155,19 @@ function setup_proxy() {
echo "Warning, failed to find /etc/profile.d/proxy.sh to edit no_proxy line" echo "Warning, failed to find /etc/profile.d/proxy.sh to edit no_proxy line"
fi fi
cat <<EOF | sudo bash -c "cat > /usr/lib/systemd/system.conf.d/proxy.conf" services=("${RUNNER}" 'kubelet')
[Manager] for s in "${services[@]}"; do
DefaultEnvironment="HTTP_PROXY=${http_proxy}" sudo mkdir -p "/etc/systemd/system/${s}.service.d/"
DefaultEnvironment="HTTPS_PROXY=${https_proxy}" cat <<EOF | sudo bash -c "cat > /etc/systemd/system/${s}.service.d/proxy.conf"
DefaultEnvironment="SOCKS_PROXY=${socks_proxy}" [Service]
DefaultEnvironment="NO_PROXY=${no_proxy},${ADD_NO_PROXY}" Environment="HTTP_PROXY=${http_proxy}"
Environment="HTTPS_PROXY=${https_proxy}"
Environment="SOCKS_PROXY=${socks_proxy}"
Environment="NO_PROXY=${no_proxy},${ADD_NO_PROXY}"
EOF EOF
done
sudo systemctl daemon-reexec fi
fi set -o nounset
set -o nounset
set -o errexit
} }
# init for performing any pre tasks # init for performing any pre tasks