Skip to main content

First application

Available

Deployed and supported. The fields and commands described here are stable within version v1alpha1.

You are signed in and positioned on a tenant. Let's deploy a first application: a public web server, with its TLS certificate, in less than five minutes.

1. Generate a manifest​

The template catalog saves you from starting from a blank page:

sng template gen App web
web.yml écrit (App)

Open web.yml and replace its content with this minimal service:

web.yml
apiVersion: deploy.stackngo.io/v1alpha1
kind: App
metadata:
name: web
spec:
services:
web:
image: nginxdemos/hello:plain-text
ports: ["80"]
size: xxs
healthcheck:
http: /
port: 80
ingress: {}
  • services: a service named web, a public image, a port.
  • size: xxs: the smallest container size (see Sizes).
  • ingress: {}: expose the service on the Internet, with the default domain and a TLS certificate.

The manifest does not mention a tenant: it is applied in your current tenant.

2. Check before applying​

sng validate web.yml
sng plan web.yml
CHANGE KIND NAME
create App web

validate checks the structure of the manifest. plan compares with the current desired state and announces what apply will do: create, update or unchanged.

3. Apply​

sng apply web.yml
apply acme — 1 object(s)

The manifest is now in your tenant's desired state. The platform applies it in less than a minute.

4. Follow the deployment​

sng app describe web
NAME READY SERVICES REASON AGE
web True 1/1 48s

SERVICE KIND PHASE READY URL
web deployment Ready true https://web-web.acme.dev.stackngo.app

As long as READY is False, the REASON column and the phase of each service explain what is happening (Progressing while the image is pulled, Waiting if a dependency is not ready). The conditions index details each reason.

The container logs:

sng app logs web

5. Open the application​

The URL always follows the same pattern: https://<service>-<app>.<tenant>.dev.stackngo.app.

curl https://web-web.acme.dev.stackngo.app
Server address: …:80
Server name: web-…

The TLS certificate was issued automatically.

6. Modify, then clean up​

Change image, add a service or a volume, then reapply: sng apply web.yml. sng plan always shows you the difference before acting. For quick scaling without touching the file: sng app scale web 2.

When you are done:

sng kind delete App web

The containers, the certificate and the URL disappear in less than a minute. Any volumes are kept (see Storage).

If it doesn't work​

What you seeWhat to do
sng apply responds invalid manifest …The message names the faulty field; fix it and run sng validate again
READY stays False with RolloutFailedsng app logs web: does the image start without administrator privileges, does the probe target the right port?
READY stays False with QuotaExceededChoose a smaller size or change tier
The URL responds with an invalid certificateThe certificate is being issued: try again a minute later

What you just did​

Next step: What's next?