From 10b7936b5285712e873df41381f72c335327fe63 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 4 Jul 2022 22:38:39 +0530 Subject: [PATCH 01/44] helm charts added --- .../ibm/ibm-crs-conversion-config/.helmignore | 23 +++++ .../ibm/ibm-crs-conversion-config/Chart.yaml | 24 +++++ .../templates/_helpers.tpl | 62 ++++++++++++ .../templates/configmap.yaml | 37 ++++++++ .../ibm/ibm-crs-conversion-config/values.yaml | 49 ++++++++++ .../ibm/ibm-crs-conversion-deploy/.helmignore | 23 +++++ .../ibm/ibm-crs-conversion-deploy/Chart.yaml | 24 +++++ .../templates/NOTES.txt | 22 +++++ .../templates/_helpers.tpl | 62 ++++++++++++ .../templates/deployment.yaml | 81 ++++++++++++++++ .../templates/hpa.yaml | 28 ++++++ .../templates/ingress.yaml | 61 ++++++++++++ .../templates/pvc.yaml | 14 +++ .../templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 56 +++++++++++ .../ibm/ibm-crs-conversion-deploy/values.yaml | 94 +++++++++++++++++++ 16 files changed, 675 insertions(+) create mode 100644 devops/ibm/ibm-crs-conversion-config/.helmignore create mode 100644 devops/ibm/ibm-crs-conversion-config/Chart.yaml create mode 100644 devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl create mode 100644 devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml create mode 100644 devops/ibm/ibm-crs-conversion-config/values.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/.helmignore create mode 100644 devops/ibm/ibm-crs-conversion-deploy/Chart.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/values.yaml diff --git a/devops/ibm/ibm-crs-conversion-config/.helmignore b/devops/ibm/ibm-crs-conversion-config/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/devops/ibm/ibm-crs-conversion-config/Chart.yaml b/devops/ibm/ibm-crs-conversion-config/Chart.yaml new file mode 100644 index 0000000..2f414ba --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: ibm-crs-conversion-config +description: A Helm chart for Kubernetes + +# 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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl b/devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl new file mode 100644 index 0000000..a22fe81 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ibm-crs-conversion-config.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 "ibm-crs-conversion-config.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 "ibm-crs-conversion-config.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ibm-crs-conversion-config.labels" -}} +helm.sh/chart: {{ include "ibm-crs-conversion-config.chart" . }} +{{ include "ibm-crs-conversion-config.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ibm-crs-conversion-config.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ibm-crs-conversion-config.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ibm-crs-conversion-config.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ibm-crs-conversion-config.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml new file mode 100644 index 0000000..797bef7 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ .Values.conf.configmap }}" +data: +#log-and-common + LOG_LEVEL: "{{ .Values.data.logLevel }}" + LOG_PREFIX: "{{ .Values.data.logPrefix }}" + logging.level.org.opengroup.osdu: "{{ .Values.data.loggingLevelOsdu }}" + logging.level.org.springframework.web: "{{ .Values.data.loggingLevelSpring }}" + JAVA_APP_JAR: "{{ .Values.data.javaAppJar }}" + server.servlet.context-path: "{{ .Values.data.contextPath }}" + server.port: "{{ .Values.data.serverPort }}" + spring.main.allow-bean-definition-overriding: "{{ .Values.data.beanDefOverriding }}" + + cache.expiration: "{{ .Values.data.cacheExpiration }}" + cache.maxSize: "{{ .Values.data.cahceMaxSize }}" + ibm.health-check-uri: "{{ .Values.data.healthCheckUri }}" + +#Authorization + osdu.entitlement.url: "http://{{ .Release.Name }}-ibm-entitlement-deploy:8080/api/entitlements/v2" + +#tenant-validation + PARTITION_API: "http://{{ .Release.Name }}-ibm-partition-deploy:8080/api/partition/v1" + partition.keycloak.client_id: "{{ .Values.data.pKCClientId }}" + partition.keycloak.client_secert: "{{ .Values.data.pKCClientSecret }}" + partition.keycloak.grant_type: "{{ .Values.data.grantType }}" + partition.keycloak.password: "{{ .Values.data.pKCPassword }}" + partition.keycloak.realm: "{{ .Values.data.keycloakRealm }}" + partition.keycloak.url: "{{ .Values.data.pKCEndPointHost }}" + partition.keycloak.user: "{{ .Values.data.pKCUser }}" + partition.keycloak.accept_http: "{{ .Values.data.pKAcceptHttp }}" + tenantCache.exp.time.in.second: "{{ .Values.data.tenantCacheExpiryInSec }}" + +#props-core + CRS_API: "http://{{ .Release.Name }}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2" + SIS_DATA: /home/jboss/data/SIS_DATA diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml new file mode 100644 index 0000000..223677f --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -0,0 +1,49 @@ +data: +# common + javaAppJar: "/deployments/*-spring-boot.jar" + serverPort: 8080 + contextPath: "/api/schema-service/v1" + +# log + logPrefix: schema + loggingLevelOsdu: debug + loggingLevelSpring: debug + +# ibm + beanDefOverriding: true + healthCheckUri: "/api/schema-service/v1/info" + +#authorization + #check cm template + authorizeAPI: http://TBD:8080/api/entitlements/v2 + deployEnv: CLOUD + +#db + #dbURL-refer-configmap-template + dbURL: http://tbd:5984 + #get-from-existing secret + dbUser: admin + envPrefix: ibm-iks + #get-from-existing secret + dbPassw: tbd + +#minio + accessKey: tbd + secretKey: tbd + +#tenant-validation + pKCEndPointHost: referenv + keycloakRealm: OSDU + pKCClientId: partition-service + pKCClientSecret: referenv + grantType: password + pKCPassword: changeit + pKCUser: partition-service-admin + pKAcceptHttp: true + tenantCacheExpiryInSec: 10000 + #refer-cm-template + patitionAPI: refer-configmap-template + + +conf: + configmap: "crs-conversion-config" diff --git a/devops/ibm/ibm-crs-conversion-deploy/.helmignore b/devops/ibm/ibm-crs-conversion-deploy/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/devops/ibm/ibm-crs-conversion-deploy/Chart.yaml b/devops/ibm/ibm-crs-conversion-deploy/Chart.yaml new file mode 100644 index 0000000..dedf255 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: ibm-crs-conversion-deploy +description: A Helm chart for Kubernetes + +# 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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt b/devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt new file mode 100644 index 0000000..d7cd957 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ibm-crs-conversion-deploy.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "ibm-crs-conversion-deploy.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ibm-crs-conversion-deploy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "ibm-crs-conversion-deploy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl b/devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl new file mode 100644 index 0000000..7b1007b --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ibm-crs-conversion-deploy.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 "ibm-crs-conversion-deploy.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 "ibm-crs-conversion-deploy.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ibm-crs-conversion-deploy.labels" -}} +helm.sh/chart: {{ include "ibm-crs-conversion-deploy.chart" . }} +{{ include "ibm-crs-conversion-deploy.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ibm-crs-conversion-deploy.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ibm-crs-conversion-deploy.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ibm-crs-conversion-deploy.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ibm-crs-conversion-deploy.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml new file mode 100644 index 0000000..288083a --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{ include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 8 }} + sidecar.istio.io/inject: "{{ .Values.sidecarIstioInjected }}" + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: sis-data + persistentVolumeClaim: + claimName: sis-data + initContainers: + - resources: {} + terminationMessagePath: /dev/termination-log + name: init-myservice + command: + - sh + - '-c' + - 'id; chown 185:185 /home/jboss/data;' + securityContext: {} + imagePullPolicy: Always + volumeMounts: + - name: sis-data + mountPath: /home/jboss/data + terminationMessagePolicy: File + image: busybox:stable + terminationMessagePath: /dev/termination-log + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - configMapRef: + name: crs-conversion-config + volumeMounts: + - name: sis-data + mountPath: /home/jboss/data + ports: + - name: http + containerPort: 8080 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml new file mode 100644 index 0000000..7ffce34 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml new file mode 100644 index 0000000..28f9199 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "ibm-crs-conversion-deploy.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml new file mode 100644 index 0000000..5543746 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -0,0 +1,14 @@ +kind: PersistentVolumeClaim +apiVersion : v1 +metadata: + name: sis-data + namespace: {{ .Release.Namespace }} + finalizers: + - kubernetes.io/pvc-protection +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 20Gi + storageClassName: {{ .Values.storage_class.file_storage }} \ No newline at end of file diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml new file mode 100644 index 0000000..6387ed6 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 4 }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml new file mode 100644 index 0000000..5688545 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml @@ -0,0 +1,56 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-40" +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-40" +rules: + - apiGroups: + - "config.openshift.io" + - "security.istio.io" + - "networking.istio.io" + - "" + resources: + - "secrets" + - "configmaps" + - "services" + - "requestauthentications" + - "envoyfilters" + verbs: + - "list" + - "get" + - "patch" +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-40" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} +subjects: +- kind: ServiceAccount + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml new file mode 100644 index 0000000..81b7d61 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -0,0 +1,94 @@ +# Default values for ibm-crs-conversion-deploy. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 +sidecarIstioInjected: "true" +image: + repository: community.opengroup.org:5555/osdu/platform/system/reference/crs-conversion-service/os-crs-conversion-ibm + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "release-0.14-apr22" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" +initimage: + name: dependency-check + initrepository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/k8s-healthprobe + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "v2.0" +conf: + configmap: "crs-conversion-config" + appName: "crs-conversion" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +storage_class: + file_storage: ibmc-file-gold + +nodeSelector: {} + +tolerations: [] + +affinity: {} -- GitLab From c52d7ea70a86d05e505299038db6b3e89ed090bc Mon Sep 17 00:00:00 2001 From: sukumar c Date: Tue, 5 Jul 2022 13:32:07 +0530 Subject: [PATCH 02/44] Updated port --- .../ibm/ibm-crs-conversion-config/values.yaml | 17 ++--------------- .../ibm/ibm-crs-conversion-deploy/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml index 223677f..07604ab 100644 --- a/devops/ibm/ibm-crs-conversion-config/values.yaml +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -2,7 +2,7 @@ data: # common javaAppJar: "/deployments/*-spring-boot.jar" serverPort: 8080 - contextPath: "/api/schema-service/v1" + contextPath: "/api/crs/converter/v2" # log logPrefix: schema @@ -11,25 +11,12 @@ data: # ibm beanDefOverriding: true - healthCheckUri: "/api/schema-service/v1/info" + healthCheckUri: "/api/crs/converter/v2/info" #authorization #check cm template authorizeAPI: http://TBD:8080/api/entitlements/v2 deployEnv: CLOUD - -#db - #dbURL-refer-configmap-template - dbURL: http://tbd:5984 - #get-from-existing secret - dbUser: admin - envPrefix: ibm-iks - #get-from-existing secret - dbPassw: tbd - -#minio - accessKey: tbd - secretKey: tbd #tenant-validation pKCEndPointHost: referenv diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index 81b7d61..2fbe667 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -47,7 +47,7 @@ securityContext: {} service: type: ClusterIP - port: 80 + port: 8080 ingress: enabled: false @@ -84,7 +84,7 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -storage_class: +storageclass: file_storage: ibmc-file-gold nodeSelector: {} -- GitLab From 27dbe03f0aaa1892092d89fdf245d047236b290f Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 6 Jul 2022 23:06:13 +0530 Subject: [PATCH 03/44] Updated resources --- devops/ibm/ibm-crs-conversion-config/values.yaml | 2 +- .../ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml index 07604ab..660d5da 100644 --- a/devops/ibm/ibm-crs-conversion-config/values.yaml +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -2,7 +2,7 @@ data: # common javaAppJar: "/deployments/*-spring-boot.jar" serverPort: 8080 - contextPath: "/api/crs/converter/v2" + contextPath: "/api/crs/converter" # log logPrefix: schema diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml index 5688545..e8037d2 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml @@ -27,6 +27,7 @@ rules: - "" resources: - "secrets" + - "pods" - "configmaps" - "services" - "requestauthentications" -- GitLab From 6fd91c9996ba5fb83f6dfdb662106a5cb1916ade Mon Sep 17 00:00:00 2001 From: sukumar c Date: Fri, 8 Jul 2022 16:53:54 +0530 Subject: [PATCH 04/44] Updated CRS Post Script --- .../files/crs-conversion_post.sh | 12 ++++++ .../templates/configmap.yaml | 10 +++++ .../templates/job.yaml | 43 +++++++++++++++++++ .../templates/pvc.yaml | 2 +- .../templates/serviceaccount.yaml | 2 + .../ibm/ibm-crs-conversion-deploy/values.yaml | 6 +++ 6 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml diff --git a/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh new file mode 100644 index 0000000..d4a87d7 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +CRS_CONVERSION_URL=http://${RELEASE_NAME}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info +echo ${CRS_CONVERSION_URL} +while [[ "$(curl -s -k -L -o /dev/null -w ''%{http_code}'' http://osdu-deploy-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info)" != "200" ]]; do sleep 5; done +echo "CRS Conversion is ready" +echo ${RELEASE_NAMESPACE} +echo ${RELEASE_NAME} +crs_conversion_pod_name=$(oc get pods -o=name -n ${RELEASE_NAMESPACE} | grep 'crs-conversion-deploy' | sed "s/^.\{4\}//") +echo $crs_conversion_pod_name +oc rsync /data/crs-conversion-service/apachesis_setup $crs_conversion_pod_name:/home/jboss/data/ -n ${RELEASE_NAMESPACE} + diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml new file mode 100644 index 0000000..d7c54fb --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +data: + crs-conversion_post.sh: | + {{- tpl (.Files.Get "files/crs-conversion_post.sh" ) . | nindent 4 }} \ No newline at end of file diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml new file mode 100644 index 0000000..3064727 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml @@ -0,0 +1,43 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: crs-setup-job + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }}-setup-job + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + activeDeadlineSeconds: 600 + containers: + - image: {{ .Values.jobimage.repository }}:{{ .Values.jobimage.tag }} + env: + - name: RELEASE_NAME + value: {{ .Release.Name }} + - name: RELEASE_NAMESPACE + value: {{ .Release.Namespace }} + command: ['sh', '-c', './scripts/crs-conversion_post.sh'] + imagePullPolicy: Always + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + volumeMounts: + - mountPath: "/scripts" + name: projected-scripts + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + serviceAccountName: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + terminationGracePeriodSeconds: 30 + volumes: + - + name: projected-scripts + projected: + defaultMode: 0755 + sources: + - configMap: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + serviceAccountName: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + terminationGracePeriodSeconds: 30 diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 5543746..60f1d59 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -11,4 +11,4 @@ spec: resources: requests: storage: 20Gi - storageClassName: {{ .Values.storage_class.file_storage }} \ No newline at end of file + storageClassName: {{ .Values.storageclass.file_storage }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml index e8037d2..37405d7 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml @@ -27,6 +27,7 @@ rules: - "" resources: - "secrets" + - "pods/exec" - "pods" - "configmaps" - "services" @@ -36,6 +37,7 @@ rules: - "list" - "get" - "patch" + - "create" --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index 2fbe667..0f247ac 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -87,6 +87,12 @@ autoscaling: storageclass: file_storage: ibmc-file-gold +jobimage: + repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/crs-data + pullPolicy: Always +# Overrides the image tag whose default is the chart appVersion. + tag: "v6.0" + nodeSelector: {} tolerations: [] -- GitLab From 11499d3cd561f733bdc196ce0ef1296d634ae798 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Sun, 10 Jul 2022 11:52:38 +0530 Subject: [PATCH 05/44] Removed redundant keys --- .../templates/configmap.yaml | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml index 797bef7..9a7e42a 100644 --- a/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml +++ b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml @@ -11,27 +11,8 @@ data: JAVA_APP_JAR: "{{ .Values.data.javaAppJar }}" server.servlet.context-path: "{{ .Values.data.contextPath }}" server.port: "{{ .Values.data.serverPort }}" - spring.main.allow-bean-definition-overriding: "{{ .Values.data.beanDefOverriding }}" - - cache.expiration: "{{ .Values.data.cacheExpiration }}" - cache.maxSize: "{{ .Values.data.cahceMaxSize }}" - ibm.health-check-uri: "{{ .Values.data.healthCheckUri }}" + spring.main.allow-bean-definition-overriding: "{{ .Values.data.beanDefOverriding }}" #Authorization osdu.entitlement.url: "http://{{ .Release.Name }}-ibm-entitlement-deploy:8080/api/entitlements/v2" - -#tenant-validation - PARTITION_API: "http://{{ .Release.Name }}-ibm-partition-deploy:8080/api/partition/v1" - partition.keycloak.client_id: "{{ .Values.data.pKCClientId }}" - partition.keycloak.client_secert: "{{ .Values.data.pKCClientSecret }}" - partition.keycloak.grant_type: "{{ .Values.data.grantType }}" - partition.keycloak.password: "{{ .Values.data.pKCPassword }}" - partition.keycloak.realm: "{{ .Values.data.keycloakRealm }}" - partition.keycloak.url: "{{ .Values.data.pKCEndPointHost }}" - partition.keycloak.user: "{{ .Values.data.pKCUser }}" - partition.keycloak.accept_http: "{{ .Values.data.pKAcceptHttp }}" - tenantCache.exp.time.in.second: "{{ .Values.data.tenantCacheExpiryInSec }}" - -#props-core - CRS_API: "http://{{ .Release.Name }}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2" SIS_DATA: /home/jboss/data/SIS_DATA -- GitLab From b022c2a502caddb6e2c5183bb287545c40ea3749 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Sun, 10 Jul 2022 12:04:29 +0530 Subject: [PATCH 06/44] Removed redundant keys --- .../ibm/ibm-crs-conversion-config/values.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml index 660d5da..e1629a4 100644 --- a/devops/ibm/ibm-crs-conversion-config/values.yaml +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -13,24 +13,5 @@ data: beanDefOverriding: true healthCheckUri: "/api/crs/converter/v2/info" -#authorization - #check cm template - authorizeAPI: http://TBD:8080/api/entitlements/v2 - deployEnv: CLOUD - -#tenant-validation - pKCEndPointHost: referenv - keycloakRealm: OSDU - pKCClientId: partition-service - pKCClientSecret: referenv - grantType: password - pKCPassword: changeit - pKCUser: partition-service-admin - pKAcceptHttp: true - tenantCacheExpiryInSec: 10000 - #refer-cm-template - patitionAPI: refer-configmap-template - - conf: configmap: "crs-conversion-config" -- GitLab From 7a4497e0a55815481f187670c8a9b1942110a03f Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 11 Jul 2022 13:16:57 +0530 Subject: [PATCH 07/44] updated ref --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f618f6f..7e3a915 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,7 @@ include: - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/ibm-python-test.yml" + ref: ibm-helm-charts - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/osdu-gcp-global.yml" -- GitLab From b4e79cbd47c81c0471e90cc07237fbc87da40826 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 11 Jul 2022 13:56:33 +0530 Subject: [PATCH 08/44] Updated variable --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e3a915..66c6142 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,8 @@ variables: IBM_BUILD_SUBDIR: provider/crs-converter-ibm/crs-converter-ocp IBM_INT_TEST_PY_SUBDIR: testing/crs_converter_test_ibm IBM_INT_TEST_PY_FILE: run_test.py + IBM_HELM_CONFIG_PATH: devops/ibm/ibm-crs-conversion-config + IBM_HELM_DEPLOY_PATH: devops/ibm/ibm-crs-conversion-deploy include: - project: "osdu/platform/ci-cd-pipelines" -- GitLab From 7f1129c025dfc01a0ebfa4a56aaf7cda787a4145 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 11 Jul 2022 14:43:14 +0530 Subject: [PATCH 09/44] Updated the script --- .../ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh index d4a87d7..b35b012 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh +++ b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh @@ -2,7 +2,7 @@ CRS_CONVERSION_URL=http://${RELEASE_NAME}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info echo ${CRS_CONVERSION_URL} -while [[ "$(curl -s -k -L -o /dev/null -w ''%{http_code}'' http://osdu-deploy-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info)" != "200" ]]; do sleep 5; done +while [[ "$(curl -s -k -L -o /dev/null -w ''%{http_code}'' http://${RELEASE_NAME}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info)" != "200" ]]; do sleep 5; done echo "CRS Conversion is ready" echo ${RELEASE_NAMESPACE} echo ${RELEASE_NAME} -- GitLab From 0ef9e33b26c42dbf5a9bf7d101c04b3c11a1ae9f Mon Sep 17 00:00:00 2001 From: sukumar c Date: Tue, 12 Jul 2022 10:53:47 +0530 Subject: [PATCH 10/44] Updated storage value --- devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 60f1d59..2c5a493 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -10,5 +10,5 @@ spec: - ReadWriteMany resources: requests: - storage: 20Gi + storage: 1Gi storageClassName: {{ .Values.storageclass.file_storage }} -- GitLab From bb81e25edcb84acf6d82be1241a1d69515bb2ea5 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 13 Jul 2022 13:38:14 +0530 Subject: [PATCH 11/44] Updated the storage --- devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 2c5a493..f8dd804 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -10,5 +10,5 @@ spec: - ReadWriteMany resources: requests: - storage: 1Gi + storage: 5Gi storageClassName: {{ .Values.storageclass.file_storage }} -- GitLab From d213e886c2c0b7dfd3fbae4e2701d2b4b14aa73c Mon Sep 17 00:00:00 2001 From: sukumar c Date: Thu, 14 Jul 2022 16:37:27 +0530 Subject: [PATCH 12/44] Updated PV resource --- .../templates/pv.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml new file mode 100644 index 0000000..41200b4 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -0,0 +1,19 @@ +{{- if .Values.persistentvolume.enabled -}} +... +apiVersion: v1 +kind: PersistentVolume +metadata: + name: sis-pv +spec: + capacity: + storage: 5Gi + volumeMode: Filesystem + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: {{ .Values.storageclass.file_storage }} + csi: + driver: efs.csi.aws.com + volumeHandle: $FileSystemID +... +{{- end }} \ No newline at end of file -- GitLab From 68608bbe792e6e418822b036473e2d043ed3d3c9 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Thu, 14 Jul 2022 16:37:58 +0530 Subject: [PATCH 13/44] Updated PV resource --- devops/ibm/ibm-crs-conversion-deploy/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index 0f247ac..bb18697 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -87,6 +87,8 @@ autoscaling: storageclass: file_storage: ibmc-file-gold +persistentvolume: + enabled: false jobimage: repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/crs-data pullPolicy: Always -- GitLab From 15482b60f3fb991aa288330f19b30b918d34f4e1 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 18 Jul 2022 16:22:09 +0530 Subject: [PATCH 14/44] Enabled PV resource --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 6 ++---- devops/ibm/ibm-crs-conversion-deploy/values.yaml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 41200b4..ee98838 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -1,5 +1,4 @@ -{{- if .Values.persistentvolume.enabled -}} -... +{{ if .Values.persistentvolume.enabled }} apiVersion: v1 kind: PersistentVolume metadata: @@ -15,5 +14,4 @@ spec: csi: driver: efs.csi.aws.com volumeHandle: $FileSystemID -... -{{- end }} \ No newline at end of file +{{ end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index bb18697..c8c6ca0 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -88,7 +88,7 @@ storageclass: file_storage: ibmc-file-gold persistentvolume: - enabled: false + enabled: true jobimage: repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/crs-data pullPolicy: Always -- GitLab From 5bc0c2c863679e67e813353ac6a0290344250481 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 18 Jul 2022 19:51:44 +0530 Subject: [PATCH 15/44] Updated volumeHandle value --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index ee98838..89dae87 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -13,5 +13,5 @@ spec: storageClassName: {{ .Values.storageclass.file_storage }} csi: driver: efs.csi.aws.com - volumeHandle: $FileSystemID + volumeHandle: fs-0ea287aa1e373023e {{ end }} -- GitLab From b1cbcb451227566b01a0d31b05c76c60557fc89c Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 20 Jul 2022 18:59:40 +0530 Subject: [PATCH 16/44] Updated virtualservice manifest --- .../templates/istio-authzpolicy.yaml | 22 ++++++++++++++++ .../templates/istio-virtualservice.yaml | 25 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml new file mode 100644 index 0000000..651dcd8 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml @@ -0,0 +1,22 @@ +apiVersion: security.istio.io/v1beta1 +kind: AuthorizationPolicy +metadata: + name: {{ .Values.conf.appName }}-authz-policy +spec: + selector: + matchLabels: + {{- include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 6 }} + action: DENY + rules: + - from: + - source: + notRequestPrincipals: + - '*' + to: + - operation: + notPaths: + - '*/v2/api-docs' + - /api/crs/converter/v2/info + - /api/crs/converter/v3/info + - /api/crs/converter/_ah/liveness_check + - /api/crs/converter/_ah/readiness_check \ No newline at end of file diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml new file mode 100644 index 0000000..6de56f3 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml @@ -0,0 +1,25 @@ +kind: VirtualService +metadata: + name: {{ .Values.conf.appName }}-vs +spec: + gateways: + - osdu-gateway + hosts: + {{- if .Values.conf.domain }} + - {{ printf "osdu.%s" .Values.conf.domain | quote }} + {{- else if .Values.conf.loadbalancerIP}} + - {{ (index (lookup "v1" "Service" "istio-ingress" "istio-ingress").status.loadBalancer.ingress 0).ip }} + {{- else if .Values.conf.loadbalancerHN}} + - {{ (index (lookup "v1" "Service" "istio-ingress" "istio-ingress").status.loadBalancer.ingress 0).hostname }} + {{- else }} + - "*" + {{- end }} + http: + - match: + - uri: + prefix: /api/crs/converter/ + route: + - destination: + host: {{ .Release.Name }}-ibm-crs-conversion-deploy + port: + number: 8080 \ No newline at end of file -- GitLab From e1b7e6c69cc340d45774f051598db272b6ca5b91 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 20 Jul 2022 19:41:16 +0530 Subject: [PATCH 17/44] Updated manifest --- .../templates/istio-virtualservice.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml index 6de56f3..ef0d30f 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml @@ -1,3 +1,4 @@ +apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: {{ .Values.conf.appName }}-vs -- GitLab From 6a4fc61161f3996c94b45556f2a497c67a876573 Mon Sep 17 00:00:00 2001 From: Tin Nguyen Date: Fri, 12 Aug 2022 22:38:39 +0000 Subject: [PATCH 18/44] make EFS volume a configurable value --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 +- devops/ibm/ibm-crs-conversion-deploy/values.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 89dae87..5d988f2 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -13,5 +13,5 @@ spec: storageClassName: {{ .Values.storageclass.file_storage }} csi: driver: efs.csi.aws.com - volumeHandle: fs-0ea287aa1e373023e + volumeHandle: {{ .Values.volumeHandle }} {{ end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index c8c6ca0..d93c6f0 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -100,3 +100,5 @@ nodeSelector: {} tolerations: [] affinity: {} + +volumeHandle: fs-0ea287aa1e373023e -- GitLab From 7be3264f90593c3a3e63958ffbb6763df28d2f61 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 17 Aug 2022 22:34:14 +0530 Subject: [PATCH 19/44] pv pvc timeout changes --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 ++ devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 89dae87..90ee034 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolume metadata: name: sis-pv + annotations: + "helm.sh/resource-policy": keep spec: capacity: storage: 5Gi diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index f8dd804..50cf84b 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -1,6 +1,8 @@ kind: PersistentVolumeClaim apiVersion : v1 metadata: + annotations: + "helm.sh/resource-policy": keep name: sis-data namespace: {{ .Release.Namespace }} finalizers: -- GitLab From fe89d9c8eaf84c09badf71ba89f60ca23a31fd22 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 17 Aug 2022 21:06:36 +0000 Subject: [PATCH 20/44] Add CORS policy to Helm chart virtual service --- .../templates/istio-virtualservice.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml index ef0d30f..f35821d 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml @@ -16,11 +16,24 @@ spec: - "*" {{- end }} http: - - match: + - corsPolicy: + allowCredentials: true + allowHeaders: + - Authorization + - Data-Partition-Id + - Correlation-Id + - Content-Type + allowMethods: + - POST + - GET + allowOrigins: + - prefix: '*' + maxAge: 60m + match: - uri: prefix: /api/crs/converter/ route: - destination: host: {{ .Release.Name }}-ibm-crs-conversion-deploy port: - number: 8080 \ No newline at end of file + number: 8080 -- GitLab From f73279e650b60b994f29b077c514aacace4e81c1 Mon Sep 17 00:00:00 2001 From: Sukumar C Date: Thu, 18 Aug 2022 08:21:24 +0000 Subject: [PATCH 21/44] Revert "Merge branch 'pv-timeout-fix' into 'ibm-helm'" --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 -- devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 221254f..5d988f2 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -3,8 +3,6 @@ apiVersion: v1 kind: PersistentVolume metadata: name: sis-pv - annotations: - "helm.sh/resource-policy": keep spec: capacity: storage: 5Gi diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 50cf84b..f8dd804 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -1,8 +1,6 @@ kind: PersistentVolumeClaim apiVersion : v1 metadata: - annotations: - "helm.sh/resource-policy": keep name: sis-data namespace: {{ .Release.Namespace }} finalizers: -- GitLab From 2acbeb10ddd5fb05885048390f47a55e64b95cda Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 7 Oct 2022 00:47:29 +0530 Subject: [PATCH 22/44] Helm CICD to master --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66c6142..007f1dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,6 @@ include: - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/ibm-python-test.yml" - ref: ibm-helm-charts - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/osdu-gcp-global.yml" -- GitLab From cb3d259245ebeb948dcab453e4df706eb94c0499 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 4 Jul 2022 22:38:39 +0530 Subject: [PATCH 23/44] helm charts added --- .../ibm/ibm-crs-conversion-config/.helmignore | 23 +++++ .../ibm/ibm-crs-conversion-config/Chart.yaml | 24 +++++ .../templates/_helpers.tpl | 62 ++++++++++++ .../templates/configmap.yaml | 37 ++++++++ .../ibm/ibm-crs-conversion-config/values.yaml | 49 ++++++++++ .../ibm/ibm-crs-conversion-deploy/.helmignore | 23 +++++ .../ibm/ibm-crs-conversion-deploy/Chart.yaml | 24 +++++ .../templates/NOTES.txt | 22 +++++ .../templates/_helpers.tpl | 62 ++++++++++++ .../templates/deployment.yaml | 81 ++++++++++++++++ .../templates/hpa.yaml | 28 ++++++ .../templates/ingress.yaml | 61 ++++++++++++ .../templates/pvc.yaml | 14 +++ .../templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 56 +++++++++++ .../ibm/ibm-crs-conversion-deploy/values.yaml | 94 +++++++++++++++++++ 16 files changed, 675 insertions(+) create mode 100644 devops/ibm/ibm-crs-conversion-config/.helmignore create mode 100644 devops/ibm/ibm-crs-conversion-config/Chart.yaml create mode 100644 devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl create mode 100644 devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml create mode 100644 devops/ibm/ibm-crs-conversion-config/values.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/.helmignore create mode 100644 devops/ibm/ibm-crs-conversion-deploy/Chart.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/values.yaml diff --git a/devops/ibm/ibm-crs-conversion-config/.helmignore b/devops/ibm/ibm-crs-conversion-config/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/devops/ibm/ibm-crs-conversion-config/Chart.yaml b/devops/ibm/ibm-crs-conversion-config/Chart.yaml new file mode 100644 index 0000000..2f414ba --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: ibm-crs-conversion-config +description: A Helm chart for Kubernetes + +# 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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl b/devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl new file mode 100644 index 0000000..a22fe81 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ibm-crs-conversion-config.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 "ibm-crs-conversion-config.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 "ibm-crs-conversion-config.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ibm-crs-conversion-config.labels" -}} +helm.sh/chart: {{ include "ibm-crs-conversion-config.chart" . }} +{{ include "ibm-crs-conversion-config.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ibm-crs-conversion-config.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ibm-crs-conversion-config.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ibm-crs-conversion-config.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ibm-crs-conversion-config.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml new file mode 100644 index 0000000..797bef7 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ .Values.conf.configmap }}" +data: +#log-and-common + LOG_LEVEL: "{{ .Values.data.logLevel }}" + LOG_PREFIX: "{{ .Values.data.logPrefix }}" + logging.level.org.opengroup.osdu: "{{ .Values.data.loggingLevelOsdu }}" + logging.level.org.springframework.web: "{{ .Values.data.loggingLevelSpring }}" + JAVA_APP_JAR: "{{ .Values.data.javaAppJar }}" + server.servlet.context-path: "{{ .Values.data.contextPath }}" + server.port: "{{ .Values.data.serverPort }}" + spring.main.allow-bean-definition-overriding: "{{ .Values.data.beanDefOverriding }}" + + cache.expiration: "{{ .Values.data.cacheExpiration }}" + cache.maxSize: "{{ .Values.data.cahceMaxSize }}" + ibm.health-check-uri: "{{ .Values.data.healthCheckUri }}" + +#Authorization + osdu.entitlement.url: "http://{{ .Release.Name }}-ibm-entitlement-deploy:8080/api/entitlements/v2" + +#tenant-validation + PARTITION_API: "http://{{ .Release.Name }}-ibm-partition-deploy:8080/api/partition/v1" + partition.keycloak.client_id: "{{ .Values.data.pKCClientId }}" + partition.keycloak.client_secert: "{{ .Values.data.pKCClientSecret }}" + partition.keycloak.grant_type: "{{ .Values.data.grantType }}" + partition.keycloak.password: "{{ .Values.data.pKCPassword }}" + partition.keycloak.realm: "{{ .Values.data.keycloakRealm }}" + partition.keycloak.url: "{{ .Values.data.pKCEndPointHost }}" + partition.keycloak.user: "{{ .Values.data.pKCUser }}" + partition.keycloak.accept_http: "{{ .Values.data.pKAcceptHttp }}" + tenantCache.exp.time.in.second: "{{ .Values.data.tenantCacheExpiryInSec }}" + +#props-core + CRS_API: "http://{{ .Release.Name }}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2" + SIS_DATA: /home/jboss/data/SIS_DATA diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml new file mode 100644 index 0000000..223677f --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -0,0 +1,49 @@ +data: +# common + javaAppJar: "/deployments/*-spring-boot.jar" + serverPort: 8080 + contextPath: "/api/schema-service/v1" + +# log + logPrefix: schema + loggingLevelOsdu: debug + loggingLevelSpring: debug + +# ibm + beanDefOverriding: true + healthCheckUri: "/api/schema-service/v1/info" + +#authorization + #check cm template + authorizeAPI: http://TBD:8080/api/entitlements/v2 + deployEnv: CLOUD + +#db + #dbURL-refer-configmap-template + dbURL: http://tbd:5984 + #get-from-existing secret + dbUser: admin + envPrefix: ibm-iks + #get-from-existing secret + dbPassw: tbd + +#minio + accessKey: tbd + secretKey: tbd + +#tenant-validation + pKCEndPointHost: referenv + keycloakRealm: OSDU + pKCClientId: partition-service + pKCClientSecret: referenv + grantType: password + pKCPassword: changeit + pKCUser: partition-service-admin + pKAcceptHttp: true + tenantCacheExpiryInSec: 10000 + #refer-cm-template + patitionAPI: refer-configmap-template + + +conf: + configmap: "crs-conversion-config" diff --git a/devops/ibm/ibm-crs-conversion-deploy/.helmignore b/devops/ibm/ibm-crs-conversion-deploy/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/devops/ibm/ibm-crs-conversion-deploy/Chart.yaml b/devops/ibm/ibm-crs-conversion-deploy/Chart.yaml new file mode 100644 index 0000000..dedf255 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: ibm-crs-conversion-deploy +description: A Helm chart for Kubernetes + +# 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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt b/devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt new file mode 100644 index 0000000..d7cd957 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ibm-crs-conversion-deploy.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "ibm-crs-conversion-deploy.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ibm-crs-conversion-deploy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "ibm-crs-conversion-deploy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl b/devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl new file mode 100644 index 0000000..7b1007b --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ibm-crs-conversion-deploy.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 "ibm-crs-conversion-deploy.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 "ibm-crs-conversion-deploy.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ibm-crs-conversion-deploy.labels" -}} +helm.sh/chart: {{ include "ibm-crs-conversion-deploy.chart" . }} +{{ include "ibm-crs-conversion-deploy.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ibm-crs-conversion-deploy.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ibm-crs-conversion-deploy.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ibm-crs-conversion-deploy.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ibm-crs-conversion-deploy.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml new file mode 100644 index 0000000..288083a --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{ include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 8 }} + sidecar.istio.io/inject: "{{ .Values.sidecarIstioInjected }}" + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: sis-data + persistentVolumeClaim: + claimName: sis-data + initContainers: + - resources: {} + terminationMessagePath: /dev/termination-log + name: init-myservice + command: + - sh + - '-c' + - 'id; chown 185:185 /home/jboss/data;' + securityContext: {} + imagePullPolicy: Always + volumeMounts: + - name: sis-data + mountPath: /home/jboss/data + terminationMessagePolicy: File + image: busybox:stable + terminationMessagePath: /dev/termination-log + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - configMapRef: + name: crs-conversion-config + volumeMounts: + - name: sis-data + mountPath: /home/jboss/data + ports: + - name: http + containerPort: 8080 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml new file mode 100644 index 0000000..7ffce34 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml new file mode 100644 index 0000000..28f9199 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "ibm-crs-conversion-deploy.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml new file mode 100644 index 0000000..5543746 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -0,0 +1,14 @@ +kind: PersistentVolumeClaim +apiVersion : v1 +metadata: + name: sis-data + namespace: {{ .Release.Namespace }} + finalizers: + - kubernetes.io/pvc-protection +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 20Gi + storageClassName: {{ .Values.storage_class.file_storage }} \ No newline at end of file diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml new file mode 100644 index 0000000..6387ed6 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 4 }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml new file mode 100644 index 0000000..5688545 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml @@ -0,0 +1,56 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-40" +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-40" +rules: + - apiGroups: + - "config.openshift.io" + - "security.istio.io" + - "networking.istio.io" + - "" + resources: + - "secrets" + - "configmaps" + - "services" + - "requestauthentications" + - "envoyfilters" + verbs: + - "list" + - "get" + - "patch" +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-40" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} +subjects: +- kind: ServiceAccount + name: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml new file mode 100644 index 0000000..81b7d61 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -0,0 +1,94 @@ +# Default values for ibm-crs-conversion-deploy. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 +sidecarIstioInjected: "true" +image: + repository: community.opengroup.org:5555/osdu/platform/system/reference/crs-conversion-service/os-crs-conversion-ibm + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "release-0.14-apr22" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" +initimage: + name: dependency-check + initrepository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/k8s-healthprobe + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "v2.0" +conf: + configmap: "crs-conversion-config" + appName: "crs-conversion" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +storage_class: + file_storage: ibmc-file-gold + +nodeSelector: {} + +tolerations: [] + +affinity: {} -- GitLab From 3207d24f4629ed57e68c20ecf00f87e373047187 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Tue, 5 Jul 2022 13:32:07 +0530 Subject: [PATCH 24/44] Updated port --- .../ibm/ibm-crs-conversion-config/values.yaml | 17 ++--------------- .../ibm/ibm-crs-conversion-deploy/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml index 223677f..07604ab 100644 --- a/devops/ibm/ibm-crs-conversion-config/values.yaml +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -2,7 +2,7 @@ data: # common javaAppJar: "/deployments/*-spring-boot.jar" serverPort: 8080 - contextPath: "/api/schema-service/v1" + contextPath: "/api/crs/converter/v2" # log logPrefix: schema @@ -11,25 +11,12 @@ data: # ibm beanDefOverriding: true - healthCheckUri: "/api/schema-service/v1/info" + healthCheckUri: "/api/crs/converter/v2/info" #authorization #check cm template authorizeAPI: http://TBD:8080/api/entitlements/v2 deployEnv: CLOUD - -#db - #dbURL-refer-configmap-template - dbURL: http://tbd:5984 - #get-from-existing secret - dbUser: admin - envPrefix: ibm-iks - #get-from-existing secret - dbPassw: tbd - -#minio - accessKey: tbd - secretKey: tbd #tenant-validation pKCEndPointHost: referenv diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index 81b7d61..2fbe667 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -47,7 +47,7 @@ securityContext: {} service: type: ClusterIP - port: 80 + port: 8080 ingress: enabled: false @@ -84,7 +84,7 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -storage_class: +storageclass: file_storage: ibmc-file-gold nodeSelector: {} -- GitLab From 4cbc8d08e949c732bb3297f1b9a5a548fdc03117 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 6 Jul 2022 23:06:13 +0530 Subject: [PATCH 25/44] Updated resources --- devops/ibm/ibm-crs-conversion-config/values.yaml | 2 +- .../ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml index 07604ab..660d5da 100644 --- a/devops/ibm/ibm-crs-conversion-config/values.yaml +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -2,7 +2,7 @@ data: # common javaAppJar: "/deployments/*-spring-boot.jar" serverPort: 8080 - contextPath: "/api/crs/converter/v2" + contextPath: "/api/crs/converter" # log logPrefix: schema diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml index 5688545..e8037d2 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml @@ -27,6 +27,7 @@ rules: - "" resources: - "secrets" + - "pods" - "configmaps" - "services" - "requestauthentications" -- GitLab From 5bb388023bca8e9159e56d97bf17971d12f86a67 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Fri, 8 Jul 2022 16:53:54 +0530 Subject: [PATCH 26/44] Updated CRS Post Script --- .../files/crs-conversion_post.sh | 12 ++++++ .../templates/configmap.yaml | 10 +++++ .../templates/job.yaml | 43 +++++++++++++++++++ .../templates/pvc.yaml | 2 +- .../templates/serviceaccount.yaml | 2 + .../ibm/ibm-crs-conversion-deploy/values.yaml | 6 +++ 6 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml diff --git a/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh new file mode 100644 index 0000000..d4a87d7 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +CRS_CONVERSION_URL=http://${RELEASE_NAME}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info +echo ${CRS_CONVERSION_URL} +while [[ "$(curl -s -k -L -o /dev/null -w ''%{http_code}'' http://osdu-deploy-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info)" != "200" ]]; do sleep 5; done +echo "CRS Conversion is ready" +echo ${RELEASE_NAMESPACE} +echo ${RELEASE_NAME} +crs_conversion_pod_name=$(oc get pods -o=name -n ${RELEASE_NAMESPACE} | grep 'crs-conversion-deploy' | sed "s/^.\{4\}//") +echo $crs_conversion_pod_name +oc rsync /data/crs-conversion-service/apachesis_setup $crs_conversion_pod_name:/home/jboss/data/ -n ${RELEASE_NAMESPACE} + diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml new file mode 100644 index 0000000..d7c54fb --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/configmap.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }} +data: + crs-conversion_post.sh: | + {{- tpl (.Files.Get "files/crs-conversion_post.sh" ) . | nindent 4 }} \ No newline at end of file diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml new file mode 100644 index 0000000..3064727 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/job.yaml @@ -0,0 +1,43 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: crs-setup-job + labels: + {{- include "ibm-crs-conversion-deploy.labels" . | nindent 4 }}-setup-job + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + activeDeadlineSeconds: 600 + containers: + - image: {{ .Values.jobimage.repository }}:{{ .Values.jobimage.tag }} + env: + - name: RELEASE_NAME + value: {{ .Release.Name }} + - name: RELEASE_NAMESPACE + value: {{ .Release.Namespace }} + command: ['sh', '-c', './scripts/crs-conversion_post.sh'] + imagePullPolicy: Always + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + volumeMounts: + - mountPath: "/scripts" + name: projected-scripts + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + serviceAccountName: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + terminationGracePeriodSeconds: 30 + volumes: + - + name: projected-scripts + projected: + defaultMode: 0755 + sources: + - configMap: + name: {{ include "ibm-crs-conversion-deploy.fullname" . }} + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + serviceAccountName: {{ include "ibm-crs-conversion-deploy.serviceAccountName" . }} + terminationGracePeriodSeconds: 30 diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 5543746..60f1d59 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -11,4 +11,4 @@ spec: resources: requests: storage: 20Gi - storageClassName: {{ .Values.storage_class.file_storage }} \ No newline at end of file + storageClassName: {{ .Values.storageclass.file_storage }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml index e8037d2..37405d7 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/serviceaccount.yaml @@ -27,6 +27,7 @@ rules: - "" resources: - "secrets" + - "pods/exec" - "pods" - "configmaps" - "services" @@ -36,6 +37,7 @@ rules: - "list" - "get" - "patch" + - "create" --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index 2fbe667..0f247ac 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -87,6 +87,12 @@ autoscaling: storageclass: file_storage: ibmc-file-gold +jobimage: + repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/crs-data + pullPolicy: Always +# Overrides the image tag whose default is the chart appVersion. + tag: "v6.0" + nodeSelector: {} tolerations: [] -- GitLab From d9e220d423c5faa6a5a4c6fe0156e6faca26c319 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Sun, 10 Jul 2022 11:52:38 +0530 Subject: [PATCH 27/44] Removed redundant keys --- .../templates/configmap.yaml | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml index 797bef7..9a7e42a 100644 --- a/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml +++ b/devops/ibm/ibm-crs-conversion-config/templates/configmap.yaml @@ -11,27 +11,8 @@ data: JAVA_APP_JAR: "{{ .Values.data.javaAppJar }}" server.servlet.context-path: "{{ .Values.data.contextPath }}" server.port: "{{ .Values.data.serverPort }}" - spring.main.allow-bean-definition-overriding: "{{ .Values.data.beanDefOverriding }}" - - cache.expiration: "{{ .Values.data.cacheExpiration }}" - cache.maxSize: "{{ .Values.data.cahceMaxSize }}" - ibm.health-check-uri: "{{ .Values.data.healthCheckUri }}" + spring.main.allow-bean-definition-overriding: "{{ .Values.data.beanDefOverriding }}" #Authorization osdu.entitlement.url: "http://{{ .Release.Name }}-ibm-entitlement-deploy:8080/api/entitlements/v2" - -#tenant-validation - PARTITION_API: "http://{{ .Release.Name }}-ibm-partition-deploy:8080/api/partition/v1" - partition.keycloak.client_id: "{{ .Values.data.pKCClientId }}" - partition.keycloak.client_secert: "{{ .Values.data.pKCClientSecret }}" - partition.keycloak.grant_type: "{{ .Values.data.grantType }}" - partition.keycloak.password: "{{ .Values.data.pKCPassword }}" - partition.keycloak.realm: "{{ .Values.data.keycloakRealm }}" - partition.keycloak.url: "{{ .Values.data.pKCEndPointHost }}" - partition.keycloak.user: "{{ .Values.data.pKCUser }}" - partition.keycloak.accept_http: "{{ .Values.data.pKAcceptHttp }}" - tenantCache.exp.time.in.second: "{{ .Values.data.tenantCacheExpiryInSec }}" - -#props-core - CRS_API: "http://{{ .Release.Name }}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2" SIS_DATA: /home/jboss/data/SIS_DATA -- GitLab From 638e2d09ad3cb279b7d1b734db89e2d359cac6cb Mon Sep 17 00:00:00 2001 From: sukumar c Date: Sun, 10 Jul 2022 12:04:29 +0530 Subject: [PATCH 28/44] Removed redundant keys --- .../ibm/ibm-crs-conversion-config/values.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-config/values.yaml b/devops/ibm/ibm-crs-conversion-config/values.yaml index 660d5da..e1629a4 100644 --- a/devops/ibm/ibm-crs-conversion-config/values.yaml +++ b/devops/ibm/ibm-crs-conversion-config/values.yaml @@ -13,24 +13,5 @@ data: beanDefOverriding: true healthCheckUri: "/api/crs/converter/v2/info" -#authorization - #check cm template - authorizeAPI: http://TBD:8080/api/entitlements/v2 - deployEnv: CLOUD - -#tenant-validation - pKCEndPointHost: referenv - keycloakRealm: OSDU - pKCClientId: partition-service - pKCClientSecret: referenv - grantType: password - pKCPassword: changeit - pKCUser: partition-service-admin - pKAcceptHttp: true - tenantCacheExpiryInSec: 10000 - #refer-cm-template - patitionAPI: refer-configmap-template - - conf: configmap: "crs-conversion-config" -- GitLab From 441754dbe78d4b2f184ef9f96da1b6a032ea3a03 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 11 Jul 2022 13:16:57 +0530 Subject: [PATCH 29/44] updated ref --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39aafc0..902557e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,6 +50,7 @@ include: - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/ibm-python-test.yml" + ref: ibm-helm-charts - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/osdu-gcp-global.yml" -- GitLab From a53e8dfb43522220fb36c1c57de52599445b4aaf Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 11 Jul 2022 13:56:33 +0530 Subject: [PATCH 30/44] Updated variable --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 902557e..bc0f2dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,8 @@ variables: IBM_BUILD_SUBDIR: provider/crs-converter-ibm/crs-converter-ocp IBM_INT_TEST_PY_SUBDIR: testing/crs_converter_test_ibm IBM_INT_TEST_PY_FILE: run_test.py + IBM_HELM_CONFIG_PATH: devops/ibm/ibm-crs-conversion-config + IBM_HELM_DEPLOY_PATH: devops/ibm/ibm-crs-conversion-deploy include: - project: "osdu/platform/ci-cd-pipelines" -- GitLab From ac9f6e5772d6316382a767dc1bd719c7820d6b87 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 11 Jul 2022 14:43:14 +0530 Subject: [PATCH 31/44] Updated the script --- .../ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh index d4a87d7..b35b012 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh +++ b/devops/ibm/ibm-crs-conversion-deploy/files/crs-conversion_post.sh @@ -2,7 +2,7 @@ CRS_CONVERSION_URL=http://${RELEASE_NAME}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info echo ${CRS_CONVERSION_URL} -while [[ "$(curl -s -k -L -o /dev/null -w ''%{http_code}'' http://osdu-deploy-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info)" != "200" ]]; do sleep 5; done +while [[ "$(curl -s -k -L -o /dev/null -w ''%{http_code}'' http://${RELEASE_NAME}-ibm-crs-conversion-deploy:8080/api/crs/converter/v2/info)" != "200" ]]; do sleep 5; done echo "CRS Conversion is ready" echo ${RELEASE_NAMESPACE} echo ${RELEASE_NAME} -- GitLab From 8649784cba8492353efd6013c8784177245c023c Mon Sep 17 00:00:00 2001 From: sukumar c Date: Tue, 12 Jul 2022 10:53:47 +0530 Subject: [PATCH 32/44] Updated storage value --- devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 60f1d59..2c5a493 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -10,5 +10,5 @@ spec: - ReadWriteMany resources: requests: - storage: 20Gi + storage: 1Gi storageClassName: {{ .Values.storageclass.file_storage }} -- GitLab From e12f84d023434189db667cf6e2f28315aa816025 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 13 Jul 2022 13:38:14 +0530 Subject: [PATCH 33/44] Updated the storage --- devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 2c5a493..f8dd804 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -10,5 +10,5 @@ spec: - ReadWriteMany resources: requests: - storage: 1Gi + storage: 5Gi storageClassName: {{ .Values.storageclass.file_storage }} -- GitLab From f59e2de81d30fdfb1b9f62e63c952afa266b93ae Mon Sep 17 00:00:00 2001 From: sukumar c Date: Thu, 14 Jul 2022 16:37:27 +0530 Subject: [PATCH 34/44] Updated PV resource --- .../templates/pv.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml new file mode 100644 index 0000000..41200b4 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -0,0 +1,19 @@ +{{- if .Values.persistentvolume.enabled -}} +... +apiVersion: v1 +kind: PersistentVolume +metadata: + name: sis-pv +spec: + capacity: + storage: 5Gi + volumeMode: Filesystem + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: {{ .Values.storageclass.file_storage }} + csi: + driver: efs.csi.aws.com + volumeHandle: $FileSystemID +... +{{- end }} \ No newline at end of file -- GitLab From c45c53734745efb6dd3cc6cc471197627279bf21 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Thu, 14 Jul 2022 16:37:58 +0530 Subject: [PATCH 35/44] Updated PV resource --- devops/ibm/ibm-crs-conversion-deploy/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index 0f247ac..bb18697 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -87,6 +87,8 @@ autoscaling: storageclass: file_storage: ibmc-file-gold +persistentvolume: + enabled: false jobimage: repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/crs-data pullPolicy: Always -- GitLab From f9185d20a83ff847f6943c73d92a5eea3caef94d Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 18 Jul 2022 16:22:09 +0530 Subject: [PATCH 36/44] Enabled PV resource --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 6 ++---- devops/ibm/ibm-crs-conversion-deploy/values.yaml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 41200b4..ee98838 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -1,5 +1,4 @@ -{{- if .Values.persistentvolume.enabled -}} -... +{{ if .Values.persistentvolume.enabled }} apiVersion: v1 kind: PersistentVolume metadata: @@ -15,5 +14,4 @@ spec: csi: driver: efs.csi.aws.com volumeHandle: $FileSystemID -... -{{- end }} \ No newline at end of file +{{ end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index bb18697..c8c6ca0 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -88,7 +88,7 @@ storageclass: file_storage: ibmc-file-gold persistentvolume: - enabled: false + enabled: true jobimage: repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/ibm-osdu-provisioning/crs-data pullPolicy: Always -- GitLab From 4f59d529ff866eb24afa74fbc52cf7b1d1b5006a Mon Sep 17 00:00:00 2001 From: sukumar c Date: Mon, 18 Jul 2022 19:51:44 +0530 Subject: [PATCH 37/44] Updated volumeHandle value --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index ee98838..89dae87 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -13,5 +13,5 @@ spec: storageClassName: {{ .Values.storageclass.file_storage }} csi: driver: efs.csi.aws.com - volumeHandle: $FileSystemID + volumeHandle: fs-0ea287aa1e373023e {{ end }} -- GitLab From d1c271c4177fd3e54fa714b8245bd9a8937ac838 Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 20 Jul 2022 18:59:40 +0530 Subject: [PATCH 38/44] Updated virtualservice manifest --- .../templates/istio-authzpolicy.yaml | 22 ++++++++++++++++ .../templates/istio-virtualservice.yaml | 25 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml create mode 100644 devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml new file mode 100644 index 0000000..651dcd8 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-authzpolicy.yaml @@ -0,0 +1,22 @@ +apiVersion: security.istio.io/v1beta1 +kind: AuthorizationPolicy +metadata: + name: {{ .Values.conf.appName }}-authz-policy +spec: + selector: + matchLabels: + {{- include "ibm-crs-conversion-deploy.selectorLabels" . | nindent 6 }} + action: DENY + rules: + - from: + - source: + notRequestPrincipals: + - '*' + to: + - operation: + notPaths: + - '*/v2/api-docs' + - /api/crs/converter/v2/info + - /api/crs/converter/v3/info + - /api/crs/converter/_ah/liveness_check + - /api/crs/converter/_ah/readiness_check \ No newline at end of file diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml new file mode 100644 index 0000000..6de56f3 --- /dev/null +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml @@ -0,0 +1,25 @@ +kind: VirtualService +metadata: + name: {{ .Values.conf.appName }}-vs +spec: + gateways: + - osdu-gateway + hosts: + {{- if .Values.conf.domain }} + - {{ printf "osdu.%s" .Values.conf.domain | quote }} + {{- else if .Values.conf.loadbalancerIP}} + - {{ (index (lookup "v1" "Service" "istio-ingress" "istio-ingress").status.loadBalancer.ingress 0).ip }} + {{- else if .Values.conf.loadbalancerHN}} + - {{ (index (lookup "v1" "Service" "istio-ingress" "istio-ingress").status.loadBalancer.ingress 0).hostname }} + {{- else }} + - "*" + {{- end }} + http: + - match: + - uri: + prefix: /api/crs/converter/ + route: + - destination: + host: {{ .Release.Name }}-ibm-crs-conversion-deploy + port: + number: 8080 \ No newline at end of file -- GitLab From 27b15f915874fb29823d6bbe62d283202e4bed4e Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 20 Jul 2022 19:41:16 +0530 Subject: [PATCH 39/44] Updated manifest --- .../templates/istio-virtualservice.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml index 6de56f3..ef0d30f 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml @@ -1,3 +1,4 @@ +apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: {{ .Values.conf.appName }}-vs -- GitLab From 8f645ba612b8bf078165690422b3c3078bf3659a Mon Sep 17 00:00:00 2001 From: Tin Nguyen Date: Fri, 12 Aug 2022 22:38:39 +0000 Subject: [PATCH 40/44] make EFS volume a configurable value --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 +- devops/ibm/ibm-crs-conversion-deploy/values.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 89dae87..5d988f2 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -13,5 +13,5 @@ spec: storageClassName: {{ .Values.storageclass.file_storage }} csi: driver: efs.csi.aws.com - volumeHandle: fs-0ea287aa1e373023e + volumeHandle: {{ .Values.volumeHandle }} {{ end }} diff --git a/devops/ibm/ibm-crs-conversion-deploy/values.yaml b/devops/ibm/ibm-crs-conversion-deploy/values.yaml index c8c6ca0..d93c6f0 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/values.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/values.yaml @@ -100,3 +100,5 @@ nodeSelector: {} tolerations: [] affinity: {} + +volumeHandle: fs-0ea287aa1e373023e -- GitLab From e5dceea71d8e1a327f30169ba4da6fe2e7b3fe57 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 17 Aug 2022 21:06:36 +0000 Subject: [PATCH 41/44] Add CORS policy to Helm chart virtual service --- .../templates/istio-virtualservice.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml index ef0d30f..f35821d 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/istio-virtualservice.yaml @@ -16,11 +16,24 @@ spec: - "*" {{- end }} http: - - match: + - corsPolicy: + allowCredentials: true + allowHeaders: + - Authorization + - Data-Partition-Id + - Correlation-Id + - Content-Type + allowMethods: + - POST + - GET + allowOrigins: + - prefix: '*' + maxAge: 60m + match: - uri: prefix: /api/crs/converter/ route: - destination: host: {{ .Release.Name }}-ibm-crs-conversion-deploy port: - number: 8080 \ No newline at end of file + number: 8080 -- GitLab From 9ffabae91a4eb64dbc4e08d7565850f3971bb7ae Mon Sep 17 00:00:00 2001 From: sukumar c Date: Wed, 17 Aug 2022 22:34:14 +0530 Subject: [PATCH 42/44] pv pvc timeout changes --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 ++ devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 5d988f2..221254f 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolume metadata: name: sis-pv + annotations: + "helm.sh/resource-policy": keep spec: capacity: storage: 5Gi diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index f8dd804..50cf84b 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -1,6 +1,8 @@ kind: PersistentVolumeClaim apiVersion : v1 metadata: + annotations: + "helm.sh/resource-policy": keep name: sis-data namespace: {{ .Release.Namespace }} finalizers: -- GitLab From 63fde79f1a2c14b13d3b7dacffe9c6b854c159a9 Mon Sep 17 00:00:00 2001 From: Sukumar C Date: Thu, 18 Aug 2022 08:21:24 +0000 Subject: [PATCH 43/44] Revert "Merge branch 'pv-timeout-fix' into 'ibm-helm'" --- devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml | 2 -- devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml index 221254f..5d988f2 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pv.yaml @@ -3,8 +3,6 @@ apiVersion: v1 kind: PersistentVolume metadata: name: sis-pv - annotations: - "helm.sh/resource-policy": keep spec: capacity: storage: 5Gi diff --git a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml index 50cf84b..f8dd804 100644 --- a/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml +++ b/devops/ibm/ibm-crs-conversion-deploy/templates/pvc.yaml @@ -1,8 +1,6 @@ kind: PersistentVolumeClaim apiVersion : v1 metadata: - annotations: - "helm.sh/resource-policy": keep name: sis-data namespace: {{ .Release.Namespace }} finalizers: -- GitLab From a1113d9ed8272034640cf5e0324e902a73ae810c Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 7 Oct 2022 00:47:29 +0530 Subject: [PATCH 44/44] Helm CICD to master --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc0f2dc..71fe930 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,6 @@ include: - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/ibm-python-test.yml" - ref: ibm-helm-charts - project: "osdu/platform/ci-cd-pipelines" file: "cloud-providers/osdu-gcp-global.yml" -- GitLab