-
Notifications
You must be signed in to change notification settings - Fork 3
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
Separate save and cosv services #2908
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0bac40b
save and cosv divide in gateway
acies312 bd840f0
added cosv deployment templates for helm chart
acies312 fda31e3
Merge branch 'master' into feature/save-cosv-divide
acies312 dce9e2f
Update values.yaml
acies312 3342638
modified agent service templates
acies312 5da4d1a
Merge branch 'master' into feature/save-cosv-divide
acies312 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
save-cloud-charts/save-cloud/templates/agent-backend-cosv-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ if .Values.agentNamespace }} | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.backend_cosv.name }} | ||
namespace: {{ .Values.agentNamespace }} | ||
spec: | ||
type: ExternalName | ||
externalName: {{ .Values.backend_cosv.name }}.{{ .Values.namespace }}.svc.cluster.local | ||
ports: | ||
- port: {{ .Values.backend_cosv.containerPort }} | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
save-cloud-charts/save-cloud/templates/backend-cosv-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Values.backend_cosv.name }}-config | ||
data: | ||
application.properties: | | ||
backend.preprocessor-url=http://preprocessor | ||
backend.orchestrator-url=http://orchestrator | ||
backend.demo-url=http://demo | ||
backend.loki.url=http://loki:3100 | ||
backend.loki.labels.agent-container-name=pod | ||
backend.loki.labels.application-name=app | ||
backend.agent-settings.backend-url=http://{{ .Values.backend_cosv.name }} | ||
server.shutdown=graceful | ||
management.endpoints.web.exposure.include=* | ||
management.server.port={{ .Values.backend_cosv.managementPort }} | ||
spring.datasource.url=${spring.datasource.backend-cosv-url} | ||
logging.level.org.springframework=DEBUG | ||
logging.level.com.saveourtool=DEBUG |
138 changes: 138 additions & 0 deletions
138
save-cloud-charts/save-cloud/templates/backend-cosv-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: backend-cosv | ||
labels: | ||
{{- include "common.labels" (merge (dict "service" .Values.backend_cosv) .) | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
io.kompose.service: backend-cosv | ||
strategy: | ||
# Because of shared volume with multi-attach problem | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "pod.common.labels" (merge (dict "service" .Values.backend_cosv ) .) | nindent 8 }} | ||
annotations: | ||
{{- include "pod.common.annotations" (dict "service" .Values.backend_cosv ) | nindent 8 }} | ||
spec: | ||
restartPolicy: Always | ||
{{- include "cnb.securityContext" . | nindent 6 }} | ||
containers: | ||
- name: backend-cosv | ||
{{- include "spring-boot.common" (merge (dict "service" .Values.backend_cosv) .) | nindent 10 }} | ||
env: | ||
{{- include "spring-boot.common.env" (merge (dict "service" .Values.backend_cosv) .) | nindent 12 }} | ||
- name: DATABASE_SECRETS_PATH | ||
value: {{ .Values.mysql.dbPasswordFile }} | ||
- name: S3_SECRETS_PATH | ||
value: {{ .Values.s3.secretFile }} | ||
- name: JAVA_TOOL_OPTIONS | ||
value: -XX:ReservedCodeCacheSize=48M | ||
volumeMounts: | ||
- {{ include "spring-boot.config-volume-mount" . | indent 14 | trim }} | ||
- name: database-secret | ||
mountPath: {{ .Values.mysql.dbPasswordFile }} | ||
- name: s3-secrets | ||
mountPath: {{ .Values.s3.secretFile }} | ||
{{- include "spring-boot.management" .Values.backend_cosv | nindent 10 }} | ||
resources: | ||
limits: | ||
memory: 2G | ||
requests: | ||
memory: 1G | ||
{{ if .Values.mysql.migrations.enabled }} | ||
initContainers: | ||
- name: git-cloner | ||
image: alpine/git | ||
env: | ||
{{ if .Values.proxy.enabled }} | ||
{{- with .Values.proxy.extraEnv }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{ end }} | ||
args: | ||
- clone | ||
- --progress | ||
- --verbose | ||
{{ if .Values.proxy.enabled }} | ||
{{- with .Values.proxy.extraArgs }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{ end }} | ||
- --single-branch | ||
- --branch | ||
- {{ .Values.mysql.migrations.branch | default "master" }} | ||
- -- | ||
- https://github.com/saveourtool/save-cloud.git | ||
- /data | ||
volumeMounts: | ||
- mountPath: /data | ||
name: migrations-data | ||
- name: liquibase-runner | ||
image: liquibase/liquibase:4.20 | ||
securityContext: | ||
runAsUser: 1001 | ||
runAsGroup: 1001 | ||
args: | ||
- --url=$(DB_URL)?createDatabaseIfNotExist=true | ||
- --changeLogFile=db/db.changelog-master.xml | ||
- --username=$(DB_USERNAME) | ||
- --password=$(DB_PASSWORD) | ||
- --log-level=info | ||
- --contexts={{ .Values.profile }} | ||
- update | ||
resources: | ||
requests: | ||
memory: 100M | ||
limits: | ||
memory: 300M | ||
env: | ||
# See https://hub.docker.com/r/liquibase/liquibase, section 'Notice for MySQL Users' | ||
- name: INSTALL_MYSQL | ||
value: 'true' | ||
- name: DB_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets | ||
key: spring.datasource.backend-url | ||
- name: DB_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets | ||
key: spring.datasource.username | ||
- name: DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets | ||
key: spring.datasource.password | ||
{{ if .Values.proxy.enabled }} | ||
{{- with .Values.proxy.extraEnv }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{ end }} | ||
volumeMounts: | ||
- mountPath: /liquibase/changelog | ||
name: migrations-data | ||
- mountPath: {{ .Values.mysql.dbPasswordFile }} | ||
name: database-secret | ||
- mountPath: /etc/ssl/certs/ca-certificates.crt | ||
name: ca-certs | ||
subPath: cert-check.crt | ||
readOnly: false | ||
{{ end }} | ||
volumes: | ||
- {{ include "spring-boot.config-volume" (dict "service" .Values.backend_cosv) | indent 10 | trim }} | ||
- name: database-secret | ||
secret: | ||
secretName: db-secrets | ||
- name: s3-secrets | ||
secret: | ||
secretName: s3-secrets | ||
- name: migrations-data | ||
emptyDir: {} | ||
- name: ca-certs | ||
configMap: | ||
name: ca-certs |
12 changes: 12 additions & 0 deletions
12
save-cloud-charts/save-cloud/templates/backend-cosv-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
{{- include "service.common.metadata" (dict "service" .Values.backend_cosv) | nindent 2 }} | ||
spec: | ||
{{ if .Values.backend_cosv.clusterIP }} | ||
clusterIP: {{ .Values.backend_cosv.clusterIP }} | ||
{{ end }} | ||
ports: | ||
{{- include "service.common.ports" (dict "service" .Values.backend_cosv) | nindent 4 }} | ||
selector: | ||
{{- include "service.common.selectors" (dict "service" .Values.backend_cosv) | nindent 4 }} |
30 changes: 30 additions & 0 deletions
30
save-cloud-charts/save-cloud/templates/frontend-cosv-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: frontend-cosv | ||
labels: | ||
{{- include "common.labels" (merge (dict "service" .Values.frontend_cosv) .) | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
io.kompose.service: frontend-cosv | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "pod.common.labels" (merge (dict "service" .Values.frontend_cosv ) .) | nindent 8 }} | ||
spec: | ||
restartPolicy: Always | ||
{{- include "cnb.securityContext" . | nindent 6 }} | ||
containers: | ||
- name: frontend-cosv | ||
{{- include "spring-boot.common" (merge (dict "service" .Values.frontend_cosv) .) | nindent 10 }} | ||
env: | ||
- name: PORT | ||
value: '{{ .Values.frontend_cosv.containerPort | toString }}' | ||
resources: | ||
limits: | ||
memory: 200M | ||
requests: | ||
memory: 100M |
9 changes: 9 additions & 0 deletions
9
save-cloud-charts/save-cloud/templates/frontend-cosv-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
{{- include "service.common.metadata" (dict "service" .Values.frontend_cosv) | nindent 2 }} | ||
spec: | ||
ports: | ||
{{- include "service.common.ports" (dict "service" .Values.frontend_cosv) | nindent 4 }} | ||
selector: | ||
{{- include "service.common.selectors" (dict "service" .Values.frontend_cosv) | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosv uses
backend
prefix? @Cheshiriks, it should be renamed