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

Feature/updated deployment instr #2877

Merged
merged 8 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
49 changes: 40 additions & 9 deletions save-cloud-charts/save-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ api-gateway acts as an entrypoint and svc/gateway is actually a LoadBalancer.

For example, for minikube and dev profile run `kubectl --context=minikube --namespace=save-cloud create secret generic db-secrets --from_literal=spring.datasource.username=<...> <...>`
* **save-backend** and **save-demo** expects the following secrets to be set under the secret `s3-secrets` (`kubectl create secret generic s3-secrets <...>`)
* `s3-storage.endpoint`
* `s3-storage.bucketName`
* `s3-storage.credentials.accessKeyId`
* `s3-storage.credentials.secretAccessKey`
* `s3-storage.bucketName`
* `s3-storage.credentials.accessKeyId`
* `s3-storage.credentials.secretAccessKey`
* `s3-storage.endpoint`

These secrets are then mounted under the path specified as `S3_SECRETS_PATH` environment variable.

Expand All @@ -47,6 +47,41 @@ command line using `--set` flag.

## Local deployment
* Install minikube: https://minikube.sigs.k8s.io/docs/start/
* install csi addon in minikube to provide this StorageClass type in your minikube cluster
```bash
minikube addons enable csi-hostpath-driver
```
This StorageClass must be provided in values e.g:
```yaml
storage:
storageClassName: csi-hostpath-driver
size: 24Gi
annotations:
everest.io/disk-volume-type: SAS
volume.beta.kubernetes.io/storage-provisioner: hostpath.csi.k8s.io
reposStorage:
storageClassName: csi-hostpath-driver
annotations:
everest.io/disk-volume-type: SAS
volume.beta.kubernetes.io/storage-provisioner: hostpath.csi.k8s.io
```
* [optional] modify kube config file to use base64 encripted info about certs and keys instead of using path to cert file
Change this:
```yaml
certificate-authority: </path/to/file>
client-certificate: </path/to/file>
client-key: </path/to/file>
```
to this:
```yaml
certificate-authority-data: <base64 encoded cert>
client-certificate-data: <base64 encoded cert>
client-key-data: <base64 encoded cert>
```
you can convert it via base64 util
```bash
cat </path/to/cert> | base64
```
* Environment should be prepared:
```bash
minikube ssh
Expand All @@ -60,13 +95,9 @@ command line using `--set` flag.
build.docker.tls-verify=true
build.docker.cert-path=<path-to-user-home>/.minikube/certs
```
* (Required only once) Install Helm chart using `values-minikube.yaml`:
```bash
$ helm install save-cloud save-cloud-0.1.0.tgz --namespace save-cloud --values values-minikube.yaml <any other value files and/or --set flags>
```
* (On consecutive deployments) Upgrade an existing Helm release:
```bash
$ helm upgrade save-cloud save-cloud-0.1.0.tgz --namespace save-cloud --values values-minikube.yaml <any other value files and/or --set flags>
$ helm --kube-context=minikube --namespace=save-cloud upgrade -i save-cloud save-cloud-0.1.0.tgz/<or use ulr oci://ghcr.io/saveourtool/save-cloud> --values values-minikube.yaml --values=values-images.yaml <any other value files and/or --set flags>
```
* Database migrations can be run by setting value `mysql.migrations.enabled` to `true` (no additional setup, migrations
are executed by init container, but may be too slow with constant recreations of backend/sandbox pods)
Expand Down
25 changes: 25 additions & 0 deletions save-cloud-charts/save-cloud/values-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
chartVersion: '0.2.1+1056'

# The version from the "Build and push Docker images" action.
#
# Search the log for the "Successfully built image
# 'ghcr.io/saveourtool/api-gateway:master'" line, or simply
# look up the version of the latest published package at
# <https://github.com/orgs/saveourtool/packages?repo_name=save-cloud>.
dockerTag: '0.4.0-alpha.0.379-70423bd'
gateway:
dockerTag: '0.4.0-alpha.0.379-70423bd'
backend:
dockerTag: '0.4.0-alpha.0.379-70423bd'
frontend:
dockerTag: '0.4.0-alpha.0.379-70423bd'
preprocessor:
dockerTag: '0.4.0-alpha.0.379-70423bd'
orchestrator:
dockerTag: '0.4.0-alpha.0.379-70423bd'
sandbox:
dockerTag: '0.4.0-alpha.0.379-70423bd'
demo:
dockerTag: '0.4.0-alpha.0.379-70423bd'
demo_cpg:
dockerTag: '0.4.0-alpha.0.379-70423bd'
47 changes: 47 additions & 0 deletions save-cloud-charts/save-cloud/values-minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,50 @@ s3:
endpoint: http://s3

# dependencies

storage:
storageClassName: csi-hostpath-sc
size: 24Gi
annotations:
everest.io/disk-volume-type: SAS
volume.beta.kubernetes.io/storage-provisioner: hostpath.csi.k8s.io

reposStorage:
storageClassName: csi-hostpath-sc
annotations:
everest.io/disk-volume-type: SAS
volume.beta.kubernetes.io/storage-provisioner: hostpath.csi.k8s.io

neo4j:
enabled: true
neo4j:
password: DiktatTestNeo4j@123
acies312 marked this conversation as resolved.
Show resolved Hide resolved
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: cce
kubernetes.io/elb.class: union
kubernetes.io/elb.id: '2a4f9875-39dd-4140-abf0-4b9bf710880a'
kubernetes.io/elb.ip: '119.8.236.175'
kubernetes.io/elb.port: '7687'
svc:
spec:
type: NodePort
volumes:
data:
# REQUIRED: specify a volume mode to use for data
# Valid values are share|selector|defaultStorageClass|volume|volumeClaimTemplate|dynamic
# To get up-and-running quickly, for development or testing, use "defaultStorageClass" for a dynamically provisioned volume of the default storage class.
mode: "volume"

# Only used if mode is set to "volume"
# Provide an explicit volume to use
volume:
# If set an init container (running as root) will be added that runs:
# `chown -R <securityContext.fsUser>:<securityContext.fsGroup>` AND `chmod -R g+rwx`
# on the volume. This is useful for some filesystems (e.g. NFS) where Kubernetes fsUser or fsGroup settings are not respected
setOwnerAndGroupWritableFilePermissions: false

# Example (using a specific Persistent Volume Claim)
persistentVolumeClaim:
claimName: data-neo4j-0