Skip to content

Commit

Permalink
Update README for generated v4 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachfi committed Apr 9, 2024
1 parent e3089b7 commit d89c188
Showing 1 changed file with 51 additions and 37 deletions.
88 changes: 51 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,89 +60,103 @@ service.

## Getting Started

You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/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).
### Prerequisites

### Running on the cluster
- go version v1.21.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.

1. Install Instances of Custom Resources:
### To Deploy on the cluster

```sh
kubectl apply -f config/samples/
```

2. Build and push your image to the location specified by `IMG`:
**Build and push your image to the location specified by `IMG`:**

```sh
make docker-build docker-push IMG=<some-registry>/nodemanager:tag
```

3. Deploy the controller to the cluster with the image specified by `IMG`:
**NOTE:** This image ought to be published in the personal registry you specified.
And it is required to have access to pull the image from the working environment.
Make sure you have the proper permission to the registry if the above commands don’t work.

**Install the CRDs into the cluster:**

```sh
make deploy IMG=<some-registry>/nodemanager:tag
make install
```

### Uninstall CRDs

To delete the CRDs from the cluster:
**Deploy the Manager to the cluster with the image specified by `IMG`:**

```sh
make uninstall
make deploy IMG=<some-registry>/nodemanager:tag
```

### Undeploy controller
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
> privileges or be logged in as admin.

UnDeploy the controller to the cluster:
**Create instances of your solution**
You can apply the samples (examples) from the config/sample:

```sh
make undeploy
kubectl apply -k config/samples/
```

## Contributing

I'd welcome PRs or issues, if folks end up testing this out.
> **NOTE**: Ensure that the samples has default values to test it out.

### How it works
### To Uninstall

This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
**Delete the instances (CRs) from the cluster:**

It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
which provides a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
```sh
kubectl delete -k config/samples/
```

For nodes running off-cluster, this implies that the configuration is checked periodically to confirm compliance against the Kubernetes resources. The same is true for controllers running on cluster.
**Delete the APIs(CRDs) from the cluster:**

### Test It Out
```sh
make uninstall
```

1. Install the CRDs into the cluster:
**UnDeploy the controller from the cluster:**

```sh
make install
make undeploy
```

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

Following are the steps to build the installer and distribute this project to users.

1. Build the installer for the image built and published in the registry:

```sh
make run
make build-installer IMG=<some-registry>/nodemanager:tag
```

**NOTE:** You can also run this in one step by running: `make install run`
NOTE: The makefile target mentioned above generates an 'install.yaml'
file in the dist directory. This file contains all the resources built
with Kustomize, which are necessary to install this project without
its dependencies.

### Modifying the API definitions
2. Using the installer

If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.:

```sh
make manifests
kubectl apply -f https://raw.githubusercontent.com/<org>/nodemanager/<tag or branch>/dist/install.yaml
```

**NOTE:** Run `make --help` for more information on all potential `make` targets
## Contributing

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

**NOTE:** Run `make help` for more information on all potential `make` targets

More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)

## License

Copyright 2022.
Copyright 2024.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit d89c188

Please sign in to comment.