From 5d053a022c1fa738238c8fe53ee3c24b4fbcfa62 Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Mon, 1 Aug 2022 17:21:23 +0300 Subject: [PATCH 1/9] GONRG-5112: update configmap for policy service --- .../configmap/templates/policy-configmap.yaml | 18 +++++++++--------- devops/gcp/configmap/values.yaml | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/devops/gcp/configmap/templates/policy-configmap.yaml b/devops/gcp/configmap/templates/policy-configmap.yaml index e0d103d..07c4cb3 100644 --- a/devops/gcp/configmap/templates/policy-configmap.yaml +++ b/devops/gcp/configmap/templates/policy-configmap.yaml @@ -2,15 +2,15 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" name: "{{ .Values.conf.configmap }}" namespace: "{{ .Release.Namespace }}" data: - LOG_LEVEL: "{{ .Values.data.log_level }}" - OPA_URL: "{{ .Values.data.opa_url }}" - ENTITLEMENTS_BASE_URL: "{{ .Values.data.entitlements_base_url }}" - ENTITLEMENTS_BASE_PATH: "{{ .Values.data.entitlements_base_path }}" - LEGAL_BASE_URL: "{{ .Values.data.legal_base_url }}" - POLICY_BUCKET: "{{ .Values.data.bucket_name }}" - USE_BUNDLES: "{{ .Values.data.use_bundles }}" - CLOUD_PROVIDER: "{{ .Values.data.cloud_provider }}" + LOG_LEVEL: "{{ .Values.data.logLevel }}" + OPA_URL: "{{ .Values.data.opaUrl }}" + ENTITLEMENTS_BASE_URL: "{{ .Values.data.entitlementsBaseUrl }}" + ENTITLEMENTS_BASE_PATH: "{{ .Values.data.entitlementsBasePath }}" + LEGAL_BASE_URL: "{{ .Values.data.legalBaseUrl }}" + POLICY_BUCKET: "{{ .Values.data.bucketName }}" + USE_BUNDLES: "{{ .Values.data.useBundles }}" + CLOUD_PROVIDER: "{{ .Values.data.cloudProvider }}" diff --git a/devops/gcp/configmap/values.yaml b/devops/gcp/configmap/values.yaml index 1b1a139..e1d332f 100644 --- a/devops/gcp/configmap/values.yaml +++ b/devops/gcp/configmap/values.yaml @@ -1,13 +1,13 @@ data: - log_level: "INFO" - opa_url: "http://opa" - entitlements_base_url: "http://entitlements" - entitlements_base_path: "/api/entitlements/v2/groups" - legal_base_url: "http://legal" - bucket_name: "" - use_bundles: "yes" - cloud_provider: "gcp" + logLevel: "INFO" + opaUrl: "http://opa" + entitlementsBaseUrl: "http://entitlements" + entitlementsBasePath: "/api/entitlements/v2/groups" + legalBaseUrl: "http://legal" + bucketName: "" + useBundles: "yes" + cloudProvider: "gcp" conf: configmap: "policy-config" - app_name: "policy" + appName: "policy" -- GitLab From e9542e0d762dda42842acded3173704e7291fff2 Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Mon, 1 Aug 2022 17:22:42 +0300 Subject: [PATCH 2/9] GONRG-5112: update configmap for opa policy --- devops/gcp/configmap_opa/templates/opa-configmap.yaml | 8 ++++---- devops/gcp/configmap_opa/values.yaml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/devops/gcp/configmap_opa/templates/opa-configmap.yaml b/devops/gcp/configmap_opa/templates/opa-configmap.yaml index 1bd8b8c..64e061b 100644 --- a/devops/gcp/configmap_opa/templates/opa-configmap.yaml +++ b/devops/gcp/configmap_opa/templates/opa-configmap.yaml @@ -2,14 +2,14 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" name: "{{ .Values.conf.configmap }}" namespace: "{{ .Release.Namespace }}" data: config.yaml: | services: gcs: - url: "https://storage.googleapis.com/storage/v1/b/{{ .Values.data.bucket_name }}/o" + url: "https://storage.googleapis.com/storage/v1/b/{{ .Values.data.bucketName }}/o" credentials: gcp_metadata: scopes: @@ -20,6 +20,6 @@ data: service: gcs # NOTE ?alt=media is required resource: 'bundle.tar.gz?alt=media' - osdu/partition/{{ .Values.conf.data_partition_id }}: + osdu/partition/{{ .Values.conf.dataPartitionId }}: service: gcs - resource: 'bundle-{{ .Values.conf.data_partition_id }}.tar.gz?alt=media' + resource: 'bundle-{{ .Values.conf.dataPartitionId }}.tar.gz?alt=media' diff --git a/devops/gcp/configmap_opa/values.yaml b/devops/gcp/configmap_opa/values.yaml index 03fb1d7..38f2233 100644 --- a/devops/gcp/configmap_opa/values.yaml +++ b/devops/gcp/configmap_opa/values.yaml @@ -1,8 +1,8 @@ data: - bucket_name: "" + bucketName: "" scopes: "https://www.googleapis.com/auth/devstorage.read_only" conf: configmap: "opa-config" - app_name: "opa" - data_partition_id: "" + appName: "opa" + dataPartitionId: "" -- GitLab From 14fba6cca38764998b5fa8786876cf4753b7d5aa Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Mon, 1 Aug 2022 17:24:53 +0300 Subject: [PATCH 3/9] GONRG-5112: update deployment for policy service --- devops/gcp/deploy/templates/deployment.yaml | 18 +++++++++--------- devops/gcp/deploy/templates/service.yaml | 8 ++++---- .../gcp/deploy/templates/virtual-service.yaml | 4 ++-- devops/gcp/deploy/values.yaml | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/devops/gcp/deploy/templates/deployment.yaml b/devops/gcp/deploy/templates/deployment.yaml index df26c21..f6b5203 100644 --- a/devops/gcp/deploy/templates/deployment.yaml +++ b/devops/gcp/deploy/templates/deployment.yaml @@ -2,23 +2,23 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: "{{ .Values.conf.app_name }}" - name: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" + name: "{{ .Values.conf.appName }}" namespace: "{{ .Release.Namespace }}" spec: selector: matchLabels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" replicas: 1 template: metadata: labels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" annotations: rollme: {{ randAlphaNum 5 | quote }} spec: containers: - - name: "{{ .Values.conf.app_name }}" + - name: "{{ .Values.conf.appName }}" image: "{{ .Values.data.image }}" imagePullPolicy: "{{ .Values.data.imagePullPolicy }}" envFrom: @@ -31,9 +31,9 @@ spec: - containerPort: 80 resources: requests: - cpu: "{{ .Values.data.requests_cpu }}" - memory: "{{ .Values.data.requests_memory }}" + cpu: "{{ .Values.data.requestsCpu }}" + memory: "{{ .Values.data.requestsMemory }}" limits: - cpu: "{{ .Values.data.limits_cpu }}" - memory: "{{ .Values.data.limits_memory }}" + cpu: "{{ .Values.data.limitsCpu }}" + memory: "{{ .Values.data.limitsMemory }}" serviceAccountName: "{{ .Values.data.serviceAccountName }}" diff --git a/devops/gcp/deploy/templates/service.yaml b/devops/gcp/deploy/templates/service.yaml index 878a464..38dba1e 100644 --- a/devops/gcp/deploy/templates/service.yaml +++ b/devops/gcp/deploy/templates/service.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: "{{ .Values.conf.app_name }}" + name: "{{ .Values.conf.appName }}" annotations: cloud.google.com/neg: '{"ingress": true}' namespace: "{{ .Release.Namespace }}" labels: - app: "{{ .Values.conf.app_name }}" - service: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" + service: "{{ .Values.conf.appName }}" spec: ports: - protocol: TCP @@ -15,4 +15,4 @@ spec: targetPort: 80 name: http selector: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" diff --git a/devops/gcp/deploy/templates/virtual-service.yaml b/devops/gcp/deploy/templates/virtual-service.yaml index 5c61613..5214685 100644 --- a/devops/gcp/deploy/templates/virtual-service.yaml +++ b/devops/gcp/deploy/templates/virtual-service.yaml @@ -1,7 +1,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: - name: "{{ .Values.conf.app_name }}" + name: "{{ .Values.conf.appName }}" namespace: "{{ .Release.Namespace }}" spec: hosts: @@ -20,4 +20,4 @@ spec: - destination: port: number: 80 - host: "{{ .Values.conf.app_name }}.{{ .Release.Namespace }}.svc.cluster.local" + host: "{{ .Values.conf.appName }}.{{ .Release.Namespace }}.svc.cluster.local" diff --git a/devops/gcp/deploy/values.yaml b/devops/gcp/deploy/values.yaml index 9eda104..f9e1d01 100644 --- a/devops/gcp/deploy/values.yaml +++ b/devops/gcp/deploy/values.yaml @@ -1,13 +1,13 @@ data: - requests_cpu: "0.1" - requests_memory: "128M" - limits_cpu: "1" - limits_memory: "1G" + requestsCpu: "0.1" + requestsMemory: "128M" + limitsCpu: "1" + limitsMemory: "1G" serviceAccountName: "" imagePullPolicy: "IfNotPresent" image: "" conf: configmap: "policy-config" - app_name: "policy" + appName: "policy" domain: "" -- GitLab From 78ab09bb7fafaf5eaffff6c7f9518579d8e9bf05 Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Mon, 1 Aug 2022 17:26:42 +0300 Subject: [PATCH 4/9] GONRG-5112: update deployment for opa policy --- devops/gcp/opa/templates/deployment.yaml | 20 +++++++++---------- devops/gcp/opa/templates/service.yaml | 6 +++--- devops/gcp/opa/templates/virtual-service.yaml | 4 ++-- devops/gcp/opa/values.yaml | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/devops/gcp/opa/templates/deployment.yaml b/devops/gcp/opa/templates/deployment.yaml index 352ff30..0ef2a89 100644 --- a/devops/gcp/opa/templates/deployment.yaml +++ b/devops/gcp/opa/templates/deployment.yaml @@ -1,9 +1,9 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: "{{ .Values.conf.app_name }}" + name: "{{ .Values.conf.appName }}" labels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" namespace: "{{ .Release.Namespace }}" spec: replicas: 1 @@ -11,15 +11,15 @@ spec: type: Recreate selector: matchLabels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" template: metadata: labels: - app: "{{ .Values.conf.app_name }}" - name: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" + name: "{{ .Values.conf.appName }}" spec: containers: - - name: "{{ .Values.conf.app_name }}" + - name: "{{ .Values.conf.appName }}" image: openpolicyagent/opa:latest imagePullPolicy: "{{ .Values.data.imagePullPolicy }}" ports: @@ -31,11 +31,11 @@ spec: - "--config-file=/config/config.yaml" resources: requests: - cpu: "{{ .Values.data.requests_cpu }}" - memory: "{{ .Values.data.requests_memory }}" + cpu: "{{ .Values.data.requestsCpu }}" + memory: "{{ .Values.data.requestsMemory }}" limits: - cpu: "{{ .Values.data.limits_cpu }}" - memory: "{{ .Values.data.limits_memory }}" + cpu: "{{ .Values.data.limitsCpu }}" + memory: "{{ .Values.data.limitsMemory }}" volumeMounts: - mountPath: /config name: "{{ .Values.conf.configmap }}" diff --git a/devops/gcp/opa/templates/service.yaml b/devops/gcp/opa/templates/service.yaml index d3d3ba2..bcd7ce2 100644 --- a/devops/gcp/opa/templates/service.yaml +++ b/devops/gcp/opa/templates/service.yaml @@ -1,9 +1,9 @@ kind: Service apiVersion: v1 metadata: - name: "{{ .Values.conf.app_name }}" + name: "{{ .Values.conf.appName }}" labels: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" namespace: "{{ .Release.Namespace }}" spec: type: ClusterIP @@ -13,4 +13,4 @@ spec: targetPort: 8181 name: http selector: - app: "{{ .Values.conf.app_name }}" + app: "{{ .Values.conf.appName }}" diff --git a/devops/gcp/opa/templates/virtual-service.yaml b/devops/gcp/opa/templates/virtual-service.yaml index c6a3807..ae0b2a7 100644 --- a/devops/gcp/opa/templates/virtual-service.yaml +++ b/devops/gcp/opa/templates/virtual-service.yaml @@ -1,7 +1,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: - name: "{{ .Values.conf.app_name }}" + name: "{{ .Values.conf.appName }}" namespace: "{{ .Release.Namespace }}" spec: hosts: @@ -18,6 +18,6 @@ spec: prefix: "/v1/policies" route: - destination: - host: "{{ .Values.conf.app_name }}.{{ .Release.Namespace }}.svc.cluster.local" + host: "{{ .Values.conf.appName }}.{{ .Release.Namespace }}.svc.cluster.local" port: number: 8181 diff --git a/devops/gcp/opa/values.yaml b/devops/gcp/opa/values.yaml index b0e4489..5a2c6ef 100644 --- a/devops/gcp/opa/values.yaml +++ b/devops/gcp/opa/values.yaml @@ -3,15 +3,15 @@ # Declare variables to be passed into your templates. data: - requests_cpu: "0.1" - requests_memory: "128M" - limits_cpu: "1" - limits_memory: "1G" + requestsCpu: "0.1" + requestsMemory: "128M" + limitsCpu: "1" + limitsMemory: "1G" image: "" imagePullPolicy: "IfNotPresent" serviceAccountName: "opa-k8s" conf: - app_name: "opa" + appName: "opa" configmap: "opa-config" domain: "" -- GitLab From 603f62966d35f3b8708a9128fc3f1e311239b931 Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Mon, 1 Aug 2022 17:27:21 +0300 Subject: [PATCH 5/9] GONRG-5112: update vars for policy pipeline --- devops/gcp/pipeline/override-stages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devops/gcp/pipeline/override-stages.yml b/devops/gcp/pipeline/override-stages.yml index a5d5641..573a4d3 100644 --- a/devops/gcp/pipeline/override-stages.yml +++ b/devops/gcp/pipeline/override-stages.yml @@ -9,8 +9,8 @@ variables: OSDU_GCP_HELM_OPA_CONFIG_DIR: "devops/gcp/configmap_opa" # FIXME OSDU_GCP_HELM_OPA_CONFIG_SERVICE_VARS: >- - --set data.bucket_name=$OSDU_GCP_POLICY_BUCKET - --set conf.data_partition_id=osdu + --set data.bucketName=$OSDU_GCP_POLICY_BUCKET + --set conf.dataPartitionId=osdu OSDU_GCP_INT_TEST_TYPE: python osdu-gcp-helm-charts-master: -- GitLab From f94335fc831d30f6d3d0a5eddd488776ca0d4b52 Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Wed, 3 Aug 2022 15:41:15 +0300 Subject: [PATCH 6/9] GONRG-5112: add README for policy configmap --- devops/gcp/configmap/README.md | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 devops/gcp/configmap/README.md diff --git a/devops/gcp/configmap/README.md b/devops/gcp/configmap/README.md new file mode 100644 index 0000000..7cbc08d --- /dev/null +++ b/devops/gcp/configmap/README.md @@ -0,0 +1,65 @@ + + +# Configmap helm chart + +## Introduction + +This chart bootstraps a configmap deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh) package manager. + +## Prerequisites + +The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6) +> It is possible to use other versions, but it hasn't been tested + +### Operation system + +The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported. + +### Packages + +Packages are only needed for installation from a local computer. + +- **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/) +- **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) + +## Installation + +First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below. + +### Common variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**logLevel** | logging level | string | INFO | yes +**opaUrl** | OPA host | string | "http://opa" | yes +**entitlementsBaseUrl** | Entitlements host | string | "http://entitlements" | yes +**entitlementsBasePath** | Entitlements path | string | "/api/entitlements/v2/groups" | yes +**legalBaseUrl** | Legal host | string | "http://legal" | yes +**bucketName** | bucket name | string | - | yes +**useBundles** | use bundle or not | string | "yes" | yes +**cloudProvider** | Cloud provider | string | "gcp" | yes + +### Config variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**configmap** | configmap to be used | string | policy-config | yes +**appName** | name of the app | string | policy | yes + +### Install the helm chart + +Run this command from within this directory: + +```console +helm install gcp-policy-configmap . +``` + +## Uninstalling the Chart + +To uninstall the helm deployment: + +```console +helm uninstall gcp-policy-configmap +``` + +[Move-to-Top](#configmap-helm-chart) -- GitLab From 606b7abb88512d0dc2ccd1296dff62585bc932c0 Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Wed, 3 Aug 2022 15:46:03 +0300 Subject: [PATCH 7/9] GONRG-5112: add README for opa configmap --- devops/gcp/configmap_opa/README.md | 60 ++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 devops/gcp/configmap_opa/README.md diff --git a/devops/gcp/configmap_opa/README.md b/devops/gcp/configmap_opa/README.md new file mode 100644 index 0000000..3bc7129 --- /dev/null +++ b/devops/gcp/configmap_opa/README.md @@ -0,0 +1,60 @@ + + +# Configmap helm chart + +## Introduction + +This chart bootstraps a configmap deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh) package manager. + +## Prerequisites + +The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6) +> It is possible to use other versions, but it hasn't been tested + +### Operation system + +The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported. + +### Packages + +Packages are only needed for installation from a local computer. + +- **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/) +- **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) + +## Installation + +First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below. + +### Common variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**bucketName** | bucket name | string | - | yes +**scopes** | scope of OPA | string | "https://www.googleapis.com/auth/devstorage.read_only" | yes + +### Config variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**configmap** | configmap to be used | string | opa-config | yes +**appName** | name of the app | string | opa | yes +**dataPartitionId** | data partition id | string | - | yes + +### Install the helm chart + +Run this command from within this directory: + +```console +helm install gcp-opa-configmap . +``` + +## Uninstalling the Chart + +To uninstall the helm deployment: + +```console +helm uninstall gcp-opa-configmap +``` + +[Move-to-Top](#configmap-helm-chart) -- GitLab From 3a5aff04bf82b5366bf514761f2c57613f9e775e Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Wed, 3 Aug 2022 15:49:42 +0300 Subject: [PATCH 8/9] GONRG-5112: add README for policy deployment --- devops/gcp/deploy/README.md | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 devops/gcp/deploy/README.md diff --git a/devops/gcp/deploy/README.md b/devops/gcp/deploy/README.md new file mode 100644 index 0000000..bcb278b --- /dev/null +++ b/devops/gcp/deploy/README.md @@ -0,0 +1,66 @@ + + +# Deploy helm chart + +## Introduction + +This chart bootstraps a deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh) package manager. + +## Prerequisites + +The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6) + +> It is possible to use other versions, but it hasn't been tested + +### Operation system + +The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported. + +### Packages + +Packages are only needed for installation from a local computer. + +- **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/) +- **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) + +## Installation + +First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below. + +### Common variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**image** | your image name | string | - | yes +**requestsCpu** | amount of requests CPU | string | 0.1 | yes +**requestsMemory** | amount of requests memory| string | 128M | yes +**limitsCpu** | CPU limit | string | 1 | yes +**limitsMemory** | memory limit | string | 1G | yes +**serviceAccountName** | name of your service account | string | - | yes +**imagePullPolicy** | when to pull image | string | IfNotPresent | yes + +### Config variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**appName** | name of the app | string | policy | yes +**configmap** | configmap to be used | string | policy-config | yes +**domain** | your domain | string | - | yes + +### Install the helm chart + +Run this command from within this directory: + +```console +helm install gcp-policy-deploy . +``` + +## Uninstalling the Chart + +To uninstall the helm deployment: + +```console +helm uninstall gcp-policy-deploy +``` + +[Move-to-Top](#deploy-helm-chart) -- GitLab From b2ba4dd5f2c42486b5ca8cb38cab2d283bea1b1f Mon Sep 17 00:00:00 2001 From: "Yauheni Rykhter (EPAM)" Date: Wed, 3 Aug 2022 15:52:55 +0300 Subject: [PATCH 9/9] GONRG-5112: add README for opa deployment --- devops/gcp/opa/README.md | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 devops/gcp/opa/README.md diff --git a/devops/gcp/opa/README.md b/devops/gcp/opa/README.md new file mode 100644 index 0000000..2fadfd6 --- /dev/null +++ b/devops/gcp/opa/README.md @@ -0,0 +1,66 @@ + + +# Deploy helm chart + +## Introduction + +This chart bootstraps a deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh) package manager. + +## Prerequisites + +The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6) + +> It is possible to use other versions, but it hasn't been tested + +### Operation system + +The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported. + +### Packages + +Packages are only needed for installation from a local computer. + +- **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/) +- **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) + +## Installation + +First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below. + +### Common variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**image** | your image name | string | - | yes +**requestsCpu** | amount of requests CPU | string | 0.1 | yes +**requestsMemory** | amount of requests memory| string | 128M | yes +**limitsCpu** | CPU limit | string | 1 | yes +**limitsMemory** | memory limit | string | 1G | yes +**serviceAccountName** | name of your service account | string | opa-k8s | yes +**imagePullPolicy** | when to pull image | string | IfNotPresent | yes + +### Config variables + +| Name | Description | Type | Default |Required | +|------|-------------|------|---------|---------| +**appName** | name of the app | string | opa | yes +**configmap** | configmap to be used | string | opa-config | yes +**domain** | your domain | string | - | yes + +### Install the helm chart + +Run this command from within this directory: + +```console +helm install gcp-opa-deploy . +``` + +## Uninstalling the Chart + +To uninstall the helm deployment: + +```console +helm uninstall gcp-opa-deploy +``` + +[Move-to-Top](#deploy-helm-chart) -- GitLab