Create an app environment API Reference
POST
/tenants/{tenant}/apps/{app}/environments
const url = 'https://api.kupe.cloud/api/v1/tenants/example/apps/example/environments';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"cluster":"europe","deletionProtection":true,"domains":["example"],"environment":"production","secrets":[{"name":"example","path":"example"}],"web":{"args":["example"],"command":["example"],"env":[{"name":"example","value":"example","valueFrom":{"secretKeyRef":{"key":"example","secret":"example"}}}],"healthChecks":{"liveness":{"http":{"path":"example"},"tcp":{}},"readiness":{"http":{"path":"example"},"tcp":{}}},"image":"example","port":1,"replicas":1,"resources":{"limits":{"cpu":"example","memory":"example"},"requests":{"cpu":"example","memory":"example"}}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.kupe.cloud/api/v1/tenants/example/apps/example/environments \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "cluster": "europe", "deletionProtection": true, "domains": [ "example" ], "environment": "production", "secrets": [ { "name": "example", "path": "example" } ], "web": { "args": [ "example" ], "command": [ "example" ], "env": [ { "name": "example", "value": "example", "valueFrom": { "secretKeyRef": { "key": "example", "secret": "example" } } } ], "healthChecks": { "liveness": { "http": { "path": "example" }, "tcp": {} }, "readiness": { "http": { "path": "example" }, "tcp": {} } }, "image": "example", "port": 1, "replicas": 1, "resources": { "limits": { "cpu": "example", "memory": "example" }, "requests": { "cpu": "example", "memory": "example" } } } }'Create an environment on an existing cluster. Resolve the image to a digest with POST /tenants/{tenant}/app-images/resolve first. CPU and memory requests default to 250m and 256Mi, and limits to 1 CPU and 512Mi. Deletion protection defaults to true. Answers 404 while the platform has apps switched off.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” tenant
required
string
Tenant name
app
required
string
App name
Request Body
Section titled “ Request Body ”Request
Media type application/json
object
cluster
string
Example
europe deletionProtection
boolean
domains
Array<string>
environment
string
Example
production secrets
Array<object>
object
name
string
path
string
web
object
args
Array<string>
command
Array<string>
env
Array<object>
object
name
string
value
string
valueFrom
object
secretKeyRef
object
key
string
secret
string
healthChecks
object
liveness
object
http
object
path
string
tcp
object
readiness
object
http
object
path
string
tcp
object
image
string
port
integer
replicas
integer
resources
object
limits
object
cpu
string
memory
string
requests
object
cpu
string
memory
string
Responses
Section titled “ Responses ”Created
Media type application/json
object
app
string
cluster
string
createdAt
string
deletionProtection
boolean
deploymentRevision
integer
domains
Array<string>
environment
string
generation
integer
name
string
resourceVersion
string
secrets
Array<object>
object
name
string
path
string
status
object
activeRelease
object
name
string
address
string
conditions
Array<object>
object
lastTransitionTime
string
message
string
reason
string
status
string
type
string
deployment
object
phase
string
reason
string
release
object
name
string
domains
Array<object>
object
host
string
phase
string
reason
string
record
string
lastSuccessfulRelease
object
name
string
namespace
string
phase
string
recovery
object
phase
string
release
object
name
string
requestedRelease
object
name
string
secrets
Array<object>
object
missingKeys
Array<string>
name
string
phase
string
uid
string
web
object
args
Array<string>
command
Array<string>
env
Array<object>
object
name
string
value
string
valueFrom
object
secretKeyRef
object
key
string
secret
string
healthChecks
object
liveness
object
http
object
path
string
tcp
object
readiness
object
http
object
path
string
tcp
object
image
string
port
integer
replicas
integer
resources
object
limits
object
cpu
string
memory
string
requests
object
cpu
string
memory
string
Example generated
{ "app": "example", "cluster": "example", "createdAt": "example", "deletionProtection": true, "deploymentRevision": 1, "domains": [ "example" ], "environment": "example", "generation": 1, "name": "example", "resourceVersion": "example", "secrets": [ { "name": "example", "path": "example" } ], "status": { "activeRelease": { "name": "example" }, "address": "example", "conditions": [ { "lastTransitionTime": "example", "message": "example", "reason": "example", "status": "example", "type": "example" } ], "deployment": { "phase": "example", "reason": "example", "release": { "name": "example" } }, "domains": [ { "host": "example", "phase": "example", "reason": "example", "record": "example" } ], "lastSuccessfulRelease": { "name": "example" }, "namespace": "example", "phase": "example", "recovery": { "phase": "example", "release": { "name": "example" } }, "requestedRelease": { "name": "example" }, "secrets": [ { "missingKeys": [ "example" ], "name": "example", "phase": "example" } ] }, "uid": "example", "web": { "args": [ "example" ], "command": [ "example" ], "env": [ { "name": "example", "value": "example", "valueFrom": { "secretKeyRef": { "key": "example", "secret": "example" } } } ], "healthChecks": { "liveness": { "http": { "path": "example" }, "tcp": {} }, "readiness": { "http": { "path": "example" }, "tcp": {} } }, "image": "example", "port": 1, "replicas": 1, "resources": { "limits": { "cpu": "example", "memory": "example" }, "requests": { "cpu": "example", "memory": "example" } } }}Headers
Section titled “ Headers ” ETag
string
UID and spec generation
Bad Request
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Unauthorized
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Forbidden
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Not Found
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Conflict
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Precondition Failed
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Too Many Requests
Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"} Media type application/json
object
code
string
error
string
field
string
message
string
severity
string
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}