Skip to content

Rapid golang application deployment using ko, drone and kubernetes.

License

Notifications You must be signed in to change notification settings

kameshsampath/ko-drone-k3d-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using ko with Drone CI and k3d

An example to show how to use ko as part of Drone CI pipelines to deploy an application to k3s cluster on your laptop.

Pre-requisites

Run Pipeline

drone exec --trusted

If all goes well you should have the hello-world deployment running in your cluster.

Validate the deployment

export KUBECONFIG="$PWD/.kube/config.external"

Check the pods and services,

kubectl get pods,svc
NAME                               READY   STATUS    RESTARTS   AGE
pod/hello-world-566b6d7896-6qts9   1/1     Running   0          4m9s

NAME                  TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/kubernetes    ClusterIP   10.43.0.1      <none>        443/TCP    13m
service/hello-world   ClusterIP   10.43.224.48   <none>        8080/TCP   12m

Do port forward the hello-world service,

kubectl port-forward deployments/hello-world 8080

Calling the service,

curl localhost:8080/

Using ko from host

If you have installed ko locally, then run the command to deploy the application.

export KUBECONFIG="$PWD/.kube/config.external"
export KO_DOCKER_REPO="k3d-myregistry.localhost:5001/examples"
ko apply --insecure-registry -f config/

Clean up

drone exec --trusted pipeline=clean

About

Rapid golang application deployment using ko, drone and kubernetes.

Topics

Resources

License

Stars

Watchers

Forks

Languages