Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment configuration for 9cb09-dev #3

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d35f463
simplify deployment steps
abimichel Feb 23, 2024
ce79799
ignore old helm charts
abimichel Feb 23, 2024
3d6948d
Merge pull request #2 from bcgov/main
abimichel Feb 23, 2024
8b75193
switch Airflow to KubernetesExecutor
abimichel Feb 27, 2024
d9d35c0
tips for successful deployments
abimichel Feb 28, 2024
650834a
Opensearch resource requirements
abimichel Mar 1, 2024
f4c342f
web server resource requirements
abimichel Mar 1, 2024
a9c5fd4
airflow resource requirements
abimichel Mar 5, 2024
397b4dc
mysql resource requirements
abimichel Mar 5, 2024
f201d07
increase airflow limits
abimichel Mar 7, 2024
e855b3a
lower max connection limit and increase pod resources
abimichel Mar 7, 2024
79b7344
increase memory to fix gunicorn error
abimichel Mar 8, 2024
f673c24
repo clean up
abimichel Mar 12, 2024
0ceabb2
namespace policies for ingestion
abimichel Mar 12, 2024
1085d0f
route for nr-data-catalogue
abimichel Mar 12, 2024
c0b4dc5
increase MySQL storage
abimichel Mar 12, 2024
643015e
fix tag version for ingestion image
abimichel Mar 18, 2024
a5922af
clean up + update to version 1.3.1
abimichel Mar 19, 2024
d87ca28
clean up
abimichel Mar 22, 2024
439d1ed
new resource config
abimichel Mar 22, 2024
0198c0a
update http proxies
abimichel Mar 22, 2024
caad9c0
clean up oc folder
abimichel Mar 22, 2024
92006fe
Bitnami Postgres instance
abimichel Mar 27, 2024
db17f5f
starting point for stateful set
abimichel Mar 27, 2024
eb771b2
update auto labeling
abimichel Mar 27, 2024
81c2452
final changes for postgres backend
abimichel Mar 28, 2024
a3a6e7b
postgres -> postgresql
abimichel Apr 2, 2024
85665d7
clean up 'oc' folder
abimichel Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v3
# DF-NOTE: delete after merging PR
with:
ref: security-context-changes
ref: a9cb09-dev

- name: Install cosign
if: github.event_name != 'pull_request'
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
charts-1.2.4
openmetadata-dependencies-1.2.5
charts-1.2.4
charts-1.2.5
42 changes: 19 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,46 +72,42 @@ To deploy to OpenShift, use OC commands and make sure Helm cli is installed on y
```
brew install helm
```
### First install Dependencies
Source: https://github.com/open-metadata/openmetadata-helm-charts/tree/main/charts/deps

#### Create secrets
### Apply all the network policies and pod label policies under 'oc' folder:
Navigate to the 'oc' folder then:
```
oc apply -f .
```

#### Create default secrets
```
oc create secret generic airflow-mysql-secrets --from-literal=airflow-mysql-password=airflow_pass
oc create secret generic airflow-db-secrets --from-literal=airflow-db-password=airflow_pass
oc create secret generic db-secrets --from-literal=openmetadata-db-password=openmetadata_password
oc create secret generic airflow-secrets --from-literal=openmetadata-airflow-password=admin
```
#### Deploy dependencies to OpenShift
Source: https://github.com/open-metadata/openmetadata-helm-charts/tree/main/charts/deps

Navigate to the 'deps' chart folder then:
```
helm install openmetadata-dependencies .
```
If you see the below error then get admin access to the dev namespace
Issues: User "[email protected]" cannot get resource "roles" in API group "rbac.authorization.k8s.io" in the namespace "a1b9b0-dev"

### Install OpenMetadata
#### Deploy OpenMetadata to OpenShift
Source: https://github.com/open-metadata/openmetadata-helm-charts/tree/main/charts/openmetadata

