Skip to content
Snippets Groups Projects
Commit 4933dcdf authored by Irakli Janiashvili's avatar Irakli Janiashvili Committed by Oleksandr Kosse (EPAM)
Browse files

GONRG-5942 merge all helms for unit service

parent 49dea30e
No related branches found
No related tags found
1 merge request!221GONRG-5942 merge all helms for unit service
...@@ -21,6 +21,8 @@ variables: ...@@ -21,6 +21,8 @@ variables:
AZURE_TEST_SUBDIR: testing/unit_test_azure AZURE_TEST_SUBDIR: testing/unit_test_azure
AZURE_TEST_TYPE: python AZURE_TEST_TYPE: python
SHARE_NAME: unit SHARE_NAME: unit
# FIXME remove when all services are migrated to a single helm
OSDU_GCP_ENABLE_HELM_CONFIG: "false"
include: include:
- project: "osdu/platform/ci-cd-pipelines" - project: "osdu/platform/ci-cd-pipelines"
......
This diff is collapsed.
apiVersion: v2
name: gcp-unit-configmap
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"
<!--- Configmap -->
# 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
### Google Cloud variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**entitlementsHost** | entitlements service host address | string | `http://entitlements` | yes
### Config variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**appName** | name of the app | string | unit | yes
**configmap** | configmap name | string | unit-config | yes
### Install the helm chart
Run this command from within this directory:
```bash
helm install gcp-unit-configmap .
```
## Uninstalling the Chart
To uninstall the helm deployment:
```bash
helm uninstall gcp-unit-configmap
```
[Move-to-Top](#configmap-helm-chart)
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: "{{ .Values.conf.appName }}"
name: "{{ .Values.conf.configmap }}"
namespace: "{{ .Release.Namespace }}"
data:
LOG_LEVEL: "{{ .Values.data.logLevel }}"
ENTITLEMENTS_HOST: "{{ .Values.data.entitlementsHost }}"
# Default values for unit-configmap.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
data:
logLevel: "ERROR"
entitlementsHost: "http://entitlements"
conf:
appName: "unit"
configmap: "unit-config"
...@@ -26,7 +26,14 @@ Packages are only needed for installation from a local computer. ...@@ -26,7 +26,14 @@ Packages are only needed for installation from a local computer.
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. 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 ### Configmap variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**logLevel** | logging level | string | ERROR | yes
**entitlementsHost** | entitlements service host address | string | `http://entitlements` | yes
### Deployment variables
| Name | Description | Type | Default |Required | | Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------| |------|-------------|------|---------|---------|
......
...@@ -2,28 +2,28 @@ apiVersion: apps/v1 ...@@ -2,28 +2,28 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:
app: "{{ .Values.conf.appName }}" app: {{ .Values.conf.appName | quote }}
name: "{{ .Values.conf.appName }}" name: {{ .Values.conf.appName | quote }}
namespace: "{{ .Release.Namespace }}" namespace: {{ .Release.Namespace | quote }}
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: "{{ .Values.conf.appName }}" app: {{ .Values.conf.appName | quote }}
replicas: 1 replicas: 1
template: template:
metadata: metadata:
labels: labels:
app: "{{ .Values.conf.appName }}" app: {{ .Values.conf.appName | quote }}
annotations: annotations:
rollme: {{ randAlphaNum 5 | quote }} rollme: {{ randAlphaNum 5 | quote }}
spec: spec:
containers: containers:
- name: "{{ .Values.conf.appName }}" - name: {{ .Values.conf.appName | quote }}
image: "{{ .Values.data.image }}" image: {{ .Values.data.image | quote }}
imagePullPolicy: "{{ .Values.data.imagePullPolicy }}" imagePullPolicy: {{ .Values.data.imagePullPolicy | quote }}
envFrom: envFrom:
- configMapRef: - configMapRef:
name: "{{ .Values.conf.configmap }}" name: {{ .Values.conf.configmap | quote }}
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
runAsUser: 0 runAsUser: 0
...@@ -31,9 +31,9 @@ spec: ...@@ -31,9 +31,9 @@ spec:
- containerPort: 8080 - containerPort: 8080
resources: resources:
requests: requests:
cpu: "{{ .Values.data.requestsCpu }}" cpu: {{ .Values.data.requestsCpu | quote }}
memory: "{{ .Values.data.requestsMemory }}" memory: {{ .Values.data.requestsMemory | quote }}
limits: limits:
cpu: "{{ .Values.data.limitsCpu }}" cpu: {{ .Values.data.limitsCpu | quote }}
memory: "{{ .Values.data.limitsMemory }}" memory: {{ .Values.data.limitsMemory | quote }}
serviceAccountName: "{{ .Values.data.serviceAccountName }}" serviceAccountName: {{ .Values.data.serviceAccountName | quote }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: "{{ .Values.conf.appName }}" name: {{ .Values.conf.appName | quote }}
annotations: annotations:
{{- if not .Values.conf.onPremEnabled }} {{- if not .Values.conf.onPremEnabled }}
cloud.google.com/neg: '{"ingress": true}' cloud.google.com/neg: '{"ingress": true}'
{{- end }} {{- end }}
namespace: "{{ .Release.Namespace }}" namespace: {{ .Release.Namespace | quote }}
labels: labels:
app: "{{ .Values.conf.appName }}" app: {{ .Values.conf.appName | quote }}
service: "{{ .Values.conf.appName }}" service: {{ .Values.conf.appName | quote }}
spec: spec:
ports: ports:
- protocol: TCP - protocol: TCP
...@@ -17,4 +17,4 @@ spec: ...@@ -17,4 +17,4 @@ spec:
targetPort: 8080 targetPort: 8080
name: http name: http
selector: selector:
app: "{{ .Values.conf.appName }}" app: {{ .Values.conf.appName | quote }}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: "{{ .Values.data.serviceAccountName }}" name: {{ .Values.data.serviceAccountName | quote }}
namespace: "{{ .Release.Namespace }}" namespace: {{ .Release.Namespace | quote }}
{{- end }} {{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ .Values.conf.appName | quote }}
name: {{ .Values.conf.configmap | quote }}
namespace: {{ .Release.Namespace | quote }}
data:
LOG_LEVEL: {{ .Values.data.logLevel | quote }}
ENTITLEMENTS_HOST: {{ .Values.data.entitlementsHost | quote }}
apiVersion: networking.istio.io/v1alpha3 apiVersion: networking.istio.io/v1alpha3
kind: VirtualService kind: VirtualService
metadata: metadata:
name: "{{ .Values.conf.appName }}" name: {{ .Values.conf.appName | quote }}
namespace: "{{ .Release.Namespace }}" namespace: {{ .Release.Namespace | quote }}
spec: spec:
hosts: hosts:
{{- if and .Values.conf.domain .Values.conf.onPremEnabled }} {{- if and .Values.conf.domain .Values.conf.onPremEnabled }}
...@@ -22,4 +22,4 @@ spec: ...@@ -22,4 +22,4 @@ spec:
- destination: - destination:
port: port:
number: 80 number: 80
host: "{{ .Values.conf.appName }}.{{ .Release.Namespace }}.svc.cluster.local" host: {{ printf "%s.%s.svc.cluster.local" .Values.conf.appName .Release.Namespace | quote }}
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
data: data:
logLevel: "ERROR"
entitlementsHost: "http://entitlements"
requestsCpu: "0.1" requestsCpu: "0.1"
requestsMemory: "256M" requestsMemory: "256M"
limitsCpu: "1" limitsCpu: "1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment