Skip to content

Commit

Permalink
Merge pull request #3 from startechnica/freeradius
Browse files Browse the repository at this point in the history
Freeradius
  • Loading branch information
firmansyahn authored Feb 16, 2022
2 parents f73072e + 684b1e8 commit 29a5583
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 37 deletions.
30 changes: 30 additions & 0 deletions charts/freeradius/Chart-yaml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
annotations:
category: AccessManagement
apiVersion: v2
appVersion: 3.0.25
dependencies:
- name: mariadb
condition: mariadb.enabled
repository: https://charts.bitnami.com/bitnami
version: 10.x.x
- name: postgresql
condition: postgresql.enabled
repository: https://charts.bitnami.com/bitnami
version: 10.x.x
description: FreeRADIUS is a modular, high performance free RADIUS suite developed and
distributed under the GNU General Public License, version 2, and is free for download and use.
home: https://freeradius.org/
icon: https://freeradius.org/img/wordmark.svg
keywords:
- freeradius
- radius
- mysql
- postgresql
maintainers:
- name: Firmansyah Nainggolan
email: [email protected]
url: https://firmansyah.nainggolan.id
name: freeradius
sources:
- https://freeradius.org/
version: 0.1.2
11 changes: 1 addition & 10 deletions charts/freeradius/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ annotations:
category: AccessManagement
apiVersion: v2
appVersion: 3.0.25
dependencies:
- name: mariadb
condition: mariadb.enabled
repository: https://charts.bitnami.com/bitnami
version: 10.x.x
- name: postgresql
condition: postgresql.enabled
repository: https://charts.bitnami.com/bitnami
version: 10.x.x
description: FreeRADIUS is a modular, high performance free RADIUS suite developed and
distributed under the GNU General Public License, version 2, and is free for download and use.
home: https://freeradius.org/
Expand All @@ -27,4 +18,4 @@ maintainers:
name: freeradius
sources:
- https://freeradius.org/
version: 0.1.2
version: 0.1.3
10 changes: 3 additions & 7 deletions charts/freeradius/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,9 @@ Create the name of the service account to use
{{/*
Create the name of the SSL certificate to use
*/}}
{{- define "istioCertificateSecret2" -}}
{{- default (printf "%s-tls" (include "freeradius.fullname" .)) .Values.istio.certificate.existingSecret }}
{{- end }}

{{ define "istioCertificateSecret" }}
{{- if .Values.istio.certificate.existingSecret }}
{{ .Values.dags.persistence.existingClaim }}
{{ define "tlsSecretName" }}
{{- if .Values.tls.secretName }}
{{ .Values.tls.secretName }}
{{- else }}
{{- default (printf "%s-tls" (include "freeradius.fullname" .)) }}
{{- end }}
Expand Down
30 changes: 13 additions & 17 deletions charts/freeradius/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
{{- if and .Values.tls.enabled .Values.tls.autoGenerated .Values.tls.autoGenerator.certmanager.enabled }}
{{- if .Capabilities.APIVersions.Has "cert-manager.io/v1/Certificate" }}
{{- if and .Values.tls.enabled .Values.tls.autoGenerated }}
{{- $releaseNamespace := .Release.Namespace }}
{{- $clusterDomain := .Values.clusterDomain }}
{{- $fullname := include "freeradius.fullname" . }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Release.Name }}-cert
namespace: {{ .Values.istio.namespace }}
namespace: {{ .Release.Namespace }}
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "adminer.labels" . | nindent 4 }}
{{- include "freeradius.labels" . | nindent 4 }}
spec:
secretName: {{ include "istioCertificateSecret" . }}
secretName: {{ include "tlsSecretName" . }}
issuerRef:
group: {{ .Values.istio.certificate.issuerRef.group }}
kind: {{ .Values.istio.certificate.issuerRef.kind }}
name: {{ .Values.istio.certificate.issuerRef.name }}
group: cert-manager.io
kind: {{ .Values.tls.autoGenerator.certmanager.issuerKind }}
name: {{ .Values.tls.autoGenerator.certmanager.issuerName }}
#name: letsencrypt-prd
privateKey:
algorithm: ECDSA
rotationPolicy: Always
size: 256
subject:
countries:
- ID
organizations:
- {{ .Values.organization | quote }}
organizationalUnits:
- {{ .Release.Name | quote }}
localities:
- Asgard
provinces:
- Yggdrasil
dnsNames:
{{- if .Values.istio.hosts }}
{{- toYaml .Values.istio.hosts | nindent 4 }}
{{- $altNames := list (printf "%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "%s.%s" $fullname $releaseNamespace) $fullname }}
{{- with $altNames }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
13 changes: 12 additions & 1 deletion charts/freeradius/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ spec:
subPath: {{ .Values.persistence.subPath }}
{{- end }}
{{- end }}
{{- if and .Values.tls.enabled }}
- name: freeradius-tls
mountPath: "/etc/freeradius/certs/tls"
readOnly: true
{{- end }}
- name: freeradius-mods
mountPath: /etc/freeradius/mods-enabled/sql
subPath: sql
Expand All @@ -127,6 +132,11 @@ spec:
persistentVolumeClaim:
claimName: {{ tpl .Values.persistence.existingClaim . }}
{{- end }}
{{- if and .Values.tls.enabled }}
- name: freeradius-tls
secret:
secretName: {{ include "tlsSecretName" . }}
{{- end }}
- name: freeradius-mods
configMap:
name: freeradius-mods
Expand All @@ -144,4 +154,5 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
---
11 changes: 9 additions & 2 deletions charts/freeradius/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,22 @@ modsEnabled:
password: radius
radiusdb: radiusdb
tableClient: nas
existingTlsSecret: ""

sitesEnabled:
status:
port: 18121
secret: adminsecret

tls:
enabled: false
autoGenerated: false
enabled: true
autoGenerated: true
autoGenerator:
certmanager:
enabled: true
issuerKind: ClusterIssuer
issuerName: selfsigned-issuer
secretName: ~
existingSecret: ""

mariadb:
Expand Down

0 comments on commit 29a5583

Please sign in to comment.