Skip to content

Commit

Permalink
[stacks-blockchain]: add option for creating a headless service, upda…
Browse files Browse the repository at this point in the history
…te version to 3.0.0.0.0, and use new docker hub repo
  • Loading branch information
CharlieC3 committed Oct 30, 2024
1 parent ca0424c commit 8831280
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 9 deletions.
8 changes: 4 additions & 4 deletions hirosystems/stacks-blockchain/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: bitcoin-core
repository: https://charts.hiro.so/hirosystems
version: 2.1.1
version: 2.1.6
- name: common
repository: https://charts.bitnami.com/bitnami
version: 2.20.4
digest: sha256:98a1ce356690a920ac665a7c16ddbd325234eef8c7739488ad5a4657efa8ff68
generated: "2024-07-15T13:10:02.339923-04:00"
version: 2.26.0
digest: sha256:48465eb6980148f1ccdb593a64ce411028ca493947434d06315373a21a43978d
generated: "2024-10-29T21:09:51.440842-04:00"
4 changes: 2 additions & 2 deletions hirosystems/stacks-blockchain/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
annotations:
category: Blockchain
apiVersion: v2
appVersion: 2.5.0.0.5
appVersion: 3.0.0.0.0
dependencies:
- condition: bitcoin-core.enabled
name: bitcoin-core
Expand Down Expand Up @@ -33,4 +33,4 @@ name: stacks-blockchain
sources:
- https://github.com/stacks-network/stacks-blockchain
- https://docs.stacks.co/
version: 2.1.2
version: 2.2.0
69 changes: 69 additions & 0 deletions hirosystems/stacks-blockchain/templates/service-headless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{{- if .Values.headlessService }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "common.names.fullname" . }}-headless
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: stacks-blockchain
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
{{- if .Values.service.sessionAffinity }}
sessionAffinity: {{ .Values.service.sessionAffinity }}
{{- end }}
{{- if .Values.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
{{- end }}
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
ports:
- name: http-rpc
port: {{ .Values.service.ports.rpc }}
protocol: TCP
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.rpc)) }}
nodePort: {{ .Values.service.nodePorts.rpc }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: tcp-p2p
port: {{ .Values.service.ports.p2p }}
protocol: TCP
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.p2p)) }}
nodePort: {{ .Values.service.nodePorts.p2p }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: tcp-metrics
port: {{ .Values.service.ports.metrics }}
protocol: TCP
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.metrics)) }}
nodePort: {{ .Values.service.nodePorts.metrics }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if .Values.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: stacks-blockchain
{{- end }}
9 changes: 6 additions & 3 deletions hirosystems/stacks-blockchain/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ diagnosticMode:
##
image:
registry: docker.io
repository: blockstack/stacks-blockchain
tag: 2.5.0.0.5
repository: blockstack/stacks-core
tag: 3.0.0.0.0
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
Expand Down Expand Up @@ -403,9 +403,12 @@ initContainers: []

## @section Traffic Exposure Parameters

## @param uniqueServices Create one service connecting to each stacks-blockchain pod
## @param singleService Create one service connecting to each stacks-blockchain pod
##
singleService: false
## @param headlessService Create a headless service
##
headlessService: false
## @param uniqueServices Create a unique service for each stacks-blockchain pod
##
uniqueServices: true
Expand Down

0 comments on commit 8831280

Please sign in to comment.