# agent-control-server

`agent-control-server` is a Kubernetes controller for managing the lifecycle of
TiDB Cloud observability agents.

## Development

Install the development tools once, then run the unit tests and linters:

```sh
make dev-tools
make test
make lint
```

Build the controller binary with:

```sh
make build
```

## Running Locally

Install the CRDs into the cluster selected by the current kubeconfig context:

```sh
make install
```

Run the controller in the foreground:

```sh
make run
```

Remove the CRDs when they are no longer needed:

```sh
make uninstall
```

## Generated Artifacts

After changing API definitions, regenerate CRDs and Go object methods:

```sh
make manifests
make generate
```

## Images

Build or push a controller image with an explicit image name and cloud vendor:

```sh
IMG=registry.example.com/agent-control-server:tag VENDOR=aws make docker-build
docker push registry.example.com/agent-control-server:tag
```

Environment-specific manifests and rollout automation are maintained in the
external deployment repository. This repository does not provide controller
deployment or undeployment targets.

Run `make help` to list the available targets.

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

## License

Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

