From c3bbe4bc1c91b308a517f4b02b5e5a2135e3c795 Mon Sep 17 00:00:00 2001 From: Aaron Forde <132496297+aforde-aot@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:07:16 -0700 Subject: [PATCH] Adding analytics BuildConfig, Updating Docs (#1822) --- openshift/README.md | 4 +++ openshift/analytics-api.bc.yml | 54 ++++++++++++++++++++++++++++++++++ openshift/web.bc.yml | 4 +-- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 openshift/analytics-api.bc.yml diff --git a/openshift/README.md b/openshift/README.md index c8d351de1..99c8b1c68 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -29,6 +29,10 @@ In the tools namespace use the following to create the build configurations: oc process -f ./met-analytics.bc.yml | oc create -f - ``` +``` + oc process -f ./analytics-api.bc.yml | oc create -f - +``` + ## Image Puller Configuration Allow image pullers from the other namespaces to pull images from tools namespace: diff --git a/openshift/analytics-api.bc.yml b/openshift/analytics-api.bc.yml new file mode 100644 index 000000000..bd0cd8991 --- /dev/null +++ b/openshift/analytics-api.bc.yml @@ -0,0 +1,54 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: api-build-template + annotations: + description: "Build Configuration Template for the Analytics API " + tags: "met, api, python" +objects: + - apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + name: ${APP} + spec: + lookupPolicy: + local: false + - apiVersion: build.openshift.io/v1 + kind: BuildConfig + metadata: + name: ${APP} + labels: + app: ${APP} + spec: + nodeSelector: null + output: + to: + kind: ImageStreamTag + name: '${APP}:latest' + resources: {} + successfulBuildsHistoryLimit: 5 + failedBuildsHistoryLimit: 5 + strategy: + type: Docker + dockerStrategy: + dockerfilePath: Dockerfile + postCommit: {} + source: + type: Git + git: + uri: ${GITHUB_REPO} + ref: main + contextDir: ${GITHUB_CONTEXT_DIR} + triggers: + - type: ConfigChange + runPolicy: Serial +parameters: + - name: APP + description: "The application name" + value: analytics-api + - name: GITHUB_REPO + description: "The github repo uri" + value: 'https://github.com/bcgov/met-public.git' + - name: GITHUB_CONTEXT_DIR + description: "The repository folder context" + value: /analytics-api \ No newline at end of file diff --git a/openshift/web.bc.yml b/openshift/web.bc.yml index 2f175ca41..2bce6536a 100644 --- a/openshift/web.bc.yml +++ b/openshift/web.bc.yml @@ -27,8 +27,8 @@ objects: name: '${APP}:latest' resources: limits: - cpu: '2' - memory: 5Gi + cpu: '500m' + memory: 2Gi successfulBuildsHistoryLimit: 5 failedBuildsHistoryLimit: 5 strategy: