Deploy
To deploy an app run ./appctl deploy
The deploy command will deploy the specified container image using the provided name into Platform9 and automatically provision a fully qualified domain with a unique port to access the application.
% ./appctl deploy --helpDeploy an appUsage: appctl deploy [flags]Examples: # Deploy an app using app-name and container image (public registry path) # Assumes the container has a server that will listen on port 8080 appctl deploy -n <appname> -i gcr.io/knative-samples/helloworld-go # Deploy an app using app-name and container image (private registry path) # Assumes the container has a server that will listen on port 8080 appctl deploy -n <appname> -i <private registry image path> -u <container registry username> -P <container registry password> # Sample command to deploy an app from a docker private registry path appctl deploy -n <appname> -i docker.io/<username>/<image>:<tag> -u <Docker username> -P <Docker password> # Sample command to deploy an app from an AWS ECR private registry path appctl deploy -n <appname> -i <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<image>:<tag> -u AWS -P <Password obtained from AWS CLI> # Sample command to deploy an app from a GCR private registry path appctl deploy -n <appname> -i gcr.io/<GCP_projectID>/<image> -u oauth2accesstoken -P <Token obtained from gcloud CLI> # Sample command to deploy an app from an ACR private registry path # Service principal should have role "Reader" to pull the image appctl deploy -n <appname> -i <registry name>.azurecr.io/<image>:<tag> -u <service principal appId> -P <service principal password> # Deploy an app using app-name and container image, and pass environment variables. # Assumes the container has a server that will listen on port 8080 appctl deploy -n <appname> -i <image> -e key1=value1 -e key2=value2 # Deploy an app using app-name, container image and pass environment variables and set port where application listens on. appctl deploy -n <appname> -i <image> -e key1=value1 -e key2=value2 -p <port> Ex: appctl deploy -n hello -i gcr.io/knative-samples/helloworld-go -e TARGET="appctler" -p 7893Flags: -n, --app-name string Name of the app to be deployed (lowercase alphanumeric characters, '-' or '.', must start with alphanumeric characters only) -e, --env stringArray Environment variable to set, as key=value pair -h, --help help for deploy -i, --image string Container image of the app (public / private registry path) -P, --password string Password of private container registry -p, --port string The port where app server listens, set as '--port <port>' -u, --username string Username of private container registryExample Deploy (public registry)
./appctl deploy --app-name <name> --image <docker-image path>Example:./appctl deploy --app-name pf9app --image gcr.io/knative-samples/helloworld-goExample Deploy (private registry)
./appctl deploy --app-name <name> --image <docker-image path> --username <container registry username> --password <container registry password>>Example:./appctl deploy --app-name pf9app --image gcr.io/private-sample/helloworld-go --username pf9 --password pf9Details on deploying app with a private container registry
| Repository | Container image path | Private registry username | Private registry password | Sample command |
|---|---|---|---|---|
| Docker | docker.io/<username>/ <imagename>:<tag> | Docker registry username | Docker registry password | appctl deploy -n dockerapp -i docker.io/<docker username>/helloworld-go -u <Docker username> -P <Docker password> |
| AWS ECR | <aws account id>.dkr.ecr. region. amazonaws.com/ <repository>:<tag> | AWS (Note: This is the default username and should be in capital) | aws ecr get-login-password --region <region name> (Note: aws CLI needs to be installed. User should be logged into the AWS. Details here.) | appctl deploy -n ecrapp -i 110072563648.dkr.ecr.us-west-2.amazonaws.com/<image>:<tag> -u AWS -P <Password as obtained from AWS CLI> |
| GCR | http://gcr.io/<GCP project ID>/<repository> | oauth2accesstoken (Note: Access token method is used to provide credentials. Access token expires after one hour.) | gcloud auth login gcloud auth print-access-token (Note: gcloud CLI needs to be installed. Details here.) | appctl deploy -n gcrapp -i gcr.io/<GCP project ID>/<repository> -u oauth2accesstoken -P <Token as obtained from gcloud CLI> |
| ACR | https://registry_name.azurecr.io/image:tag | Service Principal (Note: Generating Service Principal requires Azure CLI. Details to install Azure CLI here.) | Password of the Service Principal. | appctl deploy -n hello -i registry_name.azurecr.io -u <service principal appId> -p <service principal password> |
Specifying Ports
If your application server listens on a specific port, then you can specify that while deploying the app using --port flag.
./appctl deploy --app-name <name> --image <docker-image path> --port <port-value>Example:./appctl deploy --app-name pf9app --image gcr.io/knative-samples/helloworld-go --port 7893Using Environment Variables
./appctl deploy --app-name <name> --image <docker-image path> --env key1=value1Example:./appctl deploy --app-name pf9app --image gcr.io/knative-samples/helloworld-go --env TARGET=appctlerAppctl supports multiple --env variables
./appctl deploy --app-name <name> --image <docker-image path> --env key1=value1 --env key2=value2