Skip to content

Commit

Permalink
application resource refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
outductor committed Dec 21, 2023
1 parent e72d304 commit 16cfd04
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 33 deletions.
17 changes: 5 additions & 12 deletions seichi-onp-k8s/cluster-boot-up/scripts/nodes/k8s-node-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,16 @@ EOF
sudo sysctl --system

## Install containerd
apt-get update && apt-get install -y apt-transport-https curl gnupg2
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install -y containerd.io
sudo apt-get update && sudo apt-get install -y containerd apt-transport-https curl gnupg2

# Configure containerd
sudo mkdir -p /etc/containerd
sudo containerd config default | sudo tee /etc/containerd/config.toml > /dev/null
sudo sed -i 's#sandbox_image = "registry.k8s.io/pause:3.6"#sandbox_image = "registry.k8s.io/pause:3.9"#g' /etc/containerd/config.toml
if grep -q "SystemdCgroup = true" "/etc/containerd/config.toml"; then
sudo sed -i 's#sandbox_image = "registry.k8s.io/pause:3.8"#sandbox_image = "registry.k8s.io/pause:3.9"#g' /etc/containerd/config.toml
if grep -q "systemd_cgroup = true" "/etc/containerd/config.toml"; then
echo "Config found, skip rewriting..."
else
sed -i -e "s/SystemdCgroup \= false/SystemdCgroup \= true/g" /etc/containerd/config.toml
sed -i -e "s/systemd_cgroup \= false/systemd_cgroup \= true/g" /etc/containerd/config.toml
fi

sudo systemctl restart containerd
Expand All @@ -117,7 +111,6 @@ sysctl --system
# Install kubeadm
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubeadm=1.28.4-1.1 kubectl=1.28.4-1.1 kubelet=1.28.4-1.1
apt-mark hold kubelet kubectl

Expand Down Expand Up @@ -193,7 +186,7 @@ EOF
echo "net.ipv4.ip_nonlocal_bind = 1" >> /etc/sysctl.conf
sysctl -p

apt-get update && apt-get -y install keepalived
apt-get -y install keepalived

cat > /etc/keepalived/keepalived.conf <<EOF
# Define the script used to check if haproxy is still working
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ spec:
prune: true
selfHeal: true
allowEmpty: true
syncOptions:
- ServerSideApply=true
retry:
limit: -1
backoff:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ spec:
prune: true
selfHeal: true
allowEmpty: true
syncOptions:
- ServerSideApply=true
retry:
limit: -1
backoff:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
prune: true
selfHeal: true
allowEmpty: true
syncOptions:
- ServerSideApply=true
retry:
limit: -1
backoff:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ spec:
enabled: true
additionalLabels:
release: prometheus
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,4 @@ spec:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ spec:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
---
apiVersion: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ spec:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ spec:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ spec:
backoff:
duration: 5s
factor: 2
maxDuration: 2m
maxDuration: 2m
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,3 @@ parameters:
formatOptions: '--nodiscard'
reclaimPolicy: Retain
allowVolumeExpansion: true
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: synology-iscsi-storage-temp
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: csi.san.synology.com
parameters:
dsm: '192.168.16.240'
location: '/volume1'
csi.storage.k8s.io/fstype: 'btrfs'
formatOptions: '--nodiscard'
reclaimPolicy: Delete
allowVolumeExpansion: true
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ spec:
prune: true
selfHeal: true
allowEmpty: true
syncOptions:
- ServerSideApply=true
retry:
limit: -1
backoff:
Expand Down Expand Up @@ -178,6 +180,8 @@ spec:
prune: true
selfHeal: true
allowEmpty: true
syncOptions:
- ServerSideApply=true
retry:
limit: -1
backoff:
Expand Down Expand Up @@ -216,6 +220,8 @@ spec:
prune: true
selfHeal: true
allowEmpty: true
syncOptions:
- ServerSideApply=true
retry:
limit: -1
backoff:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true

0 comments on commit 16cfd04

Please sign in to comment.