From 494ec0b088af724dc61ae08bb6b69e003b334257 Mon Sep 17 00:00:00 2001 From: ontimize-web Date: Wed, 21 Feb 2024 17:23:40 +0000 Subject: [PATCH 1/6] Prepare next development iteration --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b3f6a83..29f728c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.2.0", + "version": "15.3.0-SNAPSHOT-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ontimize-web-ngx-playground", - "version": "15.2.0", + "version": "15.3.0-SNAPSHOT-0", "dependencies": { "@angular/animations": "^15.2.10", "@angular/cdk": "^15.2.9", diff --git a/package.json b/package.json index 23c50a79..3a64e61e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.2.0", + "version": "15.3.0-SNAPSHOT-0", "scripts": { "ng": "ng", "start": "ng serve --port 4801", From 91497e8a8a2b66fa72b4fc35c3a8085011b37971 Mon Sep 17 00:00:00 2001 From: ontimize-web Date: Tue, 27 Feb 2024 15:45:58 +0000 Subject: [PATCH 2/6] Prepare next development iteration --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03da93d8..a04beb41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.2.1", + "version": "15.3.0-SNAPSHOT-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ontimize-web-ngx-playground", - "version": "15.2.1", + "version": "15.3.0-SNAPSHOT-0", "dependencies": { "@angular/animations": "^15.2.10", "@angular/cdk": "^15.2.9", diff --git a/package.json b/package.json index aa64a22e..a421b313 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.2.1", + "version": "15.3.0-SNAPSHOT-0", "scripts": { "ng": "ng", "start": "ng serve --port 4801", From 17fad0548e76fd9fe894b3abf78f2334ec1f4143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a=20Cousido?= Date: Wed, 28 Feb 2024 16:12:16 +0100 Subject: [PATCH 3/6] Create CODEOWNERS --- .github/CODEOWNERS | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..d0cd2060 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# all users in this group will be requested +# for review when someone opens a pull request. + +# Default reviewers +* @OntimizeWeb/Developer + +# CI/CD workflows reviewers +.github/workflows/* @OntimizeWeb/Admin From fb6be7122ed4824d8dc5614078e2ee563d630c21 Mon Sep 17 00:00:00 2001 From: ontimize-web Date: Mon, 4 Mar 2024 11:50:56 +0000 Subject: [PATCH 4/6] Prepare next development iteration --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ca25b58..14aa6a97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.2.2", + "version": "15.3.0-SNAPSHOT-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ontimize-web-ngx-playground", - "version": "15.2.2", + "version": "15.3.0-SNAPSHOT-0", "dependencies": { "@angular/animations": "^15.2.10", "@angular/cdk": "^15.2.9", diff --git a/package.json b/package.json index 077d98ca..d0966dad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.2.2", + "version": "15.3.0-SNAPSHOT-0", "scripts": { "ng": "ng", "start": "ng serve --port 4801", From 86c88ca6fe5d7fb5856b800d3cdbd7e809f9201c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a=20Cousido?= Date: Wed, 27 Mar 2024 16:19:24 +0100 Subject: [PATCH 5/6] Add workflows for creating Docker images (#289) * feat: dockerize * feat: add helm charts * feat: docker workflow * feat: update chart values * chore: update values.yaml * chore: update values.yaml hostname * feat: update deploy-image workflow * feat: update prepare-release workflow * feat: update build-release.yml * chore: update values.yml --- .dockerignore | 47 +++++++++++ .github/workflows/build-release.yml | 7 +- .github/workflows/deploy-image.yml | 53 ++++++++++++ .github/workflows/prepare-release.yml | 6 ++ Dockerfile | 29 +++++++ charts/ontimize-web-ngx-playground/Chart.yaml | 21 +++++ charts/ontimize-web-ngx-playground/README.md | 19 +++++ .../templates/NOTES.txt | 21 +++++ .../templates/_helpers.tpl | 52 ++++++++++++ .../templates/configmap.yaml | 10 +++ .../templates/deployment.yaml | 84 +++++++++++++++++++ .../templates/ingress.yaml | 31 +++++++ .../templates/service.yaml | 15 ++++ .../ontimize-web-ngx-playground/values.yaml | 84 +++++++++++++++++++ nginx/nginx.conf | 16 ++++ 15 files changed, 492 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/deploy-image.yml create mode 100644 Dockerfile create mode 100644 charts/ontimize-web-ngx-playground/Chart.yaml create mode 100644 charts/ontimize-web-ngx-playground/README.md create mode 100644 charts/ontimize-web-ngx-playground/templates/NOTES.txt create mode 100644 charts/ontimize-web-ngx-playground/templates/_helpers.tpl create mode 100644 charts/ontimize-web-ngx-playground/templates/configmap.yaml create mode 100644 charts/ontimize-web-ngx-playground/templates/deployment.yaml create mode 100644 charts/ontimize-web-ngx-playground/templates/ingress.yaml create mode 100644 charts/ontimize-web-ngx-playground/templates/service.yaml create mode 100644 charts/ontimize-web-ngx-playground/values.yaml create mode 100644 nginx/nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..1879238a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,47 @@ +# Compiled output +/dist +**/dist +/tmp +/out-tsc +/bazel-out + +# Node +/node_modules +**/node_modules/ +npm-debug.log +yarn-error.log + +# IDEs and editors +.idea/ +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# Miscellaneous +/.angular/cache +.sass-cache/ +/connect.lock +/coverage +/libpeerconnection.log +testem.log +/typings +.git +npm-debug.log +.coverage +.coverage.* +.env + +# System files +.DS_Store +Thumbs.db \ No newline at end of file diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index f1d6cd2d..48ee6aa8 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -17,6 +17,7 @@ env: CI_EMAIL: ontimize-web@imatia.com CI_USERNAME: ontimize-web DEVELOP_BRANCH: 15.x.x + REPO_NAME: ${{ github.event.repository.name }} jobs: build: @@ -116,10 +117,10 @@ jobs: run: | npm version $(npm version minor --no-git-tag-version)-SNAPSHOT-0 --no-git-tag-version - - name: bumping version in internal package.json - working-directory: . + - name: Update Chart values.yml run: | - npm version $(npm version minor --no-git-tag-version)-SNAPSHOT-0 --no-git-tag-version + version=$(cat ./charts/$REPO_NAME/values.yaml | grep version: | awk '{print $2}') + sed -i "s#$version#${{ env.DEVELOP_BRANCH }}#" ./charts/$REPO_NAME/values.yaml - name: Create sync branch run: | diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml new file mode 100644 index 00000000..d7e2aeb2 --- /dev/null +++ b/.github/workflows/deploy-image.yml @@ -0,0 +1,53 @@ +--- +name: Create and publish Docker image + +on: + push: + branches: ['15.x.x'] + tags: + - 15.* + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + MAIN_BRANCH: main.15.x + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ontimize-web + password: ${{ secrets.OWEB_GH_TOKEN_PUSH }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + # branch event + type=ref,event=branch + # push tag event + type=semver,pattern={{version}} + # set latest tag for main branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', env.MAIN_BRANCH ) }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 1f47c3a4..331323e8 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -19,6 +19,7 @@ env: CI_USERNAME: ontimize-web MAIN_BRANCH: main.15.x DEVELOP_BRANCH: 15.x.x + REPO_NAME: ${{ github.event.repository.name }} jobs: build: @@ -78,6 +79,11 @@ jobs: npm version patch --no-git-tag-version echo "RELEASE_VERSION=$(node -pe "require('./package.json')['version']")" >> $GITHUB_ENV + - name: Update Chart values.yml + run: | + version=$(cat ./charts/$REPO_NAME/values.yaml | grep version: | awk '{print $2}') + sed -i "s#$version#${{ env.RELEASE_VERSION }}#" ./charts/$REPO_NAME/values.yaml + - name: Create release branch if: ${{ steps.parameters.outputs.isHotfix == false }} run: | diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0905051e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Stage 1: Compile and Build angular codebase +# Use official node image as the base image +FROM node:18.10.0-alpine as build + +# Set the working directory +WORKDIR /usr/local/app + +COPY package*.json . + +# Install all the dependencies +RUN npm install + +COPY . . + +# Generate the build of the application +RUN npm run production + + +# Stage 2: Serve app with nginx server + +# Use official nginx image as the base image +FROM nginx:latest + +# Copy the build output to replace the default nginx contents. +COPY --from=build /usr/local/app/dist /usr/share/nginx/html +COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/Chart.yaml b/charts/ontimize-web-ngx-playground/Chart.yaml new file mode 100644 index 00000000..8b07bab8 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: ontimize-web-ngx-playground +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. +version: 0.0.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. +appVersion: 0.0.1 \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/README.md b/charts/ontimize-web-ngx-playground/README.md new file mode 100644 index 00000000..7c5f7de4 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/README.md @@ -0,0 +1,19 @@ +## DESCRIPCIƓN + +Generic Helm template to create a Deployment of an Ontimize Application (service). + +To deploy in a K8s Cluster ArgoCD is used. (development environment https://argocd.dev.imatia.cloud). Access is granted using Azure AD credentials (Imatia domain). + +Values can be customized in values.yaml, but after the application sources are generated a standard configuration ready to run is provided. + +See values.yaml to get detailed information of parameters. + +Ingress and TLS are enabled by default. Value in host is provided as HOST environment variable to the pod. + +Also prometheus annotations, probe paths, kafka, keycloak and other parameters are configured by default, and setup with required configuration for K8s Imatia development cluster. Configuration is provided as environment variables to the pod (and so available to the Ontimize application as defined in application-xx.yaml files). + +Resources (CPU, Memory can be customized as needed). + +Also using configmap section in values.yaml it is easy to provide environment values to the pod, adapting deployment.yaml. + +If in the configmap.data section a key "environment-profile" exists, its value will be injected as ENVIRONMENT_PROFILE variable. This can be used to differentiate between staging and production environments easily. diff --git a/charts/ontimize-web-ngx-playground/templates/NOTES.txt b/charts/ontimize-web-ngx-playground/templates/NOTES.txt new file mode 100644 index 00000000..e85de057 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/templates/NOTES.txt @@ -0,0 +1,21 @@ +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-example.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-example.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "helm-example.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-example.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 +{{- end }} \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/templates/_helpers.tpl b/charts/ontimize-web-ngx-playground/templates/_helpers.tpl new file mode 100644 index 00000000..ff0cd752 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/templates/_helpers.tpl @@ -0,0 +1,52 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "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 "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 "chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "labels" -}} +helm.sh/chart: {{ include "chart" . }} +{{ include "selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "selectorLabels" -}} +app.kubernetes.io/name: {{ include "name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} diff --git a/charts/ontimize-web-ngx-playground/templates/configmap.yaml b/charts/ontimize-web-ngx-playground/templates/configmap.yaml new file mode 100644 index 00000000..6cf2062b --- /dev/null +++ b/charts/ontimize-web-ngx-playground/templates/configmap.yaml @@ -0,0 +1,10 @@ +{{- if .Values.configmap.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.configmap.name | default (printf "%s-config" (include "fullname" .)) }} +data: +{{- if .Values.configmap.data }} +{{ toYaml .Values.configmap.data | indent 2 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/templates/deployment.yaml b/charts/ontimize-web-ngx-playground/templates/deployment.yaml new file mode 100644 index 00000000..c5e508e5 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/templates/deployment.yaml @@ -0,0 +1,84 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "fullname" . }} + labels: + {{- include "labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "selectorLabels" . | nindent 8 }} +{{- if .Values.podsLabels }} +{{ toYaml .Values.podsLabels | indent 6 }} +{{- end }} +{{- if .Values.podAnnotations }} + annotations: +{{ toYaml .Values.podAnnotations | indent 8 }} +{{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.version }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.configmap.enabled }} + envFrom: + - configMapRef: + name: {{ .Values.configmap.name | default (printf "%s-config" (include "fullname" .)) }} + {{- end }} + env: + - name: VERSION + value: {{ .Chart.Version }} +{{- range $pkey, $pval := .Values.env }} + - name: {{ $pkey }} + value: {{ quote $pval }} +{{- end }} + - name: NAME + value: {{ (printf "%s" (include "fullname" .)) }} + - name: HOST + value: {{ .Values.ingress.host }} + ports: + - name: http + containerPort: {{ .Values.service.internalPort }} + livenessProbe: + httpGet: + path: {{ .Values.livenessProbe.probePath | default .Values.probePath }} + port: {{ .Values.probePort | default .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + readinessProbe: + httpGet: + path: {{ .Values.readinessProbe.probePath | default .Values.probePath }} + port: {{ .Values.probePort | default .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + 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 }} \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/templates/ingress.yaml b/charts/ontimize-web-ngx-playground/templates/ingress.yaml new file mode 100644 index 00000000..f918de41 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/templates/ingress.yaml @@ -0,0 +1,31 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tls.secretName }} +{{- end }} + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - pathType: "ImplementationSpecific" + backend: + service: + name: {{ .Values.service.name }} + port: + number: {{ .Values.service.externalPort }} +{{- end }} \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/templates/service.yaml b/charts/ontimize-web-ngx-playground/templates/service.yaml new file mode 100644 index 00000000..43d73f40 --- /dev/null +++ b/charts/ontimize-web-ngx-playground/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.service.name }} + labels: + {{- include "labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + protocol: TCP + name: http + selector: + {{- include "selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/ontimize-web-ngx-playground/values.yaml b/charts/ontimize-web-ngx-playground/values.yaml new file mode 100644 index 00000000..eb0b817b --- /dev/null +++ b/charts/ontimize-web-ngx-playground/values.yaml @@ -0,0 +1,84 @@ +# This is a YAML-formatted file. + +# Deployment configuration +replicaCount: 1 +image: + pullPolicy: IfNotPresent + ## provided as basic setup. replace as needed + repository: ghcr.io/ontimizeweb/ontimize-web-ngx-playground + version: 15.x.x +imagePullSecrets: + - name: github-ecr-cred +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} +# Add labels to the pods +podsLabels: {} +# Add labels to the deployment +deploymentLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} +## liveness/readiness probes. standard ontimize endpoints +probePath: /index.html +probePort: 80 +livenessProbe: + initialDelaySeconds: 60 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 1 + ### Optional distinct liveness probe path, if empty the probePath is used + probePath: /index.html +readinessProbe: + initialDelaySeconds: 70 + failureThreshold: 3 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 1 + ### Optional distinct readiness probe path, if empty the probePath is used + probePath: /index.html +## Adapt resources if needed +resources: + limits: + cpu: 400m + memory: 256Mi + requests: + cpu: 100m + memory: 128Mi + +## Be sure to set API key in secret *******-grafana-api-key, key apiKey +grafana: + enabled: false + +# Optional configmap. +configmap: + enabled: false + data: + + +# Service configuration. Annotations are used by cert-manager to generate certificates using cluster-issuer +service: + name: ontimize-web-ngx-playground-15x + type: ClusterIP + externalPort: 41501 + internalPort: 80 +ingress: + enabled: true + annotations: + kubernetes.io/ingress.class: nginx + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: cert-manager-letsencrypt-production-route53 + host: ontimize-web-ngx-playground.ontimize.com + tls: + secretName: ontimize-web-ngx-playground-tls + enabled: true + +# Kafka. If used. Will be provided as environment variables to the pods. +kafka: + enabled: false + +s3: + enabled: false diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 00000000..331a2727 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + + root /usr/share/nginx/html; + + location / { + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file From 7bb5fc8b7a88c48653097121ea5ff865360d5ef6 Mon Sep 17 00:00:00 2001 From: ontimize-web Date: Wed, 27 Mar 2024 15:24:51 +0000 Subject: [PATCH 6/6] Prepare release 15.3.0 --- charts/ontimize-web-ngx-playground/values.yaml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/ontimize-web-ngx-playground/values.yaml b/charts/ontimize-web-ngx-playground/values.yaml index eb0b817b..a787a986 100644 --- a/charts/ontimize-web-ngx-playground/values.yaml +++ b/charts/ontimize-web-ngx-playground/values.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/ontimizeweb/ontimize-web-ngx-playground - version: 15.x.x + version: 15.3.0 imagePullSecrets: - name: github-ecr-cred nameOverride: "" diff --git a/package-lock.json b/package-lock.json index 14aa6a97..91f8c6bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.3.0-SNAPSHOT-0", + "version": "15.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ontimize-web-ngx-playground", - "version": "15.3.0-SNAPSHOT-0", + "version": "15.3.0", "dependencies": { "@angular/animations": "^15.2.10", "@angular/cdk": "^15.2.9", diff --git a/package.json b/package.json index d0966dad..89e590b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ontimize-web-ngx-playground", - "version": "15.3.0-SNAPSHOT-0", + "version": "15.3.0", "scripts": { "ng": "ng", "start": "ng serve --port 4801",