Skip to content

Commit

Permalink
Update chart to support upstream images
Browse files Browse the repository at this point in the history
Signed-off-by: beeradb <[email protected]>
  • Loading branch information
beeradb committed May 23, 2024
1 parent fbbbd17 commit 2751cf9
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 29 deletions.
22 changes: 19 additions & 3 deletions charts/templates/server-repository/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
{{- if .Values.serverRepository.annotations }}
annotations:
{{ toYaml .Values.serverRepository.annotations | indent 4 }}
{{- end }}
{{- end }}
data:
REPOSITORY_PATH: {{ .Values.serverRepository.config.REPOSITORY_PATH }}
SERVER_URL: {{ .Values.serverRepository.config.SERVER_URL }}
Expand All @@ -20,7 +20,7 @@ data:
TESTING: {{ .Values.serverRepository.config.TESTING | quote }}
NODE_ENV: {{ .Values.serverRepository.config.NODE_ENV | default "development" }}
UI_DOMAIN_NAME: {{ .Values.serverRepository.config.UI_DOMAIN_NAME }}

SOURCIFY_SERVER: {{ .Values.serverRepository.config.SERVER_URL }}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -35,4 +35,20 @@ metadata:
{{- end }}
data:
config.json: |-
{{- .Values.serverRepository.config.repository | toJson | nindent 4 }}
{{- .Values.serverRepository.config.repository | toJson | nindent 4 }}
servers.yaml: |-
{{- .Values.serverRepository.config.servers | toYaml | nindent 4 }}
sourcify-chains.json: |-
{{- .Values.serverRepository.config.sourcifyChains | toJson | nindent 4 }}
local.js: |
module.exports = {
corsAllowedOrigins: [
/^https?:\/\/(?:.+\.)?sourcify.dev$/, // sourcify.dev and subdomains
/^https?:\/\/(?:.+\.)?sourcify.eth$/, // sourcify.eth and subdomains
/^https?:\/\/(?:.+\.)?sourcify.eth.link$/, // sourcify.eth.link and subdomains
/^https?:\/\/(?:.+\.)?ipfs.dweb.link$/, // dweb links used by Brave browser etc.
/^https?:\/\/(?:.+\.)?hedera-devops.com$/, // swirldslabs-devops
/^https?:\/\/(?:.+\.)?hashscan.io$/, // hashscan
process.env.NODE_ENV !== "production" && /^https?:\/\/localhost(?::\d+)?$/, // localhost on any port /^{{ .Values.serverRepository.config.SERVER_URL }}$/
],
};
33 changes: 21 additions & 12 deletions charts/templates/server-repository/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- if .Values.serverRepository.annotations }}
annotations:
{{ toYaml .Values.serverRepository.annotations | indent 4 }}
{{- end }}
{{- end }}
spec:
{{- if not .Values.serverRepository.autoscaling.enabled }}
replicas: {{ .Values.serverRepository.replicaCount }}
Expand All @@ -34,12 +34,12 @@ spec:
{{- if .Values.serverRepository.podSecurityContext }}
securityContext:
{{- toYaml .Values.serverRepository.podSecurityContext | nindent 8 }}
{{- end }}
containers:
{{- end }}
containers:
- name: {{ printf "%s-%s" .Chart.Name "server" }}
securityContext:
{{- toYaml .Values.serverRepository.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.serverRepository.image.server.tag | default "server-latest" }}"
image: "{{ .Values.serverRepository.image.server.repository }}:{{ .Values.serverRepository.image.server.tag | default "server-latest" }}"
imagePullPolicy: {{ .Values.serverRepository.image.pullPolicy }}
envFrom:
- configMapRef:
Expand All @@ -58,22 +58,31 @@ spec:
path: /health
port: serverport
periodSeconds: 10
failureThreshold: 6
failureThreshold: 6
{{- if .Values.serverRepository.server.resources }}
resources:
{{- toYaml .Values.serverRepository.server.resources | nindent 12 }}
{{- end }}
volumeMounts:
- name: {{ .Chart.Name }}
mountPath: /data
- name: {{ printf "%s-%s" .Chart.Name "repository" }}
mountPath: /home/app/services/server/dist/config/local.js
subPath: local.js
- name: {{ printf "%s-%s" .Chart.Name "repository" }}
mountPath: /home/app/services/server/dist/sourcify-chains.json
subPath: sourcify-chains.json
- name: {{ printf "%s-%s" .Chart.Name "repository" }}
mountPath: /home/app/services/server/dist/servers.yaml
subPath: servers.yaml
- name: {{ printf "%s-%s" .Chart.Name "repository" }}
securityContext:
{{- toYaml .Values.serverRepository.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.serverRepository.image.repository.tag | default "repository-latest" }}"
image: "{{ .Values.serverRepository.image.repository.repository }}:{{ .Values.serverRepository.image.repository.tag | default "repository-latest" }}"
imagePullPolicy: {{ .Values.serverRepository.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ template "sourcify.name" . }}
name: {{ template "sourcify.name" . }}
ports:
- name: repositoryport
containerPort: {{ .Values.serverRepository.service.repository.port }}
Expand All @@ -87,7 +96,7 @@ spec:
httpGet:
path: /select-contract/health
port: repositoryport
periodSeconds: 10
periodSeconds: 10
{{- if .Values.serverRepository.repository.resources }}
resources:
{{- toYaml .Values.serverRepository.repository.resources | nindent 12 }}
Expand All @@ -98,7 +107,7 @@ spec:
readOnly: true
- name: {{ printf "%s-%s" .Chart.Name "repository" }}
mountPath: /redirects/config.json
subPath: config.json
subPath: config.json
{{- if .Values.serverRepository.nodeSelector }}
nodeSelector:
{{- toYaml .Values.serverRepository.nodeSelector | nindent 8 }}
Expand All @@ -117,11 +126,11 @@ spec:
persistentVolumeClaim:
claimName: {{ template "sourcify.name" . }}-pvc
{{- else }}
volumes:
volumes:
- name: {{ .Chart.Name }}
emptyDir: {}
{{- end }}
- configMap:
name: {{ printf "%s-%s" .Chart.Name "repository" }}
name: {{ printf "%s-%s" .Chart.Name "repository" }}
{{- end -}}
name: {{ printf "%s-%s" .Chart.Name "repository" }}
{{- end -}}
10 changes: 5 additions & 5 deletions charts/templates/ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- if .Values.ui.annotations }}
annotations:
{{ toYaml .Values.ui.annotations | indent 4 }}
{{- end }}
{{- end }}
spec:
{{- if not .Values.ui.autoscaling.enabled }}
replicas: {{ .Values.ui.replicaCount }}
Expand All @@ -34,15 +34,15 @@ spec:
{{- if .Values.ui.podSecurityContext}}
securityContext:
{{- toYaml .Values.ui.podSecurityContext | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-ui
env:
- name: UI_DOMAIN_NAME
value: {{ .Values.ui.env.UI_DOMAIN_NAME }}
securityContext:
{{- toYaml .Values.ui.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.ui.image.tag | default "ui-latest" }}"
image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag | default "ui-latest" }}"
imagePullPolicy: {{ .Values.ui.image.pullPolicy }}
ports:
- name: http
Expand All @@ -59,7 +59,7 @@ spec:
volumes:
- configMap:
name: {{ printf "%s-%s" .Chart.Name "ui" }}
name: {{ printf "%s-%s" .Chart.Name "ui" }}
name: {{ printf "%s-%s" .Chart.Name "ui" }}
{{- if .Values.ui.nodeSelector }}
nodeSelector:
{{- toYaml .Values.ui.nodeSelector | nindent 8 }}
Expand All @@ -72,4 +72,4 @@ spec:
tolerations:
{{- toYaml .Values.ui.tolerations | nindent 8 }}
{{- end }}
{{- end -}}
{{- end -}}
48 changes: 39 additions & 9 deletions charts/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
nameoOverride: ""
fullnameOverride: ""
imagePullSecrets: []
image:
repository: "ghcr.io/hashgraph/hedera-sourcify"

