按照预定时间启动和停用 Kubernetes 部署
Snorlax is a Kubernetes operator that wakes and sleeps a specified set of Kubernetes deployments on a schedule.
You can also specify ingresses which will be updated to point to a wake server when asleep. When a request is received, the wake server serves a "waking up" splash page and wakes the deployments up. Once the deployments are ready, the ingresses are restored and the splash page will auto-refresh.
Sleeping your environments is the equivalent of turning off the lights at night.
As a common example, if you sleep all of your staging/ephemeral deployments for 8 hours each night and on weekends, they'll sleep ~55% of the month. That means ~55% savings on your cloud bill for those resources.
Install the snorlax Helm chart to install the SleepSchedule CRD and controller
helm repo add moonbeam https://moonbeam-nyc.github.io/helm-charts
helm repo update
helm install snorlax moonbeam/snorlax --create-namespace --namespace snorlax
Create your SleepSchedule resource to define the schedule for the deployment
…
SleepSchedule resourcekubectl apply -f your-app-sleep-schedule.yaml
(Requires make, minikube and helm to be installed)
Run make demo to:
snorlaxlocalhost to your Minikube cluster ingress service (you'll need to enter your password)Then go to http://localhost to see either the sleeping page or the dummy deployment (depending on the time of day).
You can also then try updating the sleep schedule with kubectl edit sleepschedule dummy.
(Requires make, minikube, helm, and docker to be installed)
Setup Minikube with the CRD and dummy application with sleep schedule:
make dev-setup
Then make your updates and run the operator:
make dev-run
0 8 * * *)Wondering how to best use Snorlax? Have questions or ideas for new features?
I'd love to hear, and maybe even build them! Reach out to me at:
暂无开放 Issues,或尚未同步最近议题。