Skip to content

Commit

Permalink
Split charts
Browse files Browse the repository at this point in the history
  • Loading branch information
danielscholl committed Nov 11, 2024
1 parent a4af71e commit 53eed73
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 24 deletions.
9 changes: 9 additions & 0 deletions charts/blob-upload/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: blob-upload
type: application
description: Uploads files to Azure Blob Storage
version: 0.0.3
appVersion: 0.0.1
maintainers:
- name: danielscholl
url: https://github.com/azure/osdu-developer
52 changes: 52 additions & 0 deletions charts/blob-upload/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "blob-upload.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 "blob-upload.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 "blob-upload.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
Selector labels
*/}}
{{- define "blob-upload.selectorLabels" -}}
app.kubernetes.io/name: {{ include "blob-upload.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{- if (default false .Values.blobUpload.enabled) -}}

{{/* Create resources directly for each storage account */}}
{{- $i := 0 }}
{{- range $key, $value := (lookup "v1" "ConfigMap" .Values.global.targetNamespace "configmap-services").data }}
{{- range $key, $value := (lookup "v1" "ConfigMap" .Values.global.configNamespace "configmap-services").data }}
{{- if hasPrefix "partition_storage_name_" $key }}
---
apiVersion: v1
Expand Down Expand Up @@ -86,4 +85,4 @@
{{- end }}
{{- end }}

{{- end }}{{/* end if .Values.blobUpload.enabled */}}
{{- end }}
15 changes: 15 additions & 0 deletions charts/blob-upload/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

fullnameOverride: blob-upload

################################################################################
# Specify the azure environment specific values
#
azure:
enabled: true
tenantId: <tenant_id>
clientId: <managed_identity_clientid>
keyvaultName: <keyvault_name>

blobUpload:
enabled: false
container: "legal-service-azure-configuration"
17 changes: 0 additions & 17 deletions charts/osdu-developer-base/values.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# Copyright © Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default values for osdu-azure.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

fullnameOverride: osdu-svc

Expand Down
37 changes: 33 additions & 4 deletions software/applications/osdu-core/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ spec:
name: config-map-values
valuesKey: values.yaml
values:
global:
targetNamespace: osdu-core
enableRequestAuthentication: true
azure:
enabled: true
Expand All @@ -34,10 +32,41 @@ spec:
defaultMemoryRequests: "1Gi"
defaultCpuLimits: "2"
defaultMemoryLimits: "4Gi"
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: blob-upload
namespace: default
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-developer-base-core
namespace: default
targetNamespace: osdu-core
chart:
spec:
chart: ./charts/blob-upload
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
interval: 5m0s
install:
remediation:
retries: 3
valuesFrom:
- kind: ConfigMap
name: config-map-values
valuesKey: values.yaml
values:
global:
configmapNamespace: osdu-core
azure:
enabled: true
blobUpload:
enabled: true
storageAccounts:
- "partition_storage_name_0"
items:
- name: legal
file: "Legal_COO.json"
Expand Down

0 comments on commit 53eed73

Please sign in to comment.