apply

command
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

Apply resource to cluster

This example shows you how to apply multiple resources to the Kubernetes cluster.

Running this example

Make sure your kubectl and ~/.kube/config is configured. Run kubectl get nodes to confirm.

Run this application with:

go build -o apply .
./apply

Running this application will use the kubeconfig file to authenticate the cluster, and apply the nginx Deployment to the default namespace.

$ kubectl get svc
NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)     AGE
kubernetes   ClusterIP   10.96.0.1        <none>        443/TCP     113d
nginx-svc    ClusterIP   10.109.238.235   <none>        80/TCP      6s

$ kubectl get deploy
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
nginx     0/1     1            0           10s

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL