IntroducereIntroduction
Prima aplicațieYour first app
De la un fișier gol la o adresă HTTPS, în patru comenzi. Fiecare comandă care schimbă ceva cere amprenta planului afișat.
From an empty file to an HTTPS address in four commands. Every command that changes something requires the digest of the plan it printed.
FișierulThe file
version: 1
project: hello
hosts:
main:
address: 203.0.113.10
tls:
email: [email protected]
apps:
web:
image: nginxinc/nginx-unprivileged:1.27-alpine
port: 8080
replicas: 2
domains: [hello.example.com]
scratch: [/var/cache/nginx]
health:
path: /Câmpul scratch montează un director temporar care poate fi scris, pentru că sistemul de fișiere al containerului este doar pentru citire.
The scratch field mounts a writable temporary directory, because the container filesystem is read-only.
Instalarea grupuluiInstalling the cluster
$ keryn plan-bootstrap
bootstrap plan digest 7c1e…
host main
firewall, k3s v1.30.4+k3s1, cert-manager v1.15.3, ClusterIssuers
$ keryn bootstrap --approve 7c1e…Fără --approve, bootstrap afișează doar planul. Cu o amprentă greșită sau veche, comanda se oprește fără să atingă gazdele.
Without --approve, bootstrap only prints the plan. With a wrong or stale digest, the command stops without touching the hosts.
Publicarea aplicațieiPublishing the app
$ keryn plan-apply
apply plan digest 3b9d…
$ keryn apply --approve 3b9d…
deployment.apps/web serverside-applied
ingress.networking.k8s.io/web serverside-applied
deployment "web" successfully rolled outÎnainte de aplicarea reală, Keryn trimite obiectele serverului Kubernetes într-o simulare (server dry run). Orice obiect respins oprește operația înainte de prima schimbare.
Before the real apply, Keryn sends the objects to the Kubernetes server as a dry run (server dry run). Any rejected object stops the operation before the first change.
VerificareVerifying
$ curl -sI https://hello.example.com | head -1
HTTP/2 200Certificat de probă mai întâiStaging certificate first
Pentru primele încercări, setați tls.staging: true. Let’s Encrypt are limite stricte pentru certificatele de producție; cele de probă nu sunt de încredere în browser, dar verifică tot lanțul.
For first attempts, set tls.staging: true. Let’s Encrypt has strict limits on production certificates; staging ones are not browser-trusted but exercise the whole chain.