Yuvipanda has submitted this change and it was merged.
Change subject: k8s: Simple script to deploy worker & proxy
......................................................................
k8s: Simple script to deploy worker & proxy
Bug: T130972
Change-Id: Ibc6504ada4115146eaab377e9030f2dca755b42f
---
A modules/role/files/toollabs/deploy-proxy.bash
A modules/role/files/toollabs/deploy-worker.bash
M modules/role/manifests/toollabs/k8s/webproxy.pp
M modules/role/manifests/toollabs/k8s/worker.pp
4 files changed, 59 insertions(+), 0 deletions(-)
Approvals:
Yuvipanda: Verified; Looks good to me, approved
diff --git a/modules/role/files/toollabs/deploy-proxy.bash
b/modules/role/files/toollabs/deploy-proxy.bash
new file mode 100644
index 0000000..324f441
--- /dev/null
+++ b/modules/role/files/toollabs/deploy-proxy.bash
@@ -0,0 +1,21 @@
+#!/bin/bash
+# This script does the following:
+#
+# 1. Stop the K8S Proxy
+# 2. Download new versions of Proxy from a central location
+# 3. Start the K8S Proxy
+
+set -e
+
+# TODO: Add error checking (baaaaassshhhhh)
+URL_PREFIX="$1"
+VERSION="$2"
+
+# Stop all the running services!
+service kubeproxy stop
+
+# Download the new things!
+wget -O /usr/local/bin/kube-proxy $URL_PREFIX/$VERSION/kube-proxy
+
+# Start services again, and hope!
+service kube-proxy start
diff --git a/modules/role/files/toollabs/deploy-worker.bash
b/modules/role/files/toollabs/deploy-worker.bash
new file mode 100644
index 0000000..ebf7a59
--- /dev/null
+++ b/modules/role/files/toollabs/deploy-worker.bash
@@ -0,0 +1,24 @@
+#!/bin/bash
+# This script does the following:
+#
+# 1. Stop the K8S master components (API Server, Controller Manager &
Scheduler)
+# 2. Download new versions of these components from a central location
+# 3. Start the K8S master components
+
+set -e
+
+# TODO: Add error checking (baaaaassshhhhh)
+URL_PREFIX="$1"
+VERSION="$2"
+
+# Stop all the running services!
+service kubelet stop
+service kubeproxy stop
+
+# Download the new things!
+wget -O /usr/local/bin/kubelet $URL_PREFIX/$VERSION/kubelet
+wget -O /usr/local/bin/kube-proxy $URL_PREFIX/$VERSION/kube-proxy
+
+# Start services again, and hope!
+service kubelet start
+service kube-proxy start
diff --git a/modules/role/manifests/toollabs/k8s/webproxy.pp
b/modules/role/manifests/toollabs/k8s/webproxy.pp
index a75289e..de6e77d 100644
--- a/modules/role/manifests/toollabs/k8s/webproxy.pp
+++ b/modules/role/manifests/toollabs/k8s/webproxy.pp
@@ -20,4 +20,11 @@
master_host => $master_host,
}
+ # Deployment script (for now!)
+ file { '/usr/local/bin/deploy-proxy':
+ source => 'file:///modules/role/toollabs/deploy-proxy.bash',
+ mode => '0555',
+ owner => 'root',
+ group => 'root',
+ }
}
diff --git a/modules/role/manifests/toollabs/k8s/worker.pp
b/modules/role/manifests/toollabs/k8s/worker.pp
index 53564ff..dc40216 100644
--- a/modules/role/manifests/toollabs/k8s/worker.pp
+++ b/modules/role/manifests/toollabs/k8s/worker.pp
@@ -35,4 +35,11 @@
require => Class['::k8s::kubelet']
}
+ # Deployment script (for now!)
+ file { '/usr/local/bin/deploy-worker':
+ source => 'file:///modules/role/toollabs/deploy-worker.bash',
+ mode => '0555',
+ owner => 'root',
+ group => 'root',
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/281590
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc6504ada4115146eaab377e9030f2dca755b42f
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits