Commit 991f217f authored by Aman Verma's avatar Aman Verma Committed by Vivek Ojha
Browse files

Adding helm charts for schema data load

parent bb75174a
# 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.
apiVersion: v1
name: schema-data-init
description: A data initialization agent for schema service for OSDU on Azure.
type: application
version: 0.12.0
appVersion: 1.10.0
\ No newline at end of file
# Helm Chart for OSDU on Azure Data Initialization Agent
## Helm Chart Values
Either manually modify the values.yaml file or generate a custom_values yaml to use.
_The following commands can help generate a pre-populated custom_values file._
```bash
# Setup Variables
UNIQUE="<your_osdu_unique>" # e.g. demo
OSDU_HOST="<your_osdu_fqdn>" # e.g. osdu-$UNIQUE.contoso.com
IMAGE_VERSION="<your-release-version>" # e.g. 0.12.0
# This logs your local Azure CLI in using the configured service principal.
az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID
GROUP=$(az group list --query "[?contains(name, 'cr${UNIQUE}')].name" -otsv)
ENV_VAULT=$(az keyvault list --resource-group $GROUP --query [].name -otsv)
# Translate Values File
cat > ./schema_data_init_custom_values.yaml << EOF
# This file contains the essential configs for the Azure Data Initialization Agent
################################################################################
# Specify the azure environment specific values
#
azure:
tenant_id: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/tenant-id --query value -otsv)
resource_id: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/aad-client-id --query value -otsv)
client_id: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/app-dev-sp-username --query value -otsv)
client_secret: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/app-dev-sp-password --query value -otsv)
ingress:
dns: $OSDU_HOST
image:
repository: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/container-registry --query value -otsv).azurecr.io
tag: ${IMAGE_VERSION}
EOF
```
__Helm Chart Install__
Create a Namespace and install the helm chart for OSDU on Azure.
```bash
# Create Namespace
NAMESPACE=data-initialization
kubectl create namespace $NAMESPACE
# Install Charts
# Make sure current location is /helm-charts-azure/osdu-azure/osdu-data-initialization/schema-data-initialization
helm install schema-data-init . -n $NAMESPACE -f ./schema_data_init_custom_values.yaml
```
\ No newline at end of file
{{- $namespace := .Release.Namespace }}
apiVersion: batch/v1
kind: Job
metadata:
name: "schema-data-initialization-job"
namespace: {{ $namespace }}
labels:
app: "schema-data-initialization-job"
spec:
completions: 1
parallelism: 1
backoffLimit: 5
template:
metadata:
labels:
app: {{ .Chart.Name }}
aadpodidbinding: osdu-identity
spec:
restartPolicy: OnFailure
containers:
- image: {{ .Values.image.repository }}/schema-data-init:{{ .Values.image.tag | default .Chart.Version }}
imagePullPolicy: Always
name: "schema-data-init"
env:
- name: AZURE_DNS_NAME
value: {{ .Values.ingress.dns }}
- name: AZURE_TENANT_ID
value: {{ .Values.azure.tenant_id }}
- name: AZURE_AD_APP_RESOURCE_ID
value: {{ .Values.azure.resource_id }}
- name: AZURE_CLIENT_ID
value: {{ .Values.azure.client_id }}
- name: AZURE_CLIENT_SECRET
value: {{ .Values.azure.client_secret }}
\ No newline at end of file
# This file contains the essential configs for the Azure Data Initialization Agent
################################################################################
# Specify the azure environment specific values
#
azure:
tenant_id: <azure_tenant_id>
resource_id: <azure_app_resource_id>
client_id: <azure_client_id>
client_secret: <azure_client_secret>
ingress:
dns: <ingress_dns>
image:
repository: msosdu.azurecr.io
tag: <image_tag>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment