Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
feat: Update Helm Chart With new components
Browse files Browse the repository at this point in the history
  • Loading branch information
a-khaledf committed Jul 25, 2023
1 parent 97a300c commit 0e4f5ce
Show file tree
Hide file tree
Showing 11 changed files with 627 additions and 138 deletions.
2 changes: 2 additions & 0 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: Axiom Private
type: application
version: 0.21.0
appVersion: 1.21.0
kubeVersion: ">=1.16.0-0"
home: https://github.com/axiomhq/axiom-helm-charts
maintainers:
- name: Axiom Inc.
email: hello@axiom.co
117 changes: 117 additions & 0 deletions templates/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "axiom.fullname" . }}-api
labels:
{{- include "axiom.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app: {{ template "axiom.fullname" . }}-api
replicas: {{ .Values.api.replicas }}
template:
metadata:
labels:
app: {{ template "axiom.fullname" . }}-api
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "axiom.fullname" . }}-api
topologyKey: "kubernetes.io/hostname"
topologySpreadConstraints:
- labelSelector:
matchLabels:
app: {{ template "axiom.fullname" . }}-api
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
containers:
- name: axiom-api-pod
mage: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
args: ["serve", "api"]
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /metrics
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
httpGet:
path: /metrics
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
resources:
{{- toYaml .Values.api.resources | nindent 10 }}
{{- with .Values.api.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
env:
- name: AXIOM_MODE
value: self-host
- name: AXIOM_DB_URL
value: http://{{ template "axiom.fullname" . }}-db-service
- name: AXIOM_DB_QUERY_URL
value: http://{{ template "axiom.fullname" . }}-db-query-runner
- name: AXIOM_REDIS_URL
valueFrom:
secretKeyRef:
name: {{ template "axiom.fullname" . }}-secrets
key: redis-url
- name: AXIOM_APP_URL
valueFrom:
configMapKeyRef:
name: {{ template "axiom.fullname" . }}-config
key: public-url
- name: AXIOM_PUBLIC_URL
valueFrom:
configMapKeyRef:
name: {{ template "axiom.fullname" . }}-config
key: public-url
- name: AXIOM_PUBLIC_API_URL
valueFrom:
configMapKeyRef:
name: {{ template "axiom.fullname" . }}-config
key: public-api-url
- name: AXIOM_ASSET_URL
valueFrom:
configMapKeyRef:
name: {{ template "axiom.fullname" . }}-config
key: assets-url
optional: true
{{- range .Values.api.extraEnvs }}
- name: {{ quote .name }}
value: {{ quote .value }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.api.podSecurityContext | nindent 8 }}
{{- with .Values.api.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
77 changes: 77 additions & 0 deletions templates/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "axiom.fullname" . }}-app
spec:
selector:
matchLabels:
app: {{ template "axiom.fullname" . }}-app
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
template:
metadata:
labels:
app: {{ template "axiom.fullname" . }}-app
spec:
topologySpreadConstraints:
- labelSelector:
matchLabels:
app: {{ template "axiom.fullname" . }}-app
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
containers:
- name: axiom-app-pod
image: "{{ .Values.app.image.repository }}:{{ .Values.app.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.app.image.pullPolicy }}
ports:
- containerPort: 3000
resources:
{{- toYaml .Values.app.resources | nindent 10 }}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 3000
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 1
{{- with .Values.app.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
env:
- name: AWS_ELB
value: "1"
- name: HOST_MODE
value: "self-host"
- name: API_URL_INTERNAL
value: "http://{{ template "axiom.fullname" . }}-api"
- name: LOGIN_URL
value: "http://{{ template "axiom.fullname" . }}-login"
- name: LOGIN_URL_INTERNAL
value: "http://{{ template "axiom.fullname" . }}-login"
- name: LOGIN_TOKEN
value: ""
- name: NEXTAUTH_SECRET
valueFrom:
secretKeyRef:
name: {{ template "axiom.fullname" . }}-secrets
key: nexauth-secret
- name: NEXTAUTH_URL
value: "https://aws1.dev.axiomtestlabs.co/frapi/auth"
{{- range .Values.app.extraEnvs }}
- name: {{ quote .name }}
value: {{ quote .value }}
{{- end }}
{{- with .Values.app.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
terminationGracePeriodSeconds: 60
99 changes: 0 additions & 99 deletions templates/core.yaml

This file was deleted.

Loading

0 comments on commit 0e4f5ce

Please sign in to comment.