serverRepository:
## Deploy sourcify server-repository
Expand Down Expand Up @@ -41,9 +39,11 @@ serverRepository:
## server-repository image configuration, image repository is defined in the global image section above
image:
server:
tag: "server-latest"
repository: ghcr.io/hashgraph/hedera-sourcify/server
tag: "test"
repository:
tag: "repository-latest"
repository: ghcr.io/hashgraph/hedera-sourcify/repository
tag: "test"
pullPolicy: "IfNotPresent"

## server-repository serviceAccount creation and configuration
Expand Down Expand Up @@ -86,7 +86,37 @@ serverRepository:
"REPOSITORY_SERVER_URL": "http://127.0.0.1:10000",
"EXPLORER_URL": "http://127.0.0.1:8080",
}

servers:
- description: The current REST API server
url: ""
- description: The production REST API server
url: "https://server-verify.hashscan.io"
- description: The staging REST API server
url: "https://server-sourcify.hedera-devops.com"
- description: Local development server address on default port 5555
url: "http://localhost:5555"
sourcifyChains:
{
"295": {
"sourcifyName": "Hedera Mainnet",
"supported": true
},
"296": {
"sourcifyName": "Hedera Testnet",
"supported": true
},
"297": {
"sourcifyName": "Hedera Previewnet",
"supported": true
},
"298": {
"sourcifyName": "Hedera Localnet",
"supported": true,
"rpc": [
"http://host.docker.internal:7546"
]
}
}
ui:
## Deploy sourcify ui
enabled: true
Expand Down Expand Up @@ -119,7 +149,8 @@ ui:

## UI image configuration, image repository is defined in the global image section above
image:
tag: "ui-latest"
repository: ghcr.io/hashgraph/hedera-sourcify/ui
tag: "test"
pullPolicy: "IfNotPresent"

## UI serviceAccount creation and configuration
Expand Down Expand Up @@ -152,14 +183,13 @@ ui:

reset:
## Previewnet reset job, default is to disable
previewnet_reset:
previewnet_reset:
enabled: false
## Testnet reset job, default is to disable
testnet_reset:
enabled: false
enabled: false
## Set default immage repository, tag, and pull policy
image:
repository: "bitnami/kubectl"
tag: "1.28.7"
pullPolicy: "IfNotPresent"

0 comments on commit 2751cf9

Please sign in to comment.