Skip to content

Commit

Permalink
Merge pull request #147 from holaplex/mpw/hub-nfts-solana-servicemon
Browse files Browse the repository at this point in the history
Add service, service monitor and update to env vars
  • Loading branch information
mpwsh authored Sep 15, 2023
2 parents 9b36b3a + baa2267 commit 4ace4fd
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/hub-nfts-solana/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.1
version: 0.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
12 changes: 12 additions & 0 deletions charts/hub-nfts-solana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ spec:
name: {{ include "hub-nfts-solana.fullname" . }}
- secretRef:
name: {{ include "hub-nfts-solana.fullname" . }}
ports:
- name: http
containerPort: {{ .Values.environment.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: http
readinessProbe:
httpGet:
path: /health
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
1 change: 1 addition & 0 deletions charts/hub-nfts-solana/templates/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "hub-nfts-solana.fullname" . }}
data:
{{- with .Values.environment }}
PORT: {{ .port | quote }}
SOLANA_TREASURY_WALLET_ADDRESS: {{ required "must set solana treasury wallet" .solanaTreasuryWalletAddress | quote }}
KAFKA_BROKERS: {{ required "must set kafka brokers" .kafkaBrokers | quote }}
KAFKA_USERNAME: {{ required "must set kafka username" .kafkaUsername | quote }}
Expand Down
41 changes: 41 additions & 0 deletions charts/hub-nfts-solana/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "hub-nfts-solana.fullname" . }}
labels:
{{- include "hub-nfts-solana.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "hub-nfts-solana.selectorLabels" . | nindent 4 }}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "hub-nfts-solana.fullname" . }}
{{- if .Release.Namespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "hub-nfts-solana.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- path: /metrics
port: http
scheme: {{ .Values.serviceMonitor.scheme }}
interval: {{ .Values.serviceMonitor.scrapeInterval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hub-nfts-solana.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
12 changes: 12 additions & 0 deletions charts/hub-nfts-solana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ securityContext:
runAsUser: 10000
runAsGroup: 10000

service:
type: ClusterIP
port: 80

serviceMonitor:
enabled: true
scheme: http
scrapeInterval: 60s
scrapeTimeout: 30s
labels: {}

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down Expand Up @@ -101,6 +112,7 @@ secrets:
digitalAssetApiEndpoint: ""

environment:
port: "3000"
kafkaBrokers: "hub-eventbus-cluster-0.hub-eventbus-cluster.default.svc.cluster.local.:9093"
kafkaUsername: ""
kafkaSsl: false
Expand Down

0 comments on commit 4ace4fd

Please sign in to comment.