Skip to content

Commit 4ace4fd

Browse files
authored
Merge pull request #147 from holaplex/mpw/hub-nfts-solana-servicemon
Add service, service monitor and update to env vars
2 parents 9b36b3a + baa2267 commit 4ace4fd

File tree

5 files changed

+67
-1
lines changed

5 files changed

+67
-1
lines changed

charts/hub-nfts-solana/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 0.4.1
21+
version: 0.5.0
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to

charts/hub-nfts-solana/templates/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ spec:
3838
name: {{ include "hub-nfts-solana.fullname" . }}
3939
- secretRef:
4040
name: {{ include "hub-nfts-solana.fullname" . }}
41+
ports:
42+
- name: http
43+
containerPort: {{ .Values.environment.port }}
44+
protocol: TCP
45+
livenessProbe:
46+
httpGet:
47+
path: /health
48+
port: http
49+
readinessProbe:
50+
httpGet:
51+
path: /health
52+
port: http
4153
resources:
4254
{{- toYaml .Values.resources | nindent 12 }}
4355
{{- with .Values.nodeSelector }}

charts/hub-nfts-solana/templates/environment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata:
44
name: {{ include "hub-nfts-solana.fullname" . }}
55
data:
66
{{- with .Values.environment }}
7+
PORT: {{ .port | quote }}
78
SOLANA_TREASURY_WALLET_ADDRESS: {{ required "must set solana treasury wallet" .solanaTreasuryWalletAddress | quote }}
89
KAFKA_BROKERS: {{ required "must set kafka brokers" .kafkaBrokers | quote }}
910
KAFKA_USERNAME: {{ required "must set kafka username" .kafkaUsername | quote }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "hub-nfts-solana.fullname" . }}
5+
labels:
6+
{{- include "hub-nfts-solana.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "hub-nfts-solana.selectorLabels" . | nindent 4 }}
16+
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
17+
---
18+
apiVersion: monitoring.coreos.com/v1
19+
kind: ServiceMonitor
20+
metadata:
21+
name: {{ include "hub-nfts-solana.fullname" . }}
22+
{{- if .Release.Namespace }}
23+
namespace: {{ .Release.Namespace }}
24+
{{- end }}
25+
labels:
26+
{{- include "hub-nfts-solana.labels" . | nindent 4 }}
27+
{{- with .Values.serviceMonitor.labels }}
28+
{{- toYaml . | nindent 4 }}
29+
{{- end }}
30+
spec:
31+
endpoints:
32+
- path: /metrics
33+
port: http
34+
scheme: {{ .Values.serviceMonitor.scheme }}
35+
interval: {{ .Values.serviceMonitor.scrapeInterval }}
36+
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
37+
selector:
38+
matchLabels:
39+
app.kubernetes.io/name: {{ include "hub-nfts-solana.name" . }}
40+
app.kubernetes.io/instance: {{ .Release.Name }}
41+
{{- end -}}

charts/hub-nfts-solana/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ securityContext:
5050
runAsUser: 10000
5151
runAsGroup: 10000
5252

53+
service:
54+
type: ClusterIP
55+
port: 80
56+
57+
serviceMonitor:
58+
enabled: true
59+
scheme: http
60+
scrapeInterval: 60s
61+
scrapeTimeout: 30s
62+
labels: {}
63+
5364
resources: {}
5465
# We usually recommend not to specify default resources and to leave this as a conscious
5566
# choice for the user. This also increases chances charts run on environments with little
@@ -101,6 +112,7 @@ secrets:
101112
digitalAssetApiEndpoint: ""
102113

103114
environment:
115+
port: "3000"
104116
kafkaBrokers: "hub-eventbus-cluster-0.hub-eventbus-cluster.default.svc.cluster.local.:9093"
105117
kafkaUsername: ""
106118
kafkaSsl: false

0 commit comments

Comments
 (0)