For the complete documentation index, see llms.txt. This page is also available as Markdown.

Kubernetes Autostopping

This tutorial shows you how to create and test an AutoStopping rule for your Kubernetes cluster.

This tutorial explains how to create and test an AutoStopping rule for your Kubernetes cluster.

Install a sample application

To test AutoStopping, you can use a sample nginx application.

To install this sample application, apply the following YAML in your Kubernetes cluster. This installs a demo application named autostopping-sample-app that runs three pods running nginx in the autostopping-sample namespace.

apiVersion: v1
kind: Namespace
metadata:
  name: autostopping-sample

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: autostopping-sample-app
  namespace: autostopping-sample
  labels:
    app: autostopping-sample-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: autostopping-sample-app
  template:
    metadata:
      labels:
        app: autostopping-sample-app
    spec:
      containers:
      - name: autostopping-sample-app
        image: nginx:1.14.2
        ports:
        - containerPort: 80

---

apiVersion: v1
kind: Service
metadata:
  name: autostopping-sample-svc
  namespace: autostopping-sample
spec:
  selector:
    app: autostopping-sample-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80

Supported ingress controllers for Kubernetes AutoStopping

Kubernetes AutoStopping support is fully available for the following ingress controllers and API gateways:

  1. You will need the following options set on your NGINX Ingress Controller:

  1. Expose your application by creating an ingress rule. Apply the following YAML to the cluster.

  1. Create an AutoStopping Rule. Before applying this YAML, make sure that the cloud-connector-id is updated and the namespace of the Rule is the same as the autostopping-sample-app application.

Your sample application is now managed by an AutoStopping Rule called autostopping-sample-ru.

  1. Expose your application by creating an ingress rule.

  1. Create an AutoStopping Rule. Before applying this YAML, make sure that the cloud-connector-id is updated and the namespace of the Rule is the same as the autostopping-sample-app application.

Your sample application is now managed by an AutoStopping Rule called autostopping-sample-rule.

Last updated

Was this helpful?