Skip to content

Commit

Permalink
feat(konnect): add manifests for konnect config variant
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Jan 30, 2023
1 parent 757fbbe commit 2839e12
Show file tree
Hide file tree
Showing 10 changed files with 1,912 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ Adding a new version? You'll need three changes:
a corresponding environment variable `CONTROLLER_KONG_ADMIN_URL` (which can
specify multiple values separated by a comma).
[#3268](https://github.com/Kong/kubernetes-ingress-controller/pull/3268)
- Added a new `dbless-konnect` configuration variant to the manifests. It can
be used to deploy a DB-less variant of KIC that will also synchronise its
data-plane configuration with Konnect cloud.
[#3448](https://github.com/Kong/kubernetes-ingress-controller/pull/3448)

### Fixed

Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,18 @@ debug.skaffold: skaffold
TAG=$(TAG)-debug REPO_INFO=$(REPO_INFO) COMMIT=$(COMMIT) \
$(SKAFFOLD) debug --port-forward=pods --profile=debug $(SKAFFOLD_FLAGS)

# This will port-forward 40000 from KIC's debugger to localhost. Connect to that
# port with debugger/IDE of your choice.
#
# To make it work with Konnect, you must provide following files under ./config/variants/konnect/debug:
# * `konnect.env` with CONTROLLER_KONNECT_RUNTIME_GROUP env variable set
# to the UUID of a Runtime Group you have created in Konnect.
# * `tls.crt` and `tls.key` with TLS client cerificate and its key (generated by Konnect).
.PHONY: debug.konnect.skaffold
debug.konnect.skaffold: skaffold
TAG=$(TAG)-debug REPO_INFO=$(REPO_INFO) COMMIT=$(COMMIT) \
$(SKAFFOLD) debug --port-forward=pods --profile=debug-konnect $(SKAFFOLD_FLAGS)

# This will port-forward 40000 from KIC's debugger to localhost. Connect to that
# port with debugger/IDE of your choice
.PHONY: debug.skaffold.sync
Expand Down
8 changes: 8 additions & 0 deletions config/variants/konnect/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../../base

patchesStrategicMerge:
- manager.yaml
29 changes: 29 additions & 0 deletions config/variants/konnect/base/manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-kong
namespace: kong
spec:
template:
spec:
containers:
- name: ingress-controller
envFrom:
- configMapRef:
# konnect-config ConfigMap is expected to specify:
# * CONTROLLER_KONNECT_RUNTIME_GROUP (required)
# * CONTROLLER_KONNECT_ADDRESS (optional)
name: konnect-config
env:
- name: CONTROLLER_KONNECT_SYNC_ENABLED
value: "true"
- name: CONTROLLER_KONNECT_TLS_CLIENT_CERT
valueFrom:
secretKeyRef:
name: konnect-client-tls
key: tls.crt
- name: CONTROLLER_KONNECT_TLS_CLIENT_KEY
valueFrom:
secretKeyRef:
name: konnect-client-tls
key: tls.key
3 changes: 3 additions & 0 deletions config/variants/konnect/debug/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tls.crt
tls.key
konnect.env
24 changes: 24 additions & 0 deletions config/variants/konnect/debug/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../base

patchesStrategicMerge:
- manager_debug.yaml

generatorOptions:
disableNameSuffixHash: true

secretGenerator:
- name: konnect-client-tls
namespace: kong
type: tls
files:
- tls.crt
- tls.key

configMapGenerator:
- name: konnect-config
namespace: kong
envs: [konnect.env]
32 changes: 32 additions & 0 deletions config/variants/konnect/debug/manager_debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-kong
namespace: kong
spec:
template:
spec:
containers:
- name: ingress-controller
command:
- /go/bin/dlv
- --continue
- --accept-multiclient
- --listen=:40000
- --check-go-version=false
- --headless=true
- --api-version=2
- --log=true
- --log-output=debugger,debuglineerr,gdbwire
- exec
- /manager-debug
- --
args:
- --feature-gates=GatewayAlpha=true
- --anonymous-reports=false
env:
- name: CONTROLLER_LOG_LEVEL
value: debug
- name: CONTROLLER_KONNECT_ADDRESS
value: https://us.kic.api.konghq.tech
image: kic-placeholder:placeholder
Loading

0 comments on commit 2839e12

Please sign in to comment.