kubeclient

module
v0.0.0-...-0d81e42 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0

README

kubeclient

General kubernetes go client, can deploy any resource kind.

Example

package main

import (
	"context"

	appsv1 "k8s.io/api/apps/v1"
	clientv1 "github.com/alandtsang/kubeclient/pkg/client/v1"
	"github.com/alandtsang/kubeclient/pkg/config"
)

func main() {
	ctx := context.Background()

	kubeConfig, err := config.DefaultKubeConfig()
	if err != nil {
		// ...
	}

	kubeClient, err := clientv1.NewKubeClient(kubeConfig)
	if err != nil {
		// ...
	}

	deploy := &appsv1.Deployment{
		// ...
	}

	if err = kubeClient.Apply(ctx, deploy); err != nil {
		// ...
    }
}

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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