{{- if .Values.app.prometheus.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "fuel-core.name" . }}-service-monitor labels: release: {{ .Values.app.prometheus.helm_release_name }} spec: selector: matchLabels: app: {{ .Values.app.selector_name }} endpoints: - path: /v1/metrics port: http {{- end }} --- {{- if .Values.app.volume.pvc_clone_enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ .Values.app.volume.claimname }} labels: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: accessModes: - {{ .Values.app.volume.accessmodes }} resources: requests: storage: {{ .Values.app.volume.storagerequests }} storageClassName: {{ .Values.app.volume.storageclass }} dataSource: name: {{ .Values.app.volume.pvc_clone_snapshot_id }} kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io {{ else }} apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ .Values.app.volume.claimname }} labels: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: accessModes: - {{ .Values.app.volume.accessmodes }} resources: requests: storage: {{ .Values.app.volume.storagerequests }} storageClassName: {{ .Values.app.volume.storageclass }} {{- end }} --- apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-chainspec-configmap data: chainspec.json: |- {{ .Files.Get "chainspec.json" | indent 4 }} --- {{- if .Values.app.sentry_enabled }} kind: Service apiVersion: v1 metadata: labels: app: {{ .Values.app.selector_name }} chart: {{ template "fuel-core.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} name: {{ template "fuel-core.name" . }}-lb-service spec: type: ClusterIP sessionAffinity: ClientIP selector: app: {{ .Values.app.selector_name }} ports: - name: http port: {{ .Values.app.http_port }} protocol: TCP targetPort: {{ .Values.app.target_port }} {{- end }} --- kind: Service apiVersion: v1 metadata: labels: app: {{ .Values.app.selector_name }} chart: {{ template "fuel-core.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} name: {{ template "fuel-core.name" . }}-service spec: type: NodePort selector: app: {{ .Values.app.selector_name }} ports: - name: http port: {{ .Values.app.http_port }} protocol: TCP targetPort: {{ .Values.app.target_port }} - name: p2p port: {{ .Values.app.peering_port }} protocol: TCP targetPort: {{ .Values.app.peering_port }} --- apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "fuel-core.name" . }}-k8s labels: app: {{ .Values.app.selector_name }} chart: {{ template "fuel-core.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: selector: matchLabels: app: {{ .Values.app.selector_name }} release: {{ .Release.Name }} replicas: {{ .Values.app.replicas }} strategy: type: Recreate template: metadata: labels: app: {{ .Values.app.selector_name }} release: {{ .Release.Name }} spec: containers: - name: {{ .Values.app.name }} image: "{{ .Values.app.image.repository }}:{{ .Values.app.image.tag }}" command: ["./fuel-core"] args: - "run" - "--ip" - "0.0.0.0" - "--port" - "{{ .Values.app.target_port }}" - "--db-path" - "{{ .Values.app.volume.mountPath }}" - "--chain" - "/mnt/config/chainspec.json" - "--min-gas-price" - "{{ .Values.app.min_gas_price }}" {{- if .Values.app.name }} - "--service-name" - "{{ .Values.app.name }}" {{- end}} {{- if .Values.app.utxo_validation }} - "--utxo-validation" {{- end}} {{- if .Values.app.vm_backtrace }} - "--vm-backtrace" {{- end}} {{- if .Values.app.poa_instant }} - "--poa-instant" - "{{ .Values.app.poa_instant }}" {{- end}} {{- if .Values.app.poa_interval_period }} - "--poa-interval-period" - "{{ .Values.app.poa_interval_period }}" {{- end}} {{- if .Values.app.relayer }} - "--relayer" - "{{ .Values.app.relayer }}" {{- end }} {{- if .Values.app.relayer_v2_listening_contracts }} - "--relayer-v2-listening-contracts" - "{{ .Values.app.relayer_v2_listening_contracts }}" {{- end }} {{- if .Values.app.relayer_da_finalization }} - "--relayer-da-finalization" - "{{ .Values.app.relayer_da_finalization }}" {{- end }} {{- if .Values.app.relayer_da_deploy_height }} - "--relayer-da-deploy-height" - "{{ .Values.app.relayer_da_deploy_height }}" {{- end }} {{- if .Values.app.relayer_log_page_size }} - "--relayer-log-page-size" - "{{ .Values.app.relayer_log_page_size }}" {{- end }} {{- if .Values.app.relayer_min_duration_s }} - "--relayer-min-duration-s" - "{{ .Values.app.relayer_min_duration_s }}" {{- end }} {{- if .Values.app.relayer_eth_sync_call_freq_s }} - "--relayer-eth-sync-call-freq-s" - "{{ .Values.app.relayer_eth_sync_call_freq_s }}" {{- end }} {{- if .Values.app.relayer_eth_sync_log_freq_s }} - "--relayer-eth-sync-log-freq-s" - "{{ .Values.app.relayer_eth_sync_log_freq_s }}" {{- end }} {{- if .Values.app.network_name }} - "--network" - "{{ .Values.app.network_name }}" {{- end }} {{- if .Values.app.p2p_key }} - "--keypair" - "{{ .Values.app.p2p_key }}" {{- end }} {{- if .Values.app.peering_port }} - "--peering-port" - "{{ .Values.app.peering_port }}" {{- end }} {{- if .Values.app.max_block_size }} - "--max-block-size" - "{{ .Values.app.max_block_size }}" {{- end }} {{- if .Values.app.max_headers_per_request }} - "--max-headers-per-request" - "{{ .Values.app.max_headers_per_request }}" {{- end }} {{- if .Values.app.max_database_cache_size }} - "--max-database-cache-size" - "{{ .Values.app.max_database_cache_size }}" {{- end }} {{- if .Values.app.max_transmit_size }} - "--max-transmit-size" - "{{ .Values.app.max_transmit_size }}" {{- end }} {{- if .Values.app.heartbeat_check_interval }} - "--heartbeat-check-interval" - "{{ .Values.app.heartbeat_check_interval }}" {{- end }} {{- if .Values.app.heartbeat_max_avg_interval }} - "--heartbeat-max-avg-interval" - "{{ .Values.app.heartbeat_max_avg_interval }}" {{- end }} {{- if .Values.app.heartbeat_max_time_since_last }} - "--heartbeat-max-time-since-last" - "{{ .Values.app.heartbeat_max_time_since_last }}" {{- end }} {{- if .Values.app.sync_block_stream_size }} - "--sync-block-stream-size" - "{{ .Values.app.sync_block_stream_size }}" {{- end }} {{- if .Values.app.sync_header_batch_size }} - "--sync-header-batch-size" - "{{ .Values.app.sync_header_batch_size }}" {{- end }} {{- if .Values.app.reserved_nodes_only_mode }} - "--reserved-nodes-only-mode" {{- end}} {{- if .Values.app.allow_private_addresses }} - "--allow-private-addresses" {{- end }} {{- if .Values.app.pyroscope_url }} - "--pyroscope-url" - "{{ .Values.app.pyroscope_url }}" {{- end }} {{- if .Values.app.pprof_sample_rate }} - "--pprof-sample-rate" - "{{ .Values.app.pprof_sample_rate }}" {{- end }} resources: limits: cpu: {{ .Values.app.resources.cpu_limits }} memory: {{ .Values.app.resources.memory_limits }} requests: cpu: {{ .Values.app.resources.cpu_requests }} memory: {{ .Values.app.resources.memory_requests }} imagePullPolicy: {{ .Values.app.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.app.target_port }} protocol: TCP - name: p2p containerPort: {{ .Values.app.peering_port }} protocol: TCP livenessProbe: httpGet: path: /v1/health port: {{ .Values.app.target_port }} initialDelaySeconds: 300 periodSeconds: 5 timeoutSeconds: 10 volumeMounts: - name: {{ .Values.app.volume.pvname }} mountPath: "{{ .Values.app.volume.mountPath }}" - name: config mountPath: "/mnt/config" env: - name: HUMAN_LOGGING value: {{ .Values.app.human_logging | quote }} {{- if .Values.app.reserved_nodes }} - name: RESERVED_NODES value: {{ .Values.app.reserved_nodes | quote }} {{- end }} {{- if .Values.app.bootstrap_nodes }} - name: BOOTSTRAP_NODES value: {{ .Values.app.bootstrap_nodes | quote }} {{- end }} {{- if .Values.app.rust_log }} - name: RUST_LOG value: {{ .Values.app.rust_log | quote }} {{- end }} # TODO: do we need to do anything to make this more optional for non-consensus nodes? - name: CONSENSUS_KEY_SECRET valueFrom: secretKeyRef: name: fuel-core-secret key: CONSENSUS_KEY_SECRET volumes: - name: {{ .Values.app.volume.pvname }} persistentVolumeClaim: claimName: {{ .Values.app.volume.claimname }} - name: config configMap: name: {{ .Release.Name }}-chainspec-configmap