Ansible is an infrastructure automation engine that automates software configuration management. It is agentless and allows us to use SSH keys for connecting to remote machines. Ansible playbooks are written in yaml and offer inventory management in simple text files.
-
Ansible should be installed in your machine. Refer to the Ansible installation guide for platform specific installation.
-
SSH-Based login should be config between control-node and managed-node. Refer to How To Configure SSH Key-Based Authentication on a Linux Server
Resource | Minimum | Recommended |
---|---|---|
CPU | 2 CPU | 4 CPU |
Mem | 4 GB | 8 GB |
Disk | 40 GB | 160 GB |
Resource | Minimum | Recommended |
---|---|---|
Mem | 256 MB | 4 GB |
Disk | 1 GB | 50 GB |
Resource | Minimum | Recommended |
---|---|---|
CPU | 4 CPU | 8 CPU |
Mem | 4 GB | 8 GB |
Disk | 2.5 GB |
2 GB or more of RAM per machine
2 CPUs or more per machine
Ubuntu Server 22.04.2 LTS
- Support container runtime:
- Docker
- Containerd
- Kubernetes addons:
- Helm
- Metrics Server
- Nginx Ingress Controller
- Kubernetes Dashboard
- Cert Manager
- Support container network:
- Calico
- Support network file system:
- Linux NFS
- CICD:
- Harbor
- Jenkins
- GitLab
- Data center:
- Grafana UI
- InfluxDB
- Minio
- Elasticsearch
- Redis master replicas
sudo sh install.sh
# ---------------------------------------------------------------------------
# check ansible hosts can communication with each other
ansible -i single-hosts.inventory all -m ping
# ---------------------------------------------------------------------------
# install kubernetes environment
ansible-playbook -i single-hosts.inventory ../playbook/setup-kubernetes.yml
# remove kubernetes master node taint
sudo kubectl taint nodes $(sudo kubectl get nodes --selector=node-role.kubernetes.io/master -o jsonpath='{.items[].metadata.name}') node-role.kubernetes.io/master:NoSchedule-
# install cicd environment
ansible-playbook -i single-hosts.inventory ../playbook/setup-cicd.yml
# ---------------------------------------------------------------------------
# check ansible hosts can communication with each other
ansible -i single-hosts.inventory all -m ping
# ---------------------------------------------------------------------------
# reset cicd environment
ansible-playbook -i single-hosts.inventory ../playbook/reset-cicd.yml
# reset kubernetes environment
ansible-playbook -i single-hosts.inventory ../playbook/reset-kubernetes.yml
# ---------------------------------------------------------------------------
# check ansible hosts can communication with each other
ansible -i multiple-hosts.inventory all -m ping
# ---------------------------------------------------------------------------
# install cicd environment
ansible-playbook -i multiple-hosts.inventory ../playbook/setup-cicd.yml
# install kubernetes environment
ansible-playbook -i multiple-hosts.inventory ../playbook/setup-kubernetes.yml
# ---------------------------------------------------------------------------
# check ansible hosts can communication with each other
ansible -i multiple-hosts.inventory all -m ping
# ---------------------------------------------------------------------------
# reset kubernetes environment
ansible-playbook -i multiple-hosts.inventory ../playbook/reset-kubernetes.yml
# reset cicd environment
ansible-playbook -i multiple-hosts.inventory ../playbook/reset-cicd.yml
sudo kubectl -n kube-system get secret $(sudo kubectl -n kube-system get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"
cat /var/lib/jenkins/secrets/initialAdminPassword
admin/password
By default, a Linux package installation automatically generates a password for the initial administrator user account ( root) and stores it to /etc/gitlab/initial_root_password for at least 24 hours. For security reasons, after 24 hours, this file is automatically removed by the first gitlab-ctl reconfigure.
cat /etc/gitlab/initial_root_password
Service name | hostname |
---|---|
Kubernetes dashboard | dashboard.kubernetes.cluster.com |
Minio | minio.kubernetes.cluster.com |
InfluxDB | influxdb.kubernetes.cluster.com |
Grafana | grafana.kubernetes.cluster.com |