Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 28 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,96 +7,54 @@ A Kubernetes-native control plane for Envoy proxies that provides dynamic config
Envoy xDS Controller is a Kubernetes controller that manages Envoy proxy configurations through the xDS API. It allows defining Envoy configurations as Kubernetes Custom Resources (CRs) and automatically transforms them into Envoy configurations, which are delivered to proxies via the xDS protocol in real-time.

Key features:
- Full support for Envoy xDS v3 API (LDS, RDS, CDS, EDS)
- Full support for Envoy xDS v3 API (LDS, RDS, CDS, SDS)
- Kubernetes-native integration with controller-runtime
- Dynamic configuration updates without proxy restarts
- Authentication and authorization with OIDC and RBAC
- Templating system for configuration reuse
- Web UI for configuration management

## Documentation

| Document | Description |
|----------|-------------|
| [Overview](docs/overview.md) | Project overview and concepts |
| [Architecture](docs/architecture.md) | Internal architecture and components |
| [xDS Server](docs/xds.md) | xDS implementation details |
| [Configuration](docs/configuration.md) | Configuration options |
| [Templates](docs/templates.md) | VirtualServiceTemplate usage |
| [TLS](docs/tls.md) | TLS configuration |
| [Deployment](docs/deployment.md) | Deployment guide |
| [Development](docs/development.md) | Development setup |
| [Testing](docs/testing.md) | Testing guide |
| [Troubleshooting](docs/troubleshooting.md) | Common issues and solutions |

## Getting Started

### Prerequisites
- go version v1.24.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
- docker version 17.03+
- kubectl version v1.11.3+
- Access to a Kubernetes v1.11.3+ cluster

### To Deploy on the cluster
**Build and push your image to the location specified by `IMG`:**
### Installation

```sh
make docker-build docker-push IMG=<some-registry>/envoy-xds-controller:tag
helm repo add envoy-xds-controller https://kaasops.github.io/envoy-xds-controller
helm install envoy-xds-controller envoy-xds-controller/envoy-xds-controller
```

**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 install
```

**Deploy the Manager to the cluster with the image specified by `IMG`:**

```sh
make deploy IMG=<some-registry>/envoy-xds-controller:tag
```

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

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

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

>**NOTE**: Ensure that the samples has default values to test it out.

### To Uninstall
**Delete the instances (CRs) from the cluster:**

With custom values:
```sh
kubectl delete -k config/samples/
helm install envoy-xds-controller envoy-xds-controller/envoy-xds-controller \
--set image.tag=latest \
--set ui.enabled=true
```

**Delete the APIs(CRDs) from the cluster:**

```sh
make uninstall
```

**UnDeploy the controller from the cluster:**

```sh
make undeploy
```

## 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 build-installer IMG=<some-registry>/envoy-xds-controller:tag
```

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.

2. Using the installer

Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.:
### Uninstall

```sh
kubectl apply -f https://raw.githubusercontent.com/<org>/envoy-xds-controller/<tag or branch>/dist/install.yaml
helm uninstall envoy-xds-controller
```

## Contributing
Expand All @@ -115,7 +73,6 @@ We welcome contributions to the Envoy xDS Controller project! Here's how you can

3. **Development Environment**:
- See the [development documentation](docs/development.md) for setting up your development environment
- Check [contributing guidelines](docs/contributing/development.md) for webhook setup

4. **Testing**:
- Add tests for new features
Expand Down
13 changes: 10 additions & 3 deletions api/v1alpha1/virtualservice_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ func (vsc *VirtualServiceCommonSpec) IsEqual(other *VirtualServiceCommonSpec) bo
if vsc == nil || other == nil {
return false
}
// TODO: bad performance
vscBytes, _ := json.Marshal(vsc)
vscOtherBytes, _ := json.Marshal(other)
// JSON comparison for complex nested structures with runtime.RawExtension.
// If marshaling fails, return false to trigger rebuild (safer than skipping).
vscBytes, err := json.Marshal(vsc)
if err != nil {
return false
}
vscOtherBytes, err := json.Marshal(other)
if err != nil {
return false
}
return bytes.Equal(vscBytes, vscOtherBytes)
}
21 changes: 18 additions & 3 deletions api/v1alpha1/virtualservice_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,16 @@ func (vs *VirtualService) IsEqual(other *VirtualService) bool {
if vs == nil || other == nil {
return false
}
if vs.Annotations == nil || other.Annotations == nil {
return false
// Compare NodeIDs annotation - treat nil map same as empty/missing key
vsNodeIDs := ""
if vs.Annotations != nil {
vsNodeIDs = vs.Annotations[AnnotationNodeIDs]
}
otherNodeIDs := ""
if other.Annotations != nil {
otherNodeIDs = other.Annotations[AnnotationNodeIDs]
}
if vs.Annotations[AnnotationNodeIDs] != other.Annotations[AnnotationNodeIDs] {
if vsNodeIDs != otherNodeIDs {
return false
}
if !vs.Spec.VirtualServiceCommonSpec.IsEqual(&other.Spec.VirtualServiceCommonSpec) {
Expand Down Expand Up @@ -224,6 +230,15 @@ func (vs *VirtualService) IsEqual(other *VirtualService) bool {
return false
}
}
// Compare ExtraFields
if len(vs.Spec.ExtraFields) != len(other.Spec.ExtraFields) {
return false
}
for k, v := range vs.Spec.ExtraFields {
if otherV, ok := other.Spec.ExtraFields[k]; !ok || otherV != v {
return false
}
}
return true
}

Expand Down
Loading