Skip to content

Instantly share code, notes, and snippets.

@melvincv
melvincv / multi-k8s-install.lib
Created November 3, 2023 04:31
Library for Kubeadm Install
#!/bin/bash
# BASH Library File
# Define Functions
sethostname () {
# Set hostname if it not set
if [ $ISHOSTSET == 'n' ]; then
read -p "Enter the hostname to set: " HOST
sudo hostnamectl set-hostname ${HOST}
sudo sed -i "s/127.0.0.1 localhost/127.0.0.1 localhost ${HOST}/" /etc/hosts
@melvincv
melvincv / k8s-install.sh
Last active November 3, 2023 04:32
kubeadm install script
#!/bin/bash -xe
## Install Kubernetes v1.28 on Ubuntu LTS using kubeadm
## Call Libraries
. ./multi-k8s-install.lib
## Check if not run as root
if [ "$EUID" -eq 0 ]; then
echo Run this script as a regular user.
exit 1
fi
This is from the DevOps Projects course:
https://www.udemy.com/course/devopsprojects/learn/lecture/33799740#notes
stage('Build App Image') {
steps {
script {
dockerImage = docker.build(appRegistry + ":$BUILD_NUMBER", "./Docker-files/app/multistage/")
}
}
}