Scripts to create cluster and install kubernetes cluster.
Installation of kubernetes cluster in private cloud using kubeadm.
The following table lists the configurable parameters of the kubernetes cluster install and their default values.
Parameter | Description | Default |
---|---|---|
CLUSTER_NAME |
Kubernetes cluster name | cloud.com |
MOUNT_PATH |
The mount path where kubernetes scripts and certificates are available. | /root |
DNS_DOMAIN |
The domains where vms are hosted. | cloud.uat |
CERTIFICATE_PATH |
The path where certificates are present. | /etc/kubernetes/pki |
SERVER_DNS |
The comma separated dns names where kubernetes master would be running, this also includes name of the kubernetes api service dns names, the dns name where ha proxy is running | master.cloud.com.. |
SERVER_IP |
The comma separated list of all the ip addresses where master and ha proxy would be running (actual & virtual). This should also include the ip addess of kubernetes cluster api service ip. | 11.0.0.1,.. |
HA_PROXY_PORT |
Port of HA Proxy. | 6443 |
HA_PROXY_HOSTNAME |
IP/Hostname where HA Proxy running. | 11.0.0.1 |
LOAD_BALANCER_URL |
Endpoint of HA Proxy. | 11.0.0.1:6443 |
APP_HOST |
Hostname that would be put in ingress. | master.cloud.com |
API_SERVERS |
List of api servers which are used in creating certificates for ha proxy. | 11.0.0.1:master.clud.com,.. |
OIDC_ISSUE_URL |
OpenID Connect issuer url. | https://skmaji.auth0.com/ |
OIDC_CLIENT_ID |
OpenID Connect Application ID. | Client ID |
OIDC_USERNAME_CLAIM |
Field name in the ID Token for username claim. | sub |
OIDC_GROUPS_CLAIM |
Field name in the ID Token for group claim. | http://localhost:8080/claims/groups |
cd /root/kubernetes/install_cluster
./install_master_node.sh -e CLOUD
cd /root/kubernetes/install_cluster
./install_master_node.sh -e LOCAL
Install kubernetes:
cd /root/kubernetes/install_k8s
./gok install kubernetes
cd /root/kubernetes/install_k8s
./gok install kubernetes-worker
join
```shell script
./gok reset kubernetes
- To create a new join token
```shell script
kubeadm token create print-join-command
When installation of master is completed you should see below components in kube-system
namespace
When you reboot the vms, the kubelet service may not run, you need to restart the kubelet.
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a
systemctl stop kubelet
syatemctl start kubelet
Or Execute below command
./gok start proxy
systemctl status kubelet
journalctl -u kubelet
kcd name_space
alias kctl='kubectl --kubeconfig=/root/oauth.conf --token=$(python3 /root/kubernetes/install_k8s/kube-login/cli-auth.py)'
In order to use the above approach, you must install and run
kubectl get pods --v 6
kubectl top nodes --v 6
kubectl get pod, svc, hpa -owide
watch -n1 !!
kubectl get componentstatus
Ingress
should be installed before this can begin.This would install local
cd /root/kubernetes/install_k8s/
./setuUp-devops.sh
docker registry
,Git webhook
,Docker webhook
Helm webhook
Architecture of the pipeline
In order to test the pipeline use hlw
repository, make a sample change and commit.
Application would be accessible in https://master.cloud.com:32028/hlw
Ingress Controller
Cert Manager
Registry
Vault
Ldap
Keycloak
Kyverno
OAuth
Kubernetes Dashboard
Spinnaer
Jenkins
Istio
Opensearch
Prometheus-Grafana
Fluentd
Kube Login Webhook
Devops
: Githook
,Dockerhook
,Reghook
Kube Authentication
Ldap
: Link
Kerberos
: Link
Ldap Client
: Link
Ldap Client2
: Link
Other People
tab and ca.crt in Trusted Root Certificate Authority
tab.ip_address master.cloud.com
to windows host file located in C:\Windows\System32\drivers\etc. e.g. 192.168.1.5 master.cloud.com
>> host file.
network:
version: 2
renderer: networkd
wifis:
wlo1:
dhcp4: yes
access-points:
YOUR_WIFI_NAME:
password: YOUR_PASSWORD
netplan generate
netplan apply