diff --git a/devops/azure/charts/Chart.yaml b/devops/azure/charts/Chart.yaml index 7a9d162b9b3ab6d43d5e68da038cd8a979fdb237..b97f4bd25c073c08c9473665708fab5c72301ea1 100644 --- a/devops/azure/charts/Chart.yaml +++ b/devops/azure/charts/Chart.yaml @@ -1,6 +1,36 @@ +# 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: v2 name: crs-conversion-service -appVersion: "latest" -description: Helm Chart for installing crs-conversion-service service. -version: 0.1.0 +description: A Helm chart for installing crs-conversion-service on Azure + +# 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.1.0 + +# 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. +appVersion: "latest" \ No newline at end of file diff --git a/devops/azure/charts/templates/deployment.yaml b/devops/azure/charts/templates/deployment.yaml index 88671c99c4c2745fd38238beef457c1b6b46600c..05cda873a81deaa2ac7d3584c2444ba4bc391544 100644 --- a/devops/azure/charts/templates/deployment.yaml +++ b/devops/azure/charts/templates/deployment.yaml @@ -1,80 +1,114 @@ +# 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: apps/v1 kind: Deployment metadata: - name: {{ .Release.Name }} namespace: osdu + name: {{ include "azure-crs-converter.fullname" . }} + labels: + resource: "crsDeployment" + app: {{ .Chart.Name }} + appversion: {{ .Chart.Version }} spec: +{{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.global.replicaCount }} +{{- end }} selector: matchLabels: app: {{ .Chart.Name }} + appversion: {{ .Chart.Version }} template: metadata: labels: app: {{ .Chart.Name }} + appversion: {{ .Chart.Version }} aadpodidbinding: osdu-identity spec: volumes: - - name: azure-keyvault - csi: - driver: secrets-store.csi.k8s.io - readOnly: true - volumeAttributes: - secretProviderClass: azure-keyvault - containers: - - name: {{ .Chart.Name }} - image: {{ .Values.image.repository }}/{{ .Chart.Name }}-{{ .Values.image.branch }}:{{ .Values.image.tag | default .Chart.AppVersion }} - imagePullPolicy: Always - ports: - - containerPort: 8080 - readinessProbe: - httpGet: - path: /api/crs/converter/swagger-ui.html - port: 8080 - volumeMounts: - name: azure-keyvault - mountPath: "/mnt/azure-keyvault" - readOnly: true - env: - - name: spring_application_name - value: crs-conversion-service - - name: server.servlet.contextPath - value: /api/crs/converter/ - - name: server_port - value: "8080" - - name: ACCEPT_HTTP # TEMPORARY UNTIL HTTPS - value: "true" - - name: KEYVAULT_URI - valueFrom: - configMapKeyRef: - name: osdu-svc-properties - key: ENV_KEYVAULT - - name: AZURE_TENANT_ID - valueFrom: - secretKeyRef: - name: active-directory - key: tenantid - - name: AZURE_CLIENT_ID - valueFrom: - secretKeyRef: - name: active-directory - key: principal-clientid - - name: AZURE_CLIENT_SECRET - valueFrom: - secretKeyRef: - name: active-directory - key: principal-clientpassword - - name: appinsights_key - valueFrom: - secretKeyRef: - name: central-logging - key: appinsights - - name: aad_client_id - valueFrom: - secretKeyRef: - name: active-directory - key: application-appid - - name: ENTITLEMENT_URL - value: http://entitlements-azure/entitlements/v1 - - name: azure_istioauth_enabled - value: "true" + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: azure-keyvault + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}/{{ .Chart.Name }}-{{ .Values.image.branch }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.application.port }} + protocol: TCP + readinessProbe: + httpGet: + path: /api/crs/converter/swagger-ui.html + port: {{ .Values.application.port }} + initialDelaySeconds: 30 + timeoutSeconds: 15 + periodSeconds: 2 + successThreshold: 1 + failureThreshold: 5 + volumeMounts: + - name: azure-keyvault + mountPath: "/mnt/azure-keyvault" + readOnly: true + env: + - name: spring_application_name + value: crs-conversion-service + - name: server.servlet.contextPath + value: /api/crs/converter/ + - name: server_port + value: "8080" + - name: ACCEPT_HTTP # TEMPORARY UNTIL HTTPS + value: "true" + - name: KEYVAULT_URI + valueFrom: + configMapKeyRef: + name: osdu-svc-properties + key: ENV_KEYVAULT + - name: AZURE_TENANT_ID + valueFrom: + secretKeyRef: + name: active-directory + key: tenantid + - name: AZURE_CLIENT_ID + valueFrom: + secretKeyRef: + name: active-directory + key: principal-clientid + - name: AZURE_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: active-directory + key: principal-clientpassword + - name: appinsights_key + valueFrom: + secretKeyRef: + name: central-logging + key: appinsights + - name: aad_client_id + valueFrom: + secretKeyRef: + name: active-directory + key: application-appid + - name: ENTITLEMENT_URL + value: http://entitlements-azure/entitlements/v1 + - name: azure_istioauth_enabled + value: "true" + - name: ESRI_DATA_PATH + value: \crs-conversion-service + - name: cosmosdb_database + value: osdu-db + - name: service_domain_name + value: contoso.com diff --git a/devops/azure/charts/templates/service.yaml b/devops/azure/charts/templates/service.yaml index a0134bfb4f157206791df4312d89a76ca03339da..7e8ba6333396b5785a4f5344ee5f4f19620ac126 100644 --- a/devops/azure/charts/templates/service.yaml +++ b/devops/azure/charts/templates/service.yaml @@ -1,13 +1,32 @@ +# 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 kind: Service metadata: - name: {{ .Chart.Name }} + name: {{ include "azure-crs-converter.fullname" . }} namespace: osdu + labels: + resource: "crsService" + app: {{ .Chart.Name }} + appversion: {{ .Chart.Version }} spec: - type: ClusterIP + type: {{ .Values.service.type }} ports: - - protocol: TCP - port: 80 - targetPort: 8080 + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetport }} + protocol: TCP + name: http selector: app: {{ .Chart.Name }} + appversion: {{ .Chart.Version }} diff --git a/devops/azure/charts/values.yaml b/devops/azure/charts/values.yaml index 07a4f3948e1ba2fe5d5bb5877061fe7a96188a18..bb51c8c5879924fe9e76c13ff0d952ec7ff20b7c 100644 --- a/devops/azure/charts/values.yaml +++ b/devops/azure/charts/values.yaml @@ -1,7 +1,34 @@ +# 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. + global: replicaCount: 1 image: - repository: ${CONTAINER_REGISTRY_NAME}.azurecr.io/crs-conversion-app - tag: latest + repository: community.opengroup.org:5555/osdu/platform/system/reference/crs-conversion-service pullPolicy: Always + branch: master + tag: latest +service: + type: ClusterIP + port: 80 + targetport: 8080 +application: + port: 8080 +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80