Skip to content

[Feature] [Gateway] SNI and Authz support #1714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- (Bugfix) Fix race condition in ArangoBackup
- (Feature) Improve Gateway Config gen
- (Feature) Integration Service TLS
- (Feature) (Gateway) SNI and Authz support

## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23)
- (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ FROM ${ENVOY_IMAGE} AS envoy

FROM ${IMAGE} AS base

RUN apt-get update && apt-get upgrade -y && apt-get clean
ARG BUILD_SKIP_UPDATE=false
ENV BUILD_SKIP_UPDATE=${BUILD_SKIP_UPDATE}
RUN if [ X"${BUILD_SKIP_UPDATE}" = X"true" ]; then echo "Update skipped!"; else apt-get update && apt-get upgrade -y && apt-get clean; fi

FROM base

Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ ifndef LOCALONLY
PUSHIMAGES := 1
endif

BUILD_SKIP_UPDATE ?= false

ifdef IMAGETAG
IMAGESUFFIX := :$(IMAGETAG)
else
Expand Down Expand Up @@ -272,7 +274,7 @@ NON_EE_SOURCES := $(shell $(NON_EE_SOURCES_QUERY))

YAML_EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated/informers pkg/generated/listers \
chart/kube-arangodb/templates chart/kube-arangodb-arm64/templates chart/kube-arangodb-enterprise/templates chart/kube-arangodb-enterprise-arm64/templates \
chart/kube-arangodb-crd/templates chart/arangodb-ingress-proxy/templates
chart/kube-arangodb-crd/templates
YAML_EXCLUDE_FILES :=
YAML_QUERY := find ./ -type f -name '*.yaml' $(foreach EXCLUDE_DIR,$(YAML_EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(YAML_EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)")
YAMLS := $(shell $(YAML_QUERY))
Expand Down Expand Up @@ -478,11 +480,11 @@ $(BIN): $(VBIN_LINUX_AMD64) $(VBIN_OPS_LINUX_AMD64) $(VBIN_INT_LINUX_AMD64)
docker: clean check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
ifdef PUSHIMAGES
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "BUILD_SKIP_UPDATE=${BUILD_SKIP_UPDATE}" \
--platform linux/amd64,linux/arm64 --push -t $(OPERATORIMAGE) .
else
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "BUILD_SKIP_UPDATE=${BUILD_SKIP_UPDATE}" \
--platform linux/amd64,linux/arm64 -t $(OPERATORIMAGE) .
endif

Expand Down Expand Up @@ -802,6 +804,7 @@ set-typed-api-version/%:
@grep -rHn "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/$*/v[A-Za-z0-9]\+" \
"$(ROOT)/pkg/deployment/" \
"$(ROOT)/pkg/replication/" \
"$(ROOT)/pkg/integrations/" \
"$(ROOT)/pkg/operator/" \
"$(ROOT)/pkg/operatorV2/" \
"$(ROOT)/pkg/server/" \
Expand All @@ -818,6 +821,7 @@ set-api-version/%:
@grep -rHn "github.com/arangodb/kube-arangodb/pkg/apis/$*/v[A-Za-z0-9]\+" \
"$(ROOT)/pkg/deployment/" \
"$(ROOT)/pkg/replication/" \
"$(ROOT)/pkg/integrations/" \
"$(ROOT)/pkg/operator/" \
"$(ROOT)/pkg/operatorV2/" \
"$(ROOT)/pkg/server/" \
Expand All @@ -831,6 +835,7 @@ set-api-version/%:
@grep -rHn "DatabaseV[A-Za-z0-9]\+()" \
"$(ROOT)/pkg/deployment/" \
"$(ROOT)/pkg/replication/" \
"$(ROOT)/pkg/integrations/" \
"$(ROOT)/pkg/operator/" \
"$(ROOT)/pkg/operatorV2/" \
"$(ROOT)/pkg/server/" \
Expand All @@ -844,6 +849,7 @@ set-api-version/%:
@grep -rHn "ReplicationV[A-Za-z0-9]\+()" \
"$(ROOT)/pkg/deployment/" \
"$(ROOT)/pkg/replication/" \
"$(ROOT)/pkg/integrations/" \
"$(ROOT)/pkg/operator/" \
"$(ROOT)/pkg/operatorV2/" \
"$(ROOT)/pkg/server/" \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Flags:
--kubernetes.max-batch-size int Size of batch during objects read (default 256)
--kubernetes.qps float32 Number of queries per second for k8s API (default 15)
--log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty")
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info])
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info])
--log.sampling If true, operator will try to minimize duplication of logging events (default true)
--memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing
--metrics.excluded-prefixes stringArray List of the excluded metrics prefixes
Expand Down
4 changes: 0 additions & 4 deletions chart/arangodb-ingress-proxy/Chart.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions chart/arangodb-ingress-proxy/LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions chart/arangodb-ingress-proxy/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions chart/arangodb-ingress-proxy/templates/NOTES.txt

This file was deleted.

15 changes: 0 additions & 15 deletions chart/arangodb-ingress-proxy/templates/_helpers.tpl

This file was deleted.

46 changes: 0 additions & 46 deletions chart/arangodb-ingress-proxy/templates/configmap.yaml

This file was deleted.

68 changes: 0 additions & 68 deletions chart/arangodb-ingress-proxy/templates/deployment.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions chart/arangodb-ingress-proxy/templates/service.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions chart/arangodb-ingress-proxy/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/cli/arangodb_operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Flags:
--kubernetes.max-batch-size int Size of batch during objects read (default 256)
--kubernetes.qps float32 Number of queries per second for k8s API (default 15)
--log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty")
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info])
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info])
--log.sampling If true, operator will try to minimize duplication of logging events (default true)
--memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing
--metrics.excluded-prefixes stringArray List of the excluded metrics prefixes
Expand Down
7 changes: 6 additions & 1 deletion integrations/envoy/auth/v3/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,10 @@ func (i *impl) Register(registrar *grpc.Server) {
}

func (i *impl) Check(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest) (*pbEnvoyAuthV3.CheckResponse, error) {
return &pbEnvoyAuthV3.CheckResponse{}, nil
logger.Info("Request Received")
return &pbEnvoyAuthV3.CheckResponse{
HttpResponse: &pbEnvoyAuthV3.CheckResponse_OkResponse{
OkResponse: &pbEnvoyAuthV3.OkHttpResponse{},
},
}, nil
}
25 changes: 25 additions & 0 deletions integrations/envoy/auth/v3/logger.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// DISCLAIMER
//
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v3

import "github.com/arangodb/kube-arangodb/pkg/logging"

var logger = logging.Global().RegisterAndGetLogger("integration-envoy-auth-v3", logging.Info)
4 changes: 3 additions & 1 deletion integrations/envoy/auth/v3/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/arangodb/kube-arangodb/pkg/util/svc"
"github.com/arangodb/kube-arangodb/pkg/util/tests"
"github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc"
)

Expand All @@ -53,6 +54,7 @@ func Test_AllowAll(t *testing.T) {
require.NoError(t, err)
require.NoError(t, resp.Validate())
require.Nil(t, resp.Status)
require.Nil(t, resp.HttpResponse)
require.NotNil(t, resp.HttpResponse)
require.NotNil(t, tests.CastAs[*pbEnvoyAuthV3.CheckResponse_OkResponse](t, resp.GetHttpResponse()).OkResponse)
require.Nil(t, resp.DynamicMetadata)
}
Loading