Skip to content

Commit

Permalink
Added datatunes resources (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
spietras authored Jul 12, 2024
1 parent a4d885b commit 2db1bdb
Show file tree
Hide file tree
Showing 29 changed files with 359 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/clusters/main/databases/datatunes/datatunes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Create datatunes Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes
spec:
# Path inside repository to a directory containing Kustomization files
path: src/clusters/main/databases/datatunes/kustomize
dependsOn:
# Deploy Longhorn first
- name: longhorn
# Deploy Traefik first
- name: traefik
# Apply patches for common configurations
# This key always needs to be here for patching to work
patches:
# Set target namespace
- target:
group: kustomize.toolkit.fluxcd.io
kind: Kustomization
name: .*
patch: |
kind: .
metadata:
name: .
spec:
targetNamespace: datatunes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Create datatunes-helm Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes-helm
spec:
# Path inside repository to a directory containing Kustomization files
path: src/clusters/main/databases/datatunes/kustomize/datatunes-helm/kustomize
dependsOn:
# Deploy namespace first
- name: datatunes-namespace
# This key always needs to be here for patching to work
patches: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Configure names transformer
nameReference:
- kind: Secret
fieldSpecs:
# Replace secret names in HelmReleases
- group: helm.toolkit.fluxcd.io
kind: HelmRelease
path: spec/valuesFrom/name
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Create datatunes-helm Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Include the following configuration files
configurations:
- configurations/names.yaml
# Include the following resources
resources:
- resources/release.yaml
- resources/repository.yaml
# Generate secrets
secretGenerator:
- files:
# It's important to include extension in the key
# SOPS will use it to determine the format of the content
- values.yaml=secrets/values.yaml
name: datatunes-helm-secrets-values
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Create datatunes Helm release
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: datatunes
spec:
chart:
spec:
# Use this chart from the repository
chart: datatunes
# Pin version to major
version: "0.x"
# Use this Helm repository
sourceRef:
kind: HelmRepository
name: radio-aktywne
# This key always needs to be here for patching to work
postRenderers: []
values:
volume:
# Use ReadWriteOnce access mode
access: ReadWriteOnce
# Use Longhorn storage class
class: longhorn
# Use 4 Gigabyte volume size
size: 4Gi
valuesFrom:
- kind: Secret
name: datatunes-helm-secrets-values
valuesKey: values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create datatunes Helm repository
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: radio-aktywne
spec:
type: oci
url: oci://ghcr.io/radio-aktywne/charts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
database:
credentials:
root:
password: ENC[AES256_GCM,data:8rXE+6vSA5s=,iv:zcIWOw3Y5jza2BDEmJ0Dr4Ev2fsRKS9AvZ69wMvS7Fk=,tag:l/leA9ogHNfwFKnOJpP7rw==,type:str]
user:
password: ENC[AES256_GCM,data:HEU0Eo+a2Uw=,iv:2VJkwiCl/NDIW7M3TNxI8Omz63aN+udtIbre2+5oRA8=,tag:tc+BEAmXnlxVpaBPimYwuw==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age14uepygtepskwehywergh9fe9j2a3ytqd80y9r2ekfmett6rq3peqjtgxns
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBGY1ZoYlZvWG04Zk9ZdXh2
T0VWUk1oY0R0eEtpQnJRcWIzUXozQUlGOVRNCitxY0h5b3l6QnN2ejNZQ3Z1aXJX
aWhuNjZtYVNlTi9vV2pJOXJ3dkpZQjQKLS0tIGtJdFNOaDVtWXQ5aTd5L1diTzhw
c2RmaXczVnY0azVqWEtZTHQ5YUZFYkEK57cPtu0CelzVM9LFR/i3qUbAPt6HRAUZ
jAlPDHIQqQWeJE7x8E3CwCT3Z7LyA3fgSlt8eZ/n1OE6hNc1uWRz4Q==
-----END AGE ENCRYPTED FILE-----
- recipient: age1y5lqafxarcnlrduh8k3tycnaq63v2alagmtkf0k9gd59pg263axqtt928v
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBOalFvczJlL2xpUlVEblRD
TGlid0dzRWhxYTBUZENVQzNESGtyTmkvcVFJCmxtWDQyb2VJNUNPaEVJVzVja0RK
aEVOZ2ZsMmZTckduVGRzcHFWSUFJdjAKLS0tIFRHZ3M0dUlob0p6R0JPQlpSWG0x
cm1sN3U1VnZNNTU1NFQ2UlRmSUJiVUkKcDxNEToerq/aAa+m8Bmyg9R+UsuMXwx/
1guqoWy3m4ucGQBi7eCswg5m+rGee+FgzlQsan9EQwL8Zhh8sTwlaQ==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-07-12T19:03:43Z"
mac: ENC[AES256_GCM,data:Q/KEcs1LTT4PUrB7ew1OeObAIc+1PQ/7nIZ1J2O9PmfiZM15baFO2DfDi3LmckjdGkhecmlqaK4fyvZVydm+99BqoQTIHgPe2Crq3Pm2ZXcIGEByFxhZqJenJJyae1Q2T0skX0P51QFj64i+eLQjAFxmz/GxRyQtlAscOPHtFDA=,iv:eZIRZfShoBn5nk4G4GuV0DkYs9AvERNEUHtKd5UE2x4=,tag:WN8ML5YeKFtNykKRaw0wCw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Create datatunes-namespace Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes-namespace
spec:
# Path inside repository to a directory containing Kustomization files
path: src/clusters/main/databases/datatunes/kustomize/datatunes-namespace/kustomize
# This key always needs to be here for patching to work
patches: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Create datatunes-namespace Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Include the following resources
resources:
- resources/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Create datatunes namespace
apiVersion: v1
kind: Namespace
metadata:
name: datatunes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Create datatunes-traefik Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes-traefik
spec:
# Path inside repository to a directory containing Kustomization files
path: src/clusters/main/databases/datatunes/kustomize/datatunes-traefik/kustomize
dependsOn:
# Deploy Helm release first
- name: datatunes-helm
# This key always needs to be here for patching to work
patches: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Create datatunes-traefik Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Include the following resources
resources:
- resources/routes/http.yaml
- resources/routes/sql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Create HTTP ingress route for datatunes
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: datatunes-http
spec:
entryPoints:
# Use entrypoint for HTTPS traffic
- https
routes:
# Match traffic with the Host header
- match: HostRegexp(`datatunes\..*`)
kind: Rule
services:
# Route traffic to the datatunes service
- name: datatunes
# This is the name of the port in the service
port: http
# Use HTTPS when communicating with the service
scheme: https
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Create SQL ingress route for datatunes
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: datatunes-sql
spec:
entryPoints:
# Use entrypoint for datatunes SQL traffic
- datatunes-sql
routes:
# Match all traffic
- match: HostSNI(`*`)
services:
# Route traffic to the datatunes service
- name: datatunes
# This is the name of the port in the service
port: sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create datatunes Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Include the following resources
resources:
- datatunes-helm/datatunes-helm.yaml
- datatunes-namespace/datatunes-namespace.yaml
- datatunes-traefik/datatunes-traefik.yaml
1 change: 1 addition & 0 deletions src/clusters/main/databases/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
- datarecords/datarecords.yaml
- datashows/datashows.yaml
- datatimes/datatimes.yaml
- datatunes/datatunes.yaml
- mediatunes/mediatunes.yaml
# Apply patches for common configurations
patches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ spec:
protocol: UDP
# Port to use inside the cluster
port: 9995
# Port for datatunes SQL traffic
datatunes-sql:
# Expose it outside the cluster
expose: true
# Expose it on this port
exposedPort: 9994
# datatunes SQL traffic uses TCP
protocol: TCP
# Port to use inside the cluster
port: 9994
# Enable TLS passthrough
tls:
passthrough: true
service:
annotations:
# Use custom machine name in Tailscale
Expand Down
25 changes: 25 additions & 0 deletions tests/clusters/ci/main/databases/datatunes/datatunes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Create datatunes Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes
spec:
# Path inside repository to a directory containing Kustomization files
path: tests/clusters/ci/main/databases/datatunes/kustomize
dependsOn:
# Deploy Traefik first
- name: traefik
# Apply patches for common configurations
# This key always needs to be here for patching to work
patches:
# Set target namespace
- target:
group: kustomize.toolkit.fluxcd.io
kind: Kustomization
name: .*
patch: |
kind: .
metadata:
name: .
spec:
targetNamespace: datatunes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Create datatunes-helm Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes-helm
spec:
# Path inside repository to a directory containing Kustomization files
path: tests/clusters/ci/main/databases/datatunes/kustomize/datatunes-helm/kustomize
dependsOn:
# Deploy namespace first
- name: datatunes-namespace
# This key always needs to be here for patching to work
patches: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Create datatunes-helm Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Include the following resources
resources:
- resources/release.yaml
- resources/repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Create datatunes Helm release
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: datatunes
spec:
chart:
spec:
# Use this chart from the repository
chart: datatunes
# Pin version to major
version: "0.x"
# Use this Helm repository
sourceRef:
kind: HelmRepository
name: radio-aktywne
# This key always needs to be here for patching to work
postRenderers: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create datatunes Helm repository
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: radio-aktywne
spec:
type: oci
url: oci://ghcr.io/radio-aktywne/charts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Create datatunes-namespace Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes-namespace
spec:
# Path inside repository to a directory containing Kustomization files
path: tests/clusters/ci/main/databases/datatunes/kustomize/datatunes-namespace/kustomize
# This key always needs to be here for patching to work
patches: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Overlay datatunes-namespace Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../../../../../../src/clusters/main/databases/datatunes/kustomize/datatunes-namespace/kustomize
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Create datatunes-traefik Kustomization
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: datatunes-traefik
spec:
# Path inside repository to a directory containing Kustomization files
path: tests/clusters/ci/main/databases/datatunes/kustomize/datatunes-traefik/kustomize
dependsOn:
# Deploy Helm release first
- name: datatunes-helm
# This key always needs to be here for patching to work
patches: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Overlay datatunes-traefik Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../../../../../../src/clusters/main/databases/datatunes/kustomize/datatunes-traefik/kustomize
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create datatunes Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Include the following resources
resources:
- datatunes-helm/datatunes-helm.yaml
- datatunes-namespace/datatunes-namespace.yaml
- datatunes-traefik/datatunes-traefik.yaml
1 change: 1 addition & 0 deletions tests/clusters/ci/main/databases/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
- datarecords/datarecords.yaml
- datashows/datashows.yaml
- datatimes/datatimes.yaml
- datatunes/datatunes.yaml
- mediatunes/mediatunes.yaml
# Apply patches for common configurations
patches:
Expand Down
Loading

0 comments on commit 2db1bdb

Please sign in to comment.