#### Create default Secrets
```
oc create secret generic mysql-secrets --from-literal=openmetadata-mysql-password=openmetadata_password
oc create secret generic airflow-secrets --from-literal=openmetadata-airflow-password=admin
```
## Apply the pod label policies under 'oc' folder:
```
oc apply -f [auto-label].yaml
```
## Apply the network policies under 'oc' folder:
```
oc apply -f [net-pol].yaml
```
#### Deploy OpenMetadata to OpenShift:
Navigate to the 'openmetadata' chart folder then:
Once all the dependencies are running, navigate to the 'openmetadata' chart folder then:
```
helm install openmetadata .
```
#### Port Forward OpenMetadata to view UI
```

Note: Always delete old PVC before re-deploying. Old volumes will break new pods.

#### Port forward OpenMetadata to view UI
```
oc port-forward service/openmetadata 8585:http
```

## OpenSearch Dockerfile and Use of GHCR
Expand All @@ -123,4 +119,4 @@ docker pull ghcr.io/bcgov/nr-openmetadata-opensearch:main
```

## Helm chart modifications
To review all Helm chart modifications (i.e. differences between the OpenMetadata default config and this config), search this repo for "DF-NOTE:" annotations.
To review all Helm chart modifications (i.e. differences between the OpenMetadata default config and this config), search this repo for "DF-NOTE:" annotations.
4 changes: 2 additions & 2 deletions charts/deps/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 1.2.8
version: 1.3.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.2.5"
appVersion: "1.3.1"

home: https://open-metadata.org/

Expand Down
12 changes: 6 additions & 6 deletions charts/deps/charts/airflow-8.8.0/charts/postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ volumePermissions:
## pod securityContext.enabled=false and shmVolume.chmod.enabled=false
##
securityContext:
runAsUser: 0
# runAsUser: 0 # DF-NOTE: disabled to allow for random UID

## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
Expand All @@ -84,9 +84,9 @@ volumePermissions:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
##
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
enabled: false # DF-NOTE: disabled to allow for random UID
# fsGroup: 1001
# runAsUser: 1001

## Pod Service Account
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
Expand Down Expand Up @@ -307,7 +307,7 @@ persistence:
# storageClass: "-"
accessModes:
- ReadWriteOnce
size: 8Gi
size: 4Gi # DF-NOTE: previously 8Gi
annotations: {}

## updateStrategy for PostgreSQL StatefulSet and its slaves StatefulSets
Expand Down Expand Up @@ -506,7 +506,7 @@ metrics:
##
securityContext:
enabled: false
runAsUser: 1001
# runAsUser: 1001 # DF-NOTE: disabled to allow for random UID
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
## Configure extra options for liveness and readiness probes
livenessProbe:
Expand Down
78 changes: 60 additions & 18 deletions charts/deps/charts/airflow-8.8.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ airflow:
pullPolicy: IfNotPresent
pullSecret: ""

# Abi this causes the error: runAsUser: Invalid value: 50000
# DF-NOTE: this causes the error: runAsUser: Invalid value: 50000
# uid: 50000

gid: 0
Expand All @@ -23,7 +23,7 @@ airflow:
## - allowed values: "CeleryExecutor", "KubernetesExecutor", "CeleryKubernetesExecutor"
## - customize the "KubernetesExecutor" pod-template with `airflow.kubernetesPodTemplate.*`
##
executor: CeleryExecutor
executor: KubernetesExecutor # DF-NOTE: previously CeleryExecutor

## the fernet encryption key (sets `AIRFLOW__CORE__FERNET_KEY`)
## - [WARNING] you must change this value to ensure the security of your airflow
Expand Down Expand Up @@ -309,7 +309,14 @@ airflow:
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}
resources: # DF-NOTE: previously not enabled
requests:
cpu: 10m
memory: 256Mi
limits:
cpu: 200m
memory: 500Mi


## the nodeSelector configs for the Pod template
## - docs for nodeSelector:
Expand Down Expand Up @@ -401,7 +408,13 @@ airflow:
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}
resources: # DF-NOTE: previously not enabled
requests:
cpu: 50m
memory: 250Mi
limits:
cpu: 300m
memory: 800Mi

