Conversation
Copilot
AI
changed the title
[WIP] Create complete infrastructure project for Kubernetes cluster
Add complete single-node Kubernetes infrastructure project (Ansible + K8s manifests)
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a full infrastructure-as-code project that bootstraps a production-like Kubernetes environment on clean Debian Bookworm, deploying monitoring, nginx, etcd, and a health-checker daemon entirely via Ansible + raw K8s manifests.
Ansible Playbooks (
playbooks/)01-k8s-cluster.yml– swap-off → containerd (Docker repo) → kubeadm init → Flannel CNI → local-path-provisioner (default StorageClass) → untaint control-plane02-namespaces.yml– createsmonitoring,web,database,daemon03-monitoring.yml– Prometheus + Grafana + Alertmanager + Node Exporter DaemonSet + Nginx Exporter; waits for each rollout04-nginx.yml– webserver first, then proxy (order matters for upstream DNS)05-etcd.yml– deploy + smoke test; fault-tolerance steps (scale 5→3→5 + write/read) isolated under--tags fault_test06-daemon.yml– health-checker pod; waits 45s then validatessvstat+ log tailsite.yml– imports all six in orderK8s Manifests (
k8s/)Monitoring
kubernetes_sdfor node-exporter endpoint discovery; alert rules:HighCpuLoad >80%,HighMemory >85%,InstanceDown,EtcdQuorumRiskSecret(not plaintext env)DaemonSetwithhostNetwork/hostPIDandNoScheduletolerationNginx
nginx:bookworm):stub_statusat/stub_status, staticindex.htmlfrom ConfigMap; NodePort 30081nginx:bookworm):initContainer(debian:bookworm) generates self-signed cert viaopenssl; upstream withkeepalive 32+proxy_http_version 1.1+Connection "";proxy_cachebacked byemptyDir; TLSv1.2+, strong ciphers, HSTS; NodePorts 30080/30443Etcd
StatefulSetwith headless Service; dynamicPEERSstring constructed in-container via shell loop overINITIAL_CLUSTER_SIZE; 1Gi PVC per pod; NodePort 30379Daemon
debian:bookwormcontainer installspython3+daemontoolsat startup;svscanboot → superviseprocess tree;multilogwith timestamps and 1MiB rotation;health-checker.pypolls every 30s:/api/v1/queryfornode_load1/5/15/stub_statuson both webserver and proxy (captures HTTP headers too)/health+/v2/memberskey=valuelines under a human-readable timestamped headerNotable decisions
prom/prometheus:v2.54.1,grafana/grafana:11.4.0) — nolatestSecretreferenced viasecretKeyReffault_testso normal runs don't modify cluster stateOriginal prompt
Úkol
Vytvořit kompletní infrastrukturní projekt, který z čistého Debian Bookworm automaticky:
Požadované služby
Monitoring
Nginx
keepalive 32,proxy_http_version 1.1,Connection "")Distribuovaný systém – Etcd
Daemon Health Checker
health-checker.pyperiodicky (30s) kontroluje:Struktura souborů k vytvoření
Detailní specifikace souborů
ansible.cfg
inventory/hosts.yml
playbooks/site.yml
Import all playbooks 01 through 06 in order.
playbooks/01-k8s-cluster.yml
Must perform these steps in order:
playbooks/02-namespaces.yml
Apply k8s/namespaces.yml
playbooks/03-monitoring.yml
Apply all files in k8s/monitoring/ directory, wait for rollouts
playbooks/04-nginx.yml
Apply webserver.yml first, wait, then proxy.yml, wait
...
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.