acoustic-processor-40872
08/03/2022, 10:45 PM#!/bin/bash
# Enable ssh password authentication
echo "Enable SSH password authentication:"
sed -i 's/^PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
systemctl reload sshd
# Set Root password
echo "Set root password:"
echo -e "iamadmin\niamadmin" | passwd root >/dev/null 2>&1
# Start and enable Services
#sudo systemctl daemon-reload
#sudo systemctl enable docker
#sudo systemctl start docker
#Confirm that docker group has been created on system
sudo groupadd docker
# Add your current system user to the Docker group
sudo gpasswd -a $USER docker
docker --version
# Turn off swap
# The Kubernetes scheduler determines the best available node on
# which to deploy newly created pods. If memory swapping is allowed
# to occur on a host system, this can lead to performance and stability
# issues within Kubernetes.
# For this reason, Kubernetes requires that you disable swap in the host system.
# If swap is not disabled, kubelet service will not start on the masters and nodes
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a
# Turn off firewall
ufw disable
# Modify bridge adapter setting
# Configure sysctl.
sudo modprobe overlay
sudo modprobe br_netfilter
sudo tee /etc/sysctl.d/kubernetes.conf<<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
sudo sysctl --system
# Ensure that the br_netfilter module is loaded
lsmod | grep br_netfilter
nodes:
- address: <node-ip-address> #tom-cruise
internal_address: <internal-ip-address>
user: root
role: [controlplane, worker, etcd]
docker_socket: /var/run/docker.sock
ssh_agent_auth: true
services:
etcd:
snapshot: true
creation: 6h
retention: 24h
kube-api:
# IP range for any services created on Kubernetes
# This must match the service_cluster_ip_range in kube-controller
service_cluster_ip_range: 172.16.0.0/16
# Expose a different port range for NodePort services
service_node_port_range: 30000-32767
pod_security_policy: false
kube-controller:
# CIDR pool used to assign IP addresses to pods in the cluster
cluster_cidr: 172.15.0.0/16
# IP range for any services created on Kubernetes
# This must match the service_cluster_ip_range in kube-api
service_cluster_ip_range: 172.16.0.0/16
kubelet:
# Base domain for the cluster
cluster_domain: cluster.local
# IP address for the DNS service endpoint
cluster_dns_server: 172.16.0.10
# Fail if swap is on
fail_swap_on: false
# Required for external TLS termination with
# ingress-nginx v0.22+
ingress:
provider: nginx
options:
use-forwarded-headers: "true"
#Name of K8S Cluster
cluster_name: rancher-cluster
network:
plugin: calico
# Specify DNS provider (coredns or kube-dns)
dns:
provider: kube-dns
# Kubernetes Authorization mode
# Enable RBAC
authorization:
mode: rbac
# Specify monitoring provider (metrics-server)
monitoring:
provider: metrics-server
rke up --config cluster.yml
and get the following error:INFO[0000] Running RKE version: v1.3.12
INFO[0000] Initiating Kubernetes cluster
INFO[0000] [certificates] GenerateServingCertificate is disabled, checking if there are unused kubelet certificates
INFO[0000] [certificates] Generating admin certificates and kubeconfig
INFO[0000] Successfully Deployed state file at [./cluster.rkestate]
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [<node-ip-address>]
WARN[0000] Failed to set up SSH tunneling for host [<node-ip-address>]: Can't retrieve Docker Info: error during connect: Get "<http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info>": Unable to access node with address [<node-ip-address>] using SSH. Please check if the configured key or specified key file is a valid SSH Private Key. Error: Error configuring SSH: ssh: no key found
WARN[0000] Removing host [<node-ip-address>] from node lists
FATA[0000] Cluster must have at least one etcd plane host: failed to connect to the following etcd host(s) [<node-ip-address>]