Skip to content

Commit 972b934

Browse files
feat: add tunnel charts (#139)
1 parent 45b2018 commit 972b934

43 files changed

Lines changed: 1416 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
25+
# Chart testing and development
26+
tests/
27+
values-dev.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
name: codefresh-tunnel-client
3+
description: Codefresh tunnel client for ingressless operation of runtimes
4+
type: application
5+
version: 0.1.24
6+
appVersion: "d922170"
7+
maintainers:
8+
- name: codefresh
9+
url: https://codefresh-io.github.io/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- define "codefresh-tunnel-client.resources" -}}
2+
{{ include "codefresh-tunnel-client.config" . }}
3+
---
4+
{{ include "codefresh-tunnel-client.deployment" . }}
5+
---
6+
{{ include "codefresh-tunnel-client.sa" . }}
7+
{{- end}}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{/*
2+
Config
3+
*/}}
4+
{{- define "codefresh-tunnel-client.config" -}}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: codefresh-tunnel-client-config
9+
labels:
10+
{{- include "codefresh-tunnel-client.labels" . | nindent 4 }}
11+
data:
12+
frpc.ini: |-
13+
[common]
14+
server_addr = {{ required "tunnelServer.host is required" .Values.tunnelServer.host }}
15+
server_port = {{ required "tunnelServer.port is required" .Values.tunnelServer.port }}
16+
log_level = {{ default "info" .Values.logLevel }}
17+
tls_enable = {{ default "true" .Values.tunnelServer.tls }}
18+
tls_trusted_ca_file = /etc/ssl/certs/ca-certificates.crt
19+
disable_custom_tls_first_byte = true
20+
protocol = {{ default "wss" .Values.tunnelServer.protocol }}
21+
admin_addr = 127.0.0.1
22+
admin_port = 7400
23+
admin_user = admin
24+
admin_pwd = admin
25+
[{{ required "tunnel.subdomainPrefix is required" .Values.tunnel.subdomainPrefix }}]
26+
type = {{ default "http" .Values.tunnel.forwardTo.type }}
27+
local_ip = {{ required "tunnel.forwardTo.host is required" .Values.tunnel.forwardTo.host }}
28+
local_port = {{ required "tunnel.forwardTo.port is required" .Values.tunnel.forwardTo.port }}
29+
locations = {{ default "/" .Values.tunnel.forwardTo.location }}
30+
subdomain = {{ .Values.tunnel.subdomainPrefix }}
31+
meta_Authorization = {{"{{"}} .Envs.AUTHORIZATION {{"}}"}}
32+
ips_allow_list = {{ default "" .Values.tunnel.ipsAllowList }}
33+
{{- end }}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{/*
2+
Deployment template
3+
*/}}
4+
{{- define "codefresh-tunnel-client.deployment" -}}
5+
apiVersion: apps/v1
6+
kind: Deployment
7+
metadata:
8+
name: {{ include "codefresh-tunnel-client.name" . }}
9+
labels:
10+
{{- include "codefresh-tunnel-client.labels" . | nindent 4 }}
11+
annotations:
12+
checksum/config: {{ include "codefresh-tunnel-client.config" . | sha256sum }}
13+
spec:
14+
replicas: 1
15+
selector:
16+
matchLabels:
17+
{{- include "codefresh-tunnel-client.selectorLabels" . | nindent 6 }}
18+
template:
19+
metadata:
20+
{{- with .Values.podAnnotations }}
21+
annotations:
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
labels:
25+
{{- include "codefresh-tunnel-client.selectorLabels" . | nindent 8 }}
26+
spec:
27+
{{- with .Values.imagePullSecrets }}
28+
imagePullSecrets:
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
31+
serviceAccountName: {{ include "codefresh-tunnel-client.serviceAccountName" . }}
32+
securityContext:
33+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
34+
containers:
35+
- name: tunnel-client
36+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
37+
env:
38+
- name: AUTHORIZATION
39+
valueFrom:
40+
secretKeyRef:
41+
name: {{ .Values.tunnelServer.authorization.secretKeyRef.name }}
42+
key: {{ .Values.tunnelServer.authorization.secretKeyRef.key }}
43+
optional: false
44+
{{- with .Values.env -}}
45+
{{ . | toYaml | nindent 10 }}
46+
{{- end }}
47+
imagePullPolicy: {{ .Values.image.pullPolicy }}
48+
resources:
49+
{{- toYaml .Values.resources | nindent 12 }}
50+
volumeMounts:
51+
- mountPath: /etc/frp
52+
name: client-config
53+
volumes:
54+
- name: client-config
55+
projected:
56+
sources:
57+
- configMap:
58+
name: codefresh-tunnel-client-config
59+
optional: false
60+
items:
61+
- key: frpc.ini
62+
path: frpc.ini
63+
{{- with .Values.nodeSelector | default .Values.global.nodeSelector }}
64+
nodeSelector: {{ toYaml . | nindent 8 }}
65+
{{- end }}
66+
{{- with .Values.tolerations | default .Values.global.tolerations}}
67+
tolerations: {{ toYaml . | nindent 6 }}
68+
{{- end }}
69+
{{- with .Values.affinity }}
70+
affinity: {{ toYaml . | nindent 8 }}
71+
{{- end }}
72+
{{- end }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
################################################################################################################################################################
2+
# Naming and labeling
3+
################################################################################################################################################################
4+
5+
# -----------------------
6+
# client names and labels
7+
# -----------------------
8+
9+
{{/*
10+
Expand the name of the chart.
11+
*/}}
12+
{{- define "codefresh-tunnel-client.name" -}}
13+
{{- default "codefresh-tunnel-client" .Values.nameOverride | trunc 63 | trimSuffix "-" }}
14+
{{- end }}
15+
16+
{{/*
17+
Create chart name and version as used by the chart label.
18+
*/}}
19+
{{- define "codefresh-tunnel-client.selectorLabels" -}}
20+
app: {{ include "codefresh-tunnel-client.name" .}}
21+
release: {{ .Release.Name }}
22+
{{- end }}
23+
24+
{{- define "codefresh-tunnel-client.labels" -}}
25+
app: {{ include "codefresh-tunnel-client.name" .}}
26+
release: {{ .Release.Name }}
27+
app.kubernetes.io/part-of: codefresh-tunnel-client
28+
{{- end }}
29+
30+
{{/*
31+
Create the name of the service account to use
32+
*/}}
33+
{{- define "codefresh-tunnel-client.serviceAccountName" -}}
34+
{{- if .Values.serviceAccount.create }}
35+
{{- default (include "codefresh-tunnel-client.name" .) .Values.serviceAccount.name }}
36+
{{- else }}
37+
{{- default "default" .Values.serviceAccount.name }}
38+
{{- end }}
39+
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- define "codefresh-tunnel-client.sa" }}
2+
{{- if .Values.serviceAccount.create }}
3+
apiVersion: v1
4+
kind: ServiceAccount
5+
metadata:
6+
name: {{ include "codefresh-tunnel-client.serviceAccountName" . }}
7+
labels:
8+
{{- include "codefresh-tunnel-client.labels" . | nindent 4 }}
9+
{{- with .Values.serviceAccount.annotations }}
10+
annotations:
11+
{{- toYaml . | nindent 4 }}
12+
labels:
13+
{{- include "codefresh-tunnel-client.labels" . | nindent 4 }}
14+
{{- end }}
15+
{{- end }}
16+
{{- end }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- if not .Values.libraryMode }}
2+
{{- include "codefresh-tunnel-client.config" . }}
3+
{{- end }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- if not .Values.libraryMode }}
2+
{{- include "codefresh-tunnel-client.deployment" . }}
3+
{{- end }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- if not .Values.libraryMode }}
2+
{{- include "codefresh-tunnel-client.sa" . }}
3+
{{- end }}

0 commit comments

Comments
 (0)