Skip to content

Commit

Permalink
add storefront
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriiKosiy committed Jan 20, 2025
1 parent f284d78 commit 21c6522
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 79 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: saleor
description: A Helm chart for Saleor e-commerce platform
type: application
version: 0.1.57
version: 0.1.58
appVersion: "3.20"
44 changes: 0 additions & 44 deletions templates/search-deployment.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions templates/search-service.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions templates/storefront-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "saleor.fullname" . }}-storefront-config
labels:
{{- include "saleor.labels" . | nindent 4 }}
data:
NEXT_PUBLIC_SALEOR_API_URL: {{ .Values.storefront.env.NEXT_PUBLIC_SALEOR_API_URL | quote }}
NEXT_PUBLIC_STOREFRONT_URL: {{ .Values.storefront.env.NEXT_PUBLIC_STOREFRONT_URL | quote }}
SALEOR_APP_TOKEN: {{ .Values.storefront.env.SALEOR_APP_TOKEN | quote }}
NEXT_PUBLIC_URL: {{ .Values.storefront.env.NEXT_PUBLIC_URL | quote }}
NEXT_SECRET_NEWSLETTER_ENDPOINT: {{ .Values.storefront.env.NEXT_SECRET_NEWSLETTER_ENDPOINT | quote }}
NEXT_SALEOR_TOKEN: {{ .Values.storefront.env.NEXT_SALEOR_TOKEN | quote }}
NEXT_PUBLIC_SALEOR_TOKEN: {{ .Values.storefront.env.NEXT_PUBLIC_SALEOR_TOKEN | quote }}
NEXT_PUBLIC_CHANNEL_ID: {{ .Values.storefront.env.NEXT_PUBLIC_CHANNEL_ID | quote }}
NEXT_PUBLIC_ALGOLIA_APP_ID: {{ .Values.storefront.env.NEXT_PUBLIC_ALGOLIA_APP_ID | quote }}
NEXT_PUBLIC_ALGOLIA_API_KEY: {{ .Values.storefront.env.NNEXT_PUBLIC_ALGOLIA_API_KEY | quote }}
NEXT_PUBLIC_ALGOLIA_INDEX_NAME: {{ .Values.storefront.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME | quote }}
44 changes: 44 additions & 0 deletions templates/storefront-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{- if .Values.storefront.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "saleor.fullname" . }}-storefront
labels:
{{- include "saleor.labels" . | nindent 4 }}
app.kubernetes.io/component: storefront
spec:
replicas: {{ .Values.storefront.replicas }}
selector:
matchLabels:
{{- include "saleor.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: storefront
template:
metadata:
labels:
{{- include "saleor.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: storefront
spec:
imagePullSecrets:
- name: ghcr-secret
containers:
- name: storefront
image: "{{ .Values.storefront.image.repository }}:{{ .Values.storefront.image.tag }}"
imagePullPolicy: {{ .Values.storefront.image.pullPolicy }}
ports:
- containerPort: 3000
envFrom:
- configMapRef:
name: {{ include "saleor.fullname" . }}-storefront-config
- secretRef:
name: {{ include "saleor.fullname" . }}-secret
volumeMounts:
- name: storefront-static-files
mountPath: /app/.next/static
{{- with .Values.storefront.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: storefront-static-files
emptyDir: {}
{{- end }}
18 changes: 18 additions & 0 deletions templates/storefront-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.storefront.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "saleor.fullname" . }}-storefront
labels:
{{- include "saleor.labels" . | nindent 4 }}
app.kubernetes.io/component: storefront
spec:
type: ClusterIP
ports:
- name: http
port: 3000
targetPort: 3000
selector:
{{- include "saleor.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: storefront
{{- end }}
37 changes: 22 additions & 15 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,32 @@ worker:
pullPolicy: IfNotPresent
resources: {}

search:
storefront:
enabled: false
replicaCount: 1
replicas: 2
image:
repository: ghcr.io/saleor/apps/search
tag: "1.22.20"
repository: your-docker-repo/saleor-storefront
tag: latest
pullPolicy: IfNotPresent
containerPort: 8000
service:
type: ClusterIP
port: 80
resources:
limits:
memory: "512Mi"
cpu: "250m"
requests:
memory: "256Mi"
cpu: "125m"
env:
SECRET_KEY: "your_secret_key"
APP_LOG_LEVEL: "info"
APP_SALEOR_HOST: "https://your-saleor-instance.com"
APP_TOKEN: "your_generated_app_token"
APP_IFRAME_BASE_URL: ""
APP_API_BASE_URL: ""
resources: {}
NEXT_PUBLIC_SALEOR_API_URL: "https://your-saleor-api-url.com/graphql/"
NEXT_PUBLIC_STOREFRONT_URL: "https://your-storefront-url.com"
SALEOR_APP_TOKEN: "your-saleor-app-token"
NEXT_PUBLIC_URL: "https://your-public-url.com"
NEXT_SECRET_NEWSLETTER_ENDPOINT: "https://your-newsletter-endpoint.com"
NEXT_SALEOR_TOKEN: "your-saleor-token"
NEXT_PUBLIC_SALEOR_TOKEN: "your-public-saleor-token"
NEXT_PUBLIC_CHANNEL_ID: "your-channel-id"
NEXT_PUBLIC_ALGOLIA_APP_ID: "your-algolia-app-id"
NEXT_PUBLIC_ALGOLIA_API_KEY: "your-algolia-api-key"
NEXT_PUBLIC_ALGOLIA_INDEX_NAME: "your-algolia-index-name"

redis:
image:
Expand Down

0 comments on commit 21c6522

Please sign in to comment.