diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index d5c3bef5..85ec8fc0 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -15,7 +15,7 @@ type: library # 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.34 +version: 0.1.35 # 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 diff --git a/charts/mod-reading-room/.helmignore b/charts/mod-reading-room/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/mod-reading-room/.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/charts/mod-reading-room/Chart.yaml b/charts/mod-reading-room/Chart.yaml new file mode 100644 index 00000000..2bbc04f4 --- /dev/null +++ b/charts/mod-reading-room/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: mod-reading-room +description: A Helm chart for Kubernetes mod-reading-room deployment + +# 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: 1.0.1 + +# 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.0.0" + +dependencies: +- name: common + version: ~0.1.0 + repository: file://../common diff --git a/charts/mod-reading-room/templates/NOTES.txt b/charts/mod-reading-room/templates/NOTES.txt new file mode 100644 index 00000000..9f538391 --- /dev/null +++ b/charts/mod-reading-room/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 }}{{ . }} + {{- 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 "helm.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 "helm.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "helm.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 "helm.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/charts/mod-reading-room/templates/app.yaml b/charts/mod-reading-room/templates/app.yaml new file mode 100644 index 00000000..061b1b74 --- /dev/null +++ b/charts/mod-reading-room/templates/app.yaml @@ -0,0 +1,12 @@ +--- +{{- include "common.service" . }} +--- +{{- include "common.deployment" . }} +--- +{{- include "common.serviceaccount" . }} +--- +{{- include "common.ingress" . }} +--- +{{- include "common.hpa" . }} +--- +{{- include "common.post-install-job" . }} diff --git a/charts/mod-reading-room/values.yaml b/charts/mod-reading-room/values.yaml new file mode 100644 index 00000000..4f959786 --- /dev/null +++ b/charts/mod-reading-room/values.yaml @@ -0,0 +1,144 @@ +# Default values for mod-reading-room. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: folioci/mod-reading-room + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +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 + containerPort: 8081 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + 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: + + limits: + #cpu: 128m + memory: 512Mi + requests: + #cpu: 50m + memory: 384Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +# Folio specific +javaOptions: -XX:MaxRAMPercentage=66.0 +dbMaxPoolSize: 5 + +# If need to create and attach ConfigMap add nedded parameters here +# And create folder configmaps. In folder create file with the same name that in this config. +# In file paste only data for configmap. +# config: +# - name: sftp-config +# subPath: users.conf +# mountPath: /etc/sftp/users.conf + +# volumeMounts: + # secrets: + # - name: secure-store-props + # mountPath: /etc/edge + # secretName: ephemeral-properties + # emptyDirs: + # - name: dumps-volume + # mountPath: /dumps + +extraEnv: | + - name: DB_MAXPOOLSIZE + value: "{{ .Values.dbMaxPoolSize }}" + - name: JAVA_OPTIONS + value: {{ .Values.javaOptions }} + + +# Enable parameters for OKAPI, DB, Kafka or AWS connection. In value set name of secret +dbConnectParameters: db-connect-modules +# kafkaConnectParameters: db-connect-modules +# awsConnectParameters: s3-credentials +# okapiConnectParameters: db-connect-modules +# elasticSearchConnectParameters: db-connect-modules + +# initContainer: +# image: +# repository: busybox +# tag: latest +# imagePullPolicy: Always +# command: cat +# overrideArgs: +# - diku +# - dkl +# mountPath: /path + +postJob: + enabled: false + okapiUrl: http://okapi:9130 + tenantId: diku + sampleData: false + referenceData: false + image: + repository: docker.dev.folio.org/folio-okapi-registration + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded