Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.12 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.12 KB

PkgGoDev report card

k8s-commander

A golang library to create Kubernetes recipes following the command design pattern.

Recipe Example

You can find an example of a k8s recipe here

make run-example

Check here how to run recipe with the k8s commander. Example:

	cm := commander.New()

	// create a recipe with a set of commands
	opts := recipeOpts{
		Name:           "es",
		Namespace:      "default",
		ContainerImage: "elastic/elasticsearch",
		ContainerPort:  9200,
		ContainerTag:   "7.8.1",
	}
	recipe := NewElasticsearchDeployment(opts, clientset, logger)

	// Execute the recipe
	err = cm.Execute(recipe)
	if err != nil {
		logger.WithError(err).Error()
		os.Exit(-1)
	}

Available Commands

  • CreateNamespace
  • DeleteNamespace
  • CreateDeployment
  • CreateIngressCommand
  • CreateService