## the nodeSelector configs for the db-migrations Pods
## - docs for nodeSelector:
Expand Down Expand Up @@ -462,7 +475,13 @@ airflow:
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}
resources: # DF-NOTE: previously not enabled
requests:
cpu: 50m
memory: 250Mi
limits:
cpu: 300m
memory: 800Mi

## the nodeSelector configs for the sync Pods
## - docs for nodeSelector:
Expand Down Expand Up @@ -521,7 +540,13 @@ scheduler:
## - spec of ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}
resources: # DF-NOTE: previously not enabled
requests:
cpu: 100m
memory: 250Mi
limits:
cpu: 500m
memory: 2Gi

## the nodeSelector configs for the scheduler Pods
## - docs for nodeSelector:
Expand Down Expand Up @@ -601,7 +626,13 @@ scheduler:
## - spec of ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}
resources: # DF-NOTE: previously not enabled
requests:
cpu: 10m
memory: 250Mi
limits:
cpu: 100m
memory: 2560Mi

## the number of minutes to retain log files (by last-modified time)
##
Expand Down Expand Up @@ -720,8 +751,13 @@ web:
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}

resources: # DF-NOTE: previously not enabled
requests:
cpu: 100m
memory: 250Mi
limits:
cpu: 500m
memory: 3Gi
## the nodeSelector configs for the web Pods
## - docs for nodeSelector:
## https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
Expand Down Expand Up @@ -1047,7 +1083,13 @@ triggerer:
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}
resources: # DF-NOTE: previously not enabled
requests:
cpu: 50m
memory: 250Mi
limits:
cpu: 500m
memory: 1536Mi

## the nodeSelector configs for the triggerer Pods
## - docs for nodeSelector:
Expand Down Expand Up @@ -1325,7 +1367,7 @@ logs:

## the size of PVC to request
##
size: 1Gi
size: 600Mi # DF-NOTE: previously 1Gi

###################################
## CONFIG | Airflow DAGs
Expand Down Expand Up @@ -1363,7 +1405,7 @@ dags:

## the size of PVC to request
##
size: 1Gi
size: 50Mi # DF-NOTE: previously 1Gi

## configs for the git-sync sidecar (https://github.com/kubernetes/git-sync)
##
Expand Down Expand Up @@ -1707,12 +1749,12 @@ extraManifests: []
pgbouncer:
## if the pgbouncer Deployment is created
##
enabled: true
enabled: false # DF-NOTE: disabled, as Airflow and OM share a PostgreSQL database

## configs for the pgbouncer container image
##
image:
repository: ghcr.io/airflow-helm/pgbouncer
repository: ghcr.io/airflow-helm/pgbouncer # DF-NOTE: image: image-registry.openshift-image-registry.svc:5000/a9cb09-dev/pgbouncer
tag: 1.18.0-patch.1
pullPolicy: IfNotPresent
uid: 1001
Expand Down Expand Up @@ -1949,7 +1991,7 @@ postgresql:

## the size of PVC to request
##
size: 8Gi
size: 500Mi # DF-NOTE: previously 8Gi

## configs for the postgres StatefulSet
##
Expand Down Expand Up @@ -2042,7 +2084,7 @@ redis:
## - set to `false` if `airflow.executor` is `KubernetesExecutor`
## - set to `false` if using `externalRedis.*`
##
enabled: true
enabled: false # DF-NOTE: not needed for KubernetesExecutor

## configs for the redis container image
##
Expand Down Expand Up @@ -2125,7 +2167,7 @@ redis:

## the size of PVC to request
##
size: 8Gi
size: 500Mi # DF-NOTE: previously 8Gi

## configs for the redis slave StatefulSet
## - only used if `redis.cluster.enabled` is `true`
Expand Down Expand Up @@ -2178,7 +2220,7 @@ redis:

## the size of PVC to request
##
size: 8Gi
size: 500Mi # DF-NOTE: previously 8Gi

###################################
## DATABASE | External Redis
Expand Down
Loading
Loading