Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.38 KB

File metadata and controls

61 lines (43 loc) · 1.38 KB

Deploy from local source directory

See Basic Workflow for introduction.

Grab example source code via Git

$ git clone https://github.com/cppforlife/simple-app

$ cd simple-app

Create new namespace

$ kubectl create ns deploy-from-source

$ export KNCTL_NAMESPACE=deploy-from-source

Create Docker Hub secret for pushing images

$ knctl basic-auth-secret create -s docker-reg1 --docker-hub -u <your-username> -p <your-password>

If necessary, create Docker Hub secret for pulling images

$ knctl basic-auth-secret create -s docker-reg2 --docker-hub -u <your-username> -p <your-password> --for-pulling

Create service account that references above credentials

$ knctl service-account create -a serv-acct1 -s docker-reg1 [-s docker-reg2]

Deploy service that builds image from a Git repo, and then deploys it

$ knctl deploy \
    --service simple-app \
    --directory=$PWD \
    --service-account serv-acct1 \
    --image index.docker.io/<your-username>/<your-repo> \
    --env SIMPLE_MSG=123

Optionally make some changes (in ./app.go for example)

Deploy with updated source without commiting this change to Git

$ knctl deploy \
    --service simple-app \
    --directory=$PWD \
    --service-account serv-acct1 \
    --image index.docker.io/<your-username>/<your-repo> \
    --env SIMPLE_MSG=123