This repository has been archived by the owner on Aug 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58e6cbd
commit ea2782e
Showing
7 changed files
with
347 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM golang:1.13 as builder | ||
|
||
RUN mkdir -p /kxds/ | ||
|
||
WORKDIR /kxds | ||
|
||
COPY . . | ||
|
||
RUN go mod download | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin/kxds cmd/kxds/* | ||
|
||
FROM alpine:3.10 | ||
|
||
RUN addgroup -S app \ | ||
&& adduser -S -g app app \ | ||
&& apk --no-cache add \ | ||
curl openssl netcat-openbsd | ||
|
||
WORKDIR /home/app | ||
|
||
COPY --from=builder /kxds/bin/kxds . | ||
RUN chown -R app:app ./ | ||
|
||
USER app | ||
|
||
CMD ["./kxds"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
TAG?=latest | ||
VERSION?=$(shell grep 'VERSION' cmd/kxds/version.go | awk '{ print $$4 }' | tr -d '"' | head -n1) | ||
NAME:=kxds | ||
DOCKER_REPOSITORY:=stefanprodan | ||
DOCKER_IMAGE_NAME:=$(DOCKER_REPOSITORY)/$(NAME) | ||
|
||
run: | ||
go run cmd/kxds/*.go serve --kubeconfig=$$HOME/.kube/config | ||
|
||
envoy: | ||
envoy -c envoy.yaml -l info | ||
|
||
build-container: | ||
docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) . | ||
|
||
push-container: build-container | ||
docker push $(DOCKER_IMAGE_NAME):$(VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# kxds | ||
# kxds | ||
|
||
KxDS is an Envoy discovery service implementation for Kubernetes services | ||
|
||
## Features | ||
|
||
* **Service Discovery** KxDS watches Kubernetes for ClusterIP services with a `http` named port | ||
* **Envoy Clusters (CDS)** are generated for each Kubernetes service in the form `<name>-<namespace>-<http-port>` | ||
* **Envoy Routes (RDS)** are generated for each cluster and mapped to the `<name>.<namespace>` domain | ||
* **Envoy Listeners (LDS)** KxDS configures Envoy to listen on port 8080 and sets up retry policies for each route | ||
|
||
## Install | ||
|
||
```sh | ||
kubectl apply -k github.com/stefanprodan/kxds//kustomize/envoy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
node: | ||
cluster: envoy | ||
id: envoy | ||
|
||
admin: | ||
access_log_path: /dev/null | ||
address: | ||
socket_address: | ||
address: 0.0.0.0 | ||
port_value: 9000 | ||
|
||
dynamic_resources: | ||
ads_config: | ||
api_type: GRPC | ||
grpc_services: | ||
- envoy_grpc: | ||
cluster_name: xds | ||
cds_config: | ||
ads: {} | ||
lds_config: | ||
ads: {} | ||
|
||
static_resources: | ||
clusters: | ||
- name: xds | ||
connect_timeout: 0.30s | ||
type: static | ||
http2_protocol_options: {} | ||
load_assignment: | ||
cluster_name: xds | ||
endpoints: | ||
- lb_endpoints: | ||
- endpoint: | ||
address: | ||
socket_address: | ||
address: 127.0.0.1 | ||
port_value: 18000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module github.com/stefanprodan/kxds | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/envoyproxy/go-control-plane v0.9.0 | ||
github.com/gogo/protobuf v1.3.1 | ||
github.com/golang/protobuf v1.3.2 | ||
github.com/googleapis/gnostic v0.3.1 // indirect | ||
github.com/imdario/mergo v0.3.8 // indirect | ||
github.com/spf13/cobra v0.0.5 | ||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect | ||
google.golang.org/grpc v1.23.0 | ||
k8s.io/api v0.0.0-20191025225708-5524a3672fbb | ||
k8s.io/apimachinery v0.0.0-20191025225532-af6325b3a843 | ||
k8s.io/client-go v0.0.0-20190620085101-78d2af792bab | ||
k8s.io/klog v1.0.0 | ||
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4 // indirect | ||
) |