Skip to content

Commit

Permalink
added rdp helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrkefc committed Feb 10, 2025
1 parent ff1af93 commit 78723f9
Show file tree
Hide file tree
Showing 9 changed files with 266 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/remotedialer-proxy/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions charts/remotedialer-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: remotedialer-proxy
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.1"
81 changes: 81 additions & 0 deletions charts/remotedialer-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{{/*
API Extension Name - To be used in other variables
*/}}
{{- define "api-extension.name" }}
{{- default "api-extension" .Values.apiExtensionName }}
{{- end}}

{{/*
Expand the name of the chart.
*/}}
{{- define "remotedialer-proxy.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "remotedialer-proxy.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "remotedialer-proxy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "remotedialer-proxy.labels" -}}
helm.sh/chart: {{ include "remotedialer-proxy.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ include "remotedialer-proxy.selectorLabels" . }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "remotedialer-proxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "remotedialer-proxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app: api-extension
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "remotedialer-proxy.serviceAccountName" -}}
{{- default (printf "%s-sa" (include "api-extension.name" .)) .Values.serviceAccount.name }}
{{- end }}


{{/*
Namespace to use
*/}}
{{- define "remotedialer-proxy.namespace" -}}
{{- default "cattle-system" .Values.namespaceOverride }}
{{- end }}

{{/*
Role to use
*/}}
{{- define "remotedialer-proxy.role" -}}
{{- default (printf "%s-role" (include "api-extension.name" .)) .Values.roleOverride }}
{{- end }}
56 changes: 56 additions & 0 deletions charts/remotedialer-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "remotedialer-proxy.fullname" . }}
namespace: {{ include "remotedialer-proxy.namespace" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "remotedialer-proxy.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "remotedialer-proxy.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
creationTimestamp: null
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "remotedialer-proxy.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}{{print "/" .Chart.Name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: https
containerPort: {{ .Values.service.httpsPort }}
protocol: TCP
- name: proxy
containerPort: {{ .Values.service.proxyPort }}
protocol: TCP
env:
- name: CERT_CA_NAME
value: {{ .Values.service.certCAName }}
- name: TLS_NAME
value: {{ .Values.service.tlsName}}
- name: CA_NAME
value: {{ .Values.service.caName}}
- name: CERT_CA_NAMESPACE
value: {{ include "remotedialer-proxy.namespace" . }}
- name: SECRET
value: {{ .Values.service.secret }}
- name: HTTPS_PORT
value: {{ .Values.service.httpsPort | quote }}
- name: PROXY_PORT
value: {{ .Values.service.proxyPort | quote }}
- name: PEER_PORT
value: {{ .Values.service.peerPort | quote }}
10 changes: 10 additions & 0 deletions charts/remotedialer-proxy/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "remotedialer-proxy.role" . }}
namespace: {{ include "remotedialer-proxy.namespace" . }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "create", "update"]

13 changes: 13 additions & 0 deletions charts/remotedialer-proxy/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ printf "%s-binding" (include "remotedialer-proxy.role" .) }}
namespace: {{ include "remotedialer-proxy.namespace" . }}
subjects:
- kind: ServiceAccount
name: {{ include "remotedialer-proxy.serviceAccountName" . }}
namespace: {{ include "remotedialer-proxy.namespace" . }}
roleRef:
kind: Role
name: {{ include "remotedialer-proxy.role" . }}
apiGroup: rbac.authorization.k8s.io
20 changes: 20 additions & 0 deletions charts/remotedialer-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "remotedialer-proxy.name" . }}
labels:
{{- include "remotedialer-proxy.labels" . | nindent 4 }}
namespace: {{ include "remotedialer-proxy.namespace" . }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.httpsPort }}
targetPort: https
protocol: TCP
name: https
- port: {{ .Values.service.proxyPort }}
targetPort: proxy
protocol: TCP
name: proxy
selector:
{{- include "remotedialer-proxy.selectorLabels" . | nindent 4 }}
6 changes: 6 additions & 0 deletions charts/remotedialer-proxy/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "remotedialer-proxy.serviceAccountName" . }}
namespace: {{ include "remotedialer-proxy.namespace" . }}

33 changes: 33 additions & 0 deletions charts/remotedialer-proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Default values for remotedialer-proxy.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: rancher
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
namespaceOverride: ""
roleOverride: ""
apiExtensionName: ""

serviceAccount:
name: ""

service:
type: ClusterIP
httpsPort: 8443
proxyPort: 6666
peerPort: 8888
secret: "api-extension"
caName: "api-extension-ca-name"
certCAName: "api-extension-cert-ca-name"
tlsName: "api-extension-tls-name"
certCAName: "api-extension-ca"

0 comments on commit 78723f9

Please sign in to comment.