Skip to content

Commit

Permalink
Merge pull request #3 from ComposableFi/indexer-chart
Browse files Browse the repository at this point in the history
Indexer chart
  • Loading branch information
lbd-cloud authored May 22, 2024
2 parents 304d8c1 + b8a587b commit 3f0860f
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 96 deletions.
10 changes: 10 additions & 0 deletions charts/indexer/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
labels:
{{- include "autocompounder.labels" . | nindent 4 }}
data:
{{- range $key, $value := .Values.appConfig.env }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
55 changes: 21 additions & 34 deletions charts/indexer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,44 @@ metadata:
labels:
{{- include "indexer.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "indexer.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
labels:
{{- include "indexer.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "indexer.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
- containerPort: {{ .Values.service.port }}
env:
{{- range $key, $value := .Values.appConfig.env }}
- name: {{ $key }}
value: "{{ $value }}"
{{- end }}
{{- if .Values.appSecret.enabled }}
{{- range $key, $value := .Values.appSecret.env }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ $value }}
key: {{ $key | lower }}
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- toYaml .Values.tolerations | nindent 8 }}
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
11 changes: 11 additions & 0 deletions charts/indexer/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.appSecret.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}
type: Opaque
data:
{{- range $key, $value := .Values.appSecret.env }}
{{ $key | quote }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/indexer/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
name: http
selector:
Expand Down
98 changes: 37 additions & 61 deletions charts/indexer/values.yaml
Original file line number Diff line number Diff line change
@@ -1,82 +1,58 @@
# Default values for indexer.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# General application settings
replicaCount: 1

image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
# Optional name and fullname overrides
nameOverride: ""
fullnameOverride: ""

# Service Account
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

# Image configuration
image:
repository: ghcr.io/composablefi/composable-indexer
tag: latest
pullPolicy: IfNotPresent

# Service configuration
service:
type: ClusterIP
port: 8080
targetPort: 8080

# Application configuration environment variables
appConfig:
env:
NODE_ENV: production

# Application secret environment variables
appSecret:
enabled: true
env:
DB_HOST: localhost
DB_PORT: 5432
DB_DATABASE: mydatabase
DB_USERNAME: secretKeyRefName
DB_PASSWORD: secretKeyRefName

# Security context for the deployments
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 80

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

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
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}
affinity: {}

0 comments on commit 3f0860f

Please sign in to comment.