package
0.0.0-20221115135248-ae214184951f
Repository: https://github.com/fgiloux/kcp-operator-sdk.git
Documentation: pkg.go.dev

# README

package templates

import ( "fmt" "strings"

"sigs.k8s.io/kubebuilder/v3/pkg/machinery"

)

var _ machinery.Template = &Readme{}

// Readme scaffolds a README.md file type Readme struct { machinery.TemplateMixin machinery.BoilerplateMixin machinery.ProjectNameMixin

License string

}

// SetTemplateDefaults implements file.Template func (f *Readme) SetTemplateDefaults() error { if f.Path == "" { f.Path = "README.md" }

f.License = strings.Replace(
	strings.Replace(f.Boilerplate, "/*", "", 1),
	"*/", "", 1)

f.TemplateBody = fmt.Sprintf(readmeFileTemplate,
	codeFence("make docker-build docker-push REGISTRY=<some-registry> IMG={{ .ProjectName }}:tag"),
	codeFence("make deploy REGISTRY=<some-registry> IMG={{ .ProjectName }}:tag"),
	codeFence("make uninstall"),
	codeFence("make undeploy"),
	codeFence("make install"),
	codeFence("make run"),
	codeFence("make manifests apiresourceschemas"))

return nil

}

//nolint:lll const readmeFileTemplate = `# {{ .ProjectName }}

// TODO(user): A simple overview of the project and its purpose.

Description

// TODO(user): An in-depth paragraph providing more details about the project and its use.

Getting Started

You’ll need a Kubernetes and optionally a kcp cluster to run against. You can use KIND to get a local cluster for testing, or run against a remote cluster.

Note: Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster + "kubectl cluster-info" + shows).

Running on Kubernetes or kcp

  1. Build and push your image to the location specified by + "REGISTRYandIMG" + :

%s

  1. Deploy the controller to the cluster with the image specified by + "REGISTRYandIMG" + :

%s

Uninstall resources

To delete the resources from the cluster:

%s

Undeploy controller

Undeploy the controller from the cluster:

%s

Contributing

// TODO(user): Add detailed information on how you would like others to contribute to this project.

How it works

This project aims to follow the Kubernetes Operator pattern

It uses Controllers which provides a reconcile function responsible for synchronizing resources untile the desired state is reached.

Test It Out

  1. Install the required resources into the cluster:

%s

  1. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):

%s

NOTE: You can also run this in one step by running: + "make install run" +

Modifying the API definitions

If you are editing the API definitions, regenerate the manifests using:

%s

NOTE: Run + "make --help" + for more information on all potential + "make" + targets

More information can be found via the Kubebuilder Documentation

License

{{ .License }} `

func codeFence(code string) string { return "sh" + "\n" + code + "\n" + "" }

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Dockerfile scaffolds a file that defines the containerized build process.
DockerIgnore scaffolds a file that defines which files should be ignored by the containerized build process.
GitIgnore scaffolds a file that defines which files should be ignored by git.
GoMod scaffolds a file that defines the project dependencies.
Main scaffolds a file that defines the controller manager entry point.
MainUpdater updates main.go to run Controllers.
Makefile scaffolds a file that defines project management CLI commands.
Readme scaffolds a README.md file.