Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
##Fixes
* fix vSphere issue when one or more nodes is slow to provision
* provision worker nodes by default rather than just k8s

##Improvements
* removed stop_after parameter
* simplified aws-load-balancer-controller installation
* remove stop_after parameter
* simplify aws-load-balancer-controller installation
* simplify and speed up provisioning

# 6.6
##Important
Expand Down
2 changes: 1 addition & 1 deletion aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func aws_create_variables(config *Config) []string {
{
tf_variables_eks = append(tf_variables_eks, " \""+masternum+"\" = \""+tf_cluster_instance_type+"\",")
}
case "k8s":
default:
{
tf_variables = append(tf_variables, " {")
tf_variables = append(tf_variables, " role = \"node\"")
Expand Down
1 change: 1 addition & 0 deletions infra/all-common
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sysctl -w net.ipv4.ip_forward=1 >>/etc/sysctl.conf

sed -i '/^127.0.0.1.*\(master\|node\)/d' /etc/hosts
while ! yum install -y dnf; do sleep 1; done
echo "max_parallel_downloads=10" >>/etc/dnf/dnf.conf
while ! dnf install -y epel-release; do sleep 1; done
while ! dnf install -y jq; do sleep 1; done
if [ -f /etc/selinux/config ]; then
Expand Down
18 changes: 13 additions & 5 deletions infra/k8s-common
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Add Kubernetes repo
repo=$(echo $k8s_version | cut -f 1,2 -d .)
cat <<EOF >/etc/yum.repos.d/kubernetes.repo
[kubernetes]
Expand All @@ -7,17 +8,24 @@ enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v$repo/rpm/repodata/repomd.xml.key
EOF
while ! dnf install -y selinux-policy policycoreutils-python-utils selinux-policy-targeted container-selinux --setopt=tsflags=noscripts; do sleep 1; done

# Install prerequisites
while ! dnf install -y passt-selinux selinux-policy policycoreutils-python-utils selinux-policy-targeted container-selinux --setopt=tsflags=noscripts; do sleep 1; done
while ! dnf install -y kubelet-$k8s_version docker kubeadm-$k8s_version kubectl-$k8s_version; do sleep 1; done

# Install containerd
curl -L https://github.com/containerd/containerd/releases/download/v1.6.15/containerd-1.6.15-linux-amd64.tar.gz | tar Cxzvf /usr/local -
curl -o /etc/systemd/system/containerd.service https://raw.githubusercontent.com/containerd/containerd/main/containerd.service
mkdir /etc/containerd
containerd config default | sed 's/SystemdCgroup = false/SystemdCgroup = true/' | sed 's/device_ownership_from_security_context = false/device_ownership_from_security_context = true/' >/etc/containerd/config.toml
curl -Lo /usr/sbin/runc https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64
chmod 755 /usr/sbin/runc
systemctl daemon-reload
systemctl enable --now containerd
systemctl enable --now podman
systemctl enable --now kubelet
touch /etc/containers/nodocker
sed -i 's/^unqualified-search-registries.*$/unqualified-search-registries = ["docker.io"]/' /etc/containers/registries.conf

# Enable everything
systemctl daemon-reload
systemctl enable --now containerd podman kubelet

# Prepull Kubernetes images
kubeadm config images list --kubernetes-version $k8s_version | xargs -n1 -P0 ctr -n k8s.io images pull
5 changes: 2 additions & 3 deletions infra/k8s-master
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
kubeadm config images list --kubernetes-version $k8s_version | xargs -n1 -P0 ctr -n k8s.io images pull
kubeadm init --apiserver-advertise-address=$(hostname -i) --pod-network-cidr=10.244.0.0/16 --kubernetes-version $k8s_version
mkdir /root/.kube
cp /etc/kubernetes/admin.conf /root/.kube/config
Expand All @@ -15,8 +14,8 @@ while true; do
echo "kube api is ready!"
break
fi
echo "kube api not ready. Waiting 5 seconds..."
sleep 5
echo "kube api not ready. Waiting 2 seconds..."
sleep 2
done
# label node
kubectl label node $(hostname) node-role.kubernetes.io/master=master
Expand Down
4 changes: 3 additions & 1 deletion infra/k8s-node
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
dnf install -y kernel-devel sg3_utils device-mapper-multipath iscsi-initiator-utils &
(echo docker.io/portworx/{px-enterprise,oci-monitor}:$px_version ; echo docker.io/$(curl -sk "https://install.portworx.com/$px_version?kb_ver=$k8s_version&comp=stork" | awk '/image:/{print$2}') ; kubeadm config images list --kubernetes-version $k8s_version 2>/dev/null) | xargs -n1 -P0 ctr -n k8s.io images pull
ctr -n k8s.io images pull docker.io/$(curl -sk "https://install.portworx.com/$px_version?comp=pxoperator&kbver=$k8s_version" | awk '/image:/{print$2}') &
ctr -n k8s.io images pull docker.io/portworx/px-enterprise:$px_version &
ctr -n k8s.io images pull docker.io/portworx/oci-monitor:$px_version &
while : ; do
command=$(ssh -oConnectTimeout=1 -oStrictHostKeyChecking=no master-$cluster kubeadm token create --print-join-command)
echo $command | grep -qE '[0-9a-f]{64}'
Expand Down
10 changes: 4 additions & 6 deletions scripts/install-px
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Default secrets store is k8s; can also set environment variable secrets=vault

# You can also set csi=true and security=true
# You can also set security=true

# If you select cloud=vsphere, clouddrives will be provisioned from vsphere_disks

Expand Down Expand Up @@ -41,7 +41,6 @@ if [ "$cloud_drive" ]; then
url="$url&e=AZURE_CLIENT_ID%3D$azure_client_id%2CAZURE_CLIENT_SECRET%3D$azure_client_secret%2CAZURE_TENANT_ID%3D$azure_tenant_id"
fi
url="$url&s=%22$cloud_drive%2Ctags%3Dpxd_uuid_cd%3A$pxd_uuid%22&mz=0&kd=$cloud_drive%2Ctags%3Dpxd_uuid_cd%3A$pxd_uuid"
#url="$url&s=%22$cloud_drive%2Ctags%3Dpxd_uuid%3A$pxd_uuid%22&mz=0"

[ "$cloud" = aws ] && url="$url&ce=aws"
[ "$cloud" = gcp ] && url="$url&ce=gce"
Expand All @@ -63,8 +62,6 @@ fi
[ "$platform" = eks ] && url="$url&eks=true"
[ "$platform" = ocp4 ] && url="$url&r=17001"
[ "$security" = true ] && url="$url&security=true"
[ -n "$csi" ] && url="$url&csi=$csi"
#[ "$etcd" = EXTERNAL ] && url="$url&k=etcd:http://$(ssh master-1 curl https://ipinfo.io/ip):2382"
[ "$etcd" = EXTERNAL ] && url="$url&k=etcd:http://$(grep master-1 /etc/hosts | cut -d\ -f1):2382"

if [ "$platform" = ocp4 ]; then
Expand Down Expand Up @@ -108,8 +105,8 @@ EOF
fi

if [ "$platform" != ocp4 ]; then
kubectl apply -f "https://install.portworx.com/$px_version?comp=pxoperator&kbver=$k8s_version"
while ! kubectl wait --for=condition=ready pod -lname=portworx-operator -n kube-system; do
curl -sk "https://install.portworx.com/$px_version?comp=pxoperator&kbver=$k8s_version" | sed 's/kube-system/portworx/g' | sed 's/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g' | kubectl apply -f -
while ! kubectl wait --for=condition=ready pod -lname=portworx-operator -n portworx; do
sleep 2
done
fi
Expand All @@ -131,6 +128,7 @@ fi
curl -sko /tmp/px.yml $url
sed -i 's/namespace: kube-system/namespace: portworx/' /tmp/px.yml
sed -i 's/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/' /tmp/px.yml
sed -i '/annotations:/a\ portworx.io/health-check: "skip"' /tmp/px.yml
[ -f "/tmp/metro" ] && clusterdomain=$(cat /tmp/metro) && sed -i '/ annotations:/a\ \ \ \ '"$clusterdomain"'' /tmp/px.yml

# check if CRDs are created
Expand Down