Skip to content

Commit

Permalink
fixes for kubernetes deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
acies312 committed Mar 6, 2024
1 parent 9d11f7c commit fc85f09
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
gateway.backend.url=http://backend
gateway.frontend.url=http://frontend
gateway.demo-cpg.url=http://demo-cpg
gateway.backend-cosv.url=http://backend-cosv
gateway.frontend-cosv.url=http://frontend-cosv
gateway.demo.url=http://demo
server.shutdown=graceful
Expand Down
2 changes: 2 additions & 0 deletions cosv-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ dependencies {
implementation(libs.spring.security.core)
implementation(libs.spring.data.jpa)
implementation(libs.hibernate.jpa21.api)
// needed for kubernetes configs and secrets to be added as additional configurations
implementation(libs.spring.cloud.starter.kubernetes.client.config)
}
18 changes: 11 additions & 7 deletions cosv-backend/src/main/resources/application-kubernetes.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
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-cosv-url=http://backend-cosv
cosv.preprocessor-url=http://preprocessor
cosv.orchestrator-url=http://orchestrator
cosv.demo-url=http://demo
cosv.loki.url=http://loki:3100
cosv.loki.labels.agent-container-name=pod
cosv.loki.labels.application-name=app
cosv.agent-settings.backend-cosv-url=http://backend-cosv
cosv.gatewayUrl=http://gateway
server.shutdown=graceful
management.endpoints.web.exposure.include=*
management.server.port=5701
spring.datasource.url=${spring.datasource.backend-cosv-url}
spring.second-datasource.jdbc-url = ${spring.datasource.backend-url}
spring.second-datasource.username = ${spring.datasource.username}
spring.second-datasource.password = ${spring.datasource.password}
logging.level.org.springframework=DEBUG
logging.level.com.saveourtool=DEBUG
1 change: 1 addition & 0 deletions cosv-backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ cosv.s3-storage.bucketName=${s3-storage.bucketName}
cosv.s3-storage.prefix=cnb/files
cosv.s3-storage.credentials.accessKeyId=${s3-storage.credentials.accessKeyId}
cosv.s3-storage.credentials.secretAccessKey=${s3-storage.credentials.secretAccessKey}
cosv.working-dir=/home/cnb/cosv-working-dir
8 changes: 6 additions & 2 deletions save-cloud-charts/save-cloud/templates/backend-cosv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
runAsGroup: 1001
args:
- --url=$(DB_URL)?createDatabaseIfNotExist=true
- --changeLogFile=db/db.changelog-master.xml
- --changeLogFile=cosv-backend/db/db.changelog-cosv.xml
- --username=$(DB_USERNAME)
- --password=$(DB_PASSWORD)
- --log-level=info
Expand All @@ -96,7 +96,7 @@ spec:
valueFrom:
secretKeyRef:
name: db-secrets
key: spring.datasource.backend-url
key: spring.datasource.backend-cosv-url
- name: DB_USERNAME
valueFrom:
secretKeyRef:
Expand All @@ -117,10 +117,12 @@ spec:
name: migrations-data
- mountPath: {{ .Values.mysql.dbPasswordFile }}
name: database-secret
{{ if .Values.gateway.initCerts.enabled }}
- name: ca-pemstore
mountPath: /etc/ssl/certs/ca-certificates.crt
subPath: ca-certificates.crt
readOnly: false
{{ end }}
volumes:
- {{ include "spring-boot.config-volume" (dict "service" .Values.backend_cosv) | indent 10 | trim }}
- name: database-secret
Expand All @@ -131,9 +133,11 @@ spec:
secretName: s3-secrets
- name: migrations-data
emptyDir: {}
{{ if .Values.gateway.initCerts.enabled }}
- name: ca-pemstore
configMap:
name: ca-pemstore
{{ if .Values.gateway.initCerts.enabled }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
26 changes: 15 additions & 11 deletions save-cloud-charts/save-cloud/templates/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ spec:
name: migrations-data
- mountPath: {{ .Values.mysql.dbPasswordFile }}
name: database-secret
{{ if .Values.gateway.initCerts.enabled }}
- name: ca-pemstore
mountPath: /etc/ssl/certs/ca-certificates.crt
subPath: ca-certificates.crt
readOnly: false
{{ end }}
volumes:
- {{ include "spring-boot.config-volume" (dict "service" .Values.backend) | indent 10 | trim }}
- name: database-secret
Expand All @@ -131,9 +133,21 @@ spec:
secretName: s3-secrets
- name: migrations-data
emptyDir: {}
{{ if .Values.gateway.initCerts.enabled }}
- name: ca-pemstore
configMap:
name: ca-pemstore
{{ end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.backend.name }}-config
data:
application.properties: |
{{ if .Values.backend.applicationProperties }}
{{- .Values.backend.applicationProperties | nindent 4 }}
{{ end }}
---
apiVersion: v1
kind: Service
Expand All @@ -146,14 +160,4 @@ spec:
ports:
{{- include "service.common.ports" (dict "service" .Values.backend) | nindent 4 }}
selector:
{{- include "service.common.selectors" (dict "service" .Values.backend) | nindent 4 }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.backend.name }}-config
data:
application.properties: |
{{ if .Values.backend.applicationProperties }}
{{- .Values.backend.applicationProperties | nindent 4 }}
{{ end }}
{{- include "service.common.selectors" (dict "service" .Values.backend) | nindent 4 }}
37 changes: 0 additions & 37 deletions save-cosv-frontend/src/main/resources/img/codehub.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ val logoButtons: FC<Props> = FC {

logo(
"VULN",
"https://cosv.gitlink.org.cn/${FrontendCosvRoutes.VULN}",
"https://cosv.gitlink.org.cn",
"Archive of 1-Day Vulnerabilities Aggregated from Various Sources".t(),
"/img/vuln-logo-bg.png",

Expand Down

0 comments on commit fc85f09

Please sign in to comment.