Skip to content

Commit c936ec1

Browse files
authored
[Feature] Add TCP Ingress Chart (#564)
1 parent 4f9c5fa commit c936ec1

File tree

12 files changed

+215
-15
lines changed

12 files changed

+215
-15
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
description: ArangoDB Ingress Proxy
2+
name: arangodb-ingress-proxy
3+
tillerVersion: '>2.7'
4+
version: 1.0.0
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright 2020 ArangoDB GmbH, Cologne, Germany
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
15+
Copyright holder is ArangoDB GmbH, Cologne, Germany
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Introduction
2+
3+
Kubernetes ArangoDB Ingress for custom certificates.
4+
5+
ArangoDB supports more than only HTTP protocol, so simple Ingress is not enough.
6+
7+
## Before
8+
9+
Before Ingress proxy will be installed certificate secret needs to be created:
10+
11+
```
12+
kubectl -n <deployment namespace> create secret tls <secret name> --cert <path to cert> --key <path to key>
13+
```
14+
15+
## Installation
16+
17+
To install Ingress:
18+
```
19+
helm install --name <my ingress name> --namespace <deployment namespace> <path to kube-arangodb repository>/chart/arangodb-ingress-proxy --set replicas=2 --set tls=TLS Secret name> --set deployment=<ArangoDeployment name>
20+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Your LB is ready!
2+
3+
Get LoadBalancer IP using `kubectl --namespace "{{ .Release.Namespace }}" get svc "{{ template "arangodb-ingress-proxy.name" . }}" -o jsonpath="{.status.loadBalancer.ingress[0].ip}"`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
3+
{{/*
4+
Expand the name of the chart.
5+
*/}}
6+
{{- define "arangodb-ingress-proxy.name" -}}
7+
{{- printf "%s" .Chart.Name | trunc 63 | trimSuffix "-" -}}
8+
{{- end -}}
9+
10+
{{/*
11+
Expand the name of the release.
12+
*/}}
13+
{{- define "arangodb-ingress-proxy.releaseName" -}}
14+
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" -}}
15+
{{- end -}}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ template "arangodb-ingress-proxy.name" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }}
8+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
9+
app.kubernetes.io/managed-by: {{ .Release.Service }}
10+
app.kubernetes.io/instance: {{ .Release.Name }}
11+
release: {{ .Release.Name }}
12+
data:
13+
config: |
14+
user nginx;
15+
worker_processes 1;
16+
17+
error_log /dev/stdout info;
18+
19+
pid /var/run/nginx.pid;
20+
21+
22+
events {
23+
worker_connections 1024;
24+
}
25+
26+
stream {
27+
log_format basic '$remote_addr [$time_local] '
28+
'$protocol $status $bytes_sent $bytes_received '
29+
'$session_time';
30+
access_log /dev/stdout basic;
31+
32+
server {
33+
listen 8529 ssl;
34+
proxy_pass {{ required "Arango Deployment name needs to be provided!" .Values.deployment }}:8529;
35+
36+
proxy_ssl on;
37+
38+
ssl_certificate /etc/nginx/local-tls/tls.crt;
39+
ssl_certificate_key /etc/nginx/local-tls/tls.key;
40+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
41+
ssl_ciphers HIGH:!aNULL:!MD5;
42+
ssl_session_timeout 4h;
43+
ssl_handshake_timeout 30s;
44+
proxy_timeout 6h;
45+
}
46+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "arangodb-ingress-proxy.name" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }}
8+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
9+
app.kubernetes.io/managed-by: {{ .Release.Service }}
10+
app.kubernetes.io/instance: {{ .Release.Name }}
11+
release: {{ .Release.Name }}
12+
spec:
13+
replicas: {{ .Values.replicas }}
14+
selector:
15+
matchLabels:
16+
app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }}
17+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
18+
app.kubernetes.io/instance: {{ .Release.Name }}
19+
release: {{ .Release.Name }}
20+
template:
21+
metadata:
22+
labels:
23+
app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }}
24+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
25+
app.kubernetes.io/managed-by: {{ .Release.Service }}
26+
app.kubernetes.io/instance: {{ .Release.Name }}
27+
release: {{ .Release.Name }}
28+
spec:
29+
affinity:
30+
nodeAffinity:
31+
requiredDuringSchedulingIgnoredDuringExecution:
32+
nodeSelectorTerms:
33+
- matchExpressions:
34+
- key: beta.kubernetes.io/arch
35+
operator: In
36+
values:
37+
- amd64
38+
podAntiAffinity:
39+
preferredDuringSchedulingIgnoredDuringExecution:
40+
- weight: 100
41+
podAffinityTerm:
42+
topologyKey: "kubernetes.io/hostname"
43+
labelSelector:
44+
matchExpressions:
45+
- key: app.kubernetes.io/name
46+
operator: In
47+
values:
48+
- {{ template "arangodb-ingress-proxy.name" . }}
49+
containers:
50+
- name: nginx
51+
imagePullPolicy: {{ .Values.imagePullPolicy }}
52+
image: {{ .Values.image }}
53+
ports:
54+
- name: nginx
55+
containerPort: 8529
56+
volumeMounts:
57+
- mountPath: /etc/nginx/nginx.conf
58+
name: config
59+
subPath: config
60+
- mountPath: /etc/nginx/local-tls
61+
name: tls
62+
volumes:
63+
- name: config
64+
configMap:
65+
name: {{ template "arangodb-ingress-proxy.name" . }}
66+
- name: tls
67+
secret:
68+
secretName: {{ required "TLS certificate need to be provided!" .Values.tls }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ template "arangodb-ingress-proxy.name" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }}
8+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
9+
app.kubernetes.io/managed-by: {{ .Release.Service }}
10+
app.kubernetes.io/instance: {{ .Release.Name }}
11+
release: {{ .Release.Name }}
12+
spec:
13+
ports:
14+
- name: server
15+
port: 8529
16+
protocol: TCP
17+
targetPort: 8529
18+
selector:
19+
app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }}
20+
app.kubernetes.io/managed-by: {{ .Release.Service }}
21+
app.kubernetes.io/instance: {{ .Release.Name }}
22+
release: {{ .Release.Name }}
23+
type: LoadBalancer
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
replicas: 2
4+
imagePullPolicy: Always
5+
image: nginx:1.16.1-alpine

pkg/apis/deployment/v1/tls_sni_spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const (
4444

4545
// TLSSNISpec holds TLS SNI additional certificates
4646
type TLSSNISpec struct {
47-
Mapping map[string][]string `json:"sniMapping,omitempty"`
47+
Mapping map[string][]string `json:"mapping,omitempty"`
4848
Mode *TLSSNIRotateMode `json:"mode,omitempty"`
4949
}
5050

0 commit comments

Comments
 (0)