-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33a005e
commit cd06a6e
Showing
3 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: '{{.Release.Name}}-saleor-api' | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-api' | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-api' | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-api' | ||
spec: | ||
restartPolicy: Always | ||
containers: | ||
- image: hnminh/saleor-api:2.10 | ||
name: saleor-api | ||
imagePullPolicy: Always | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: | ||
[ | ||
'/bin/sh', | ||
'-c', | ||
'python3 manage.py migrate && python3 manage.py collectstatic --noinput && python3 manage.py populatedb && python3 manage.py createsuperuser --no-input [email protected] || true && sleep 30', | ||
] | ||
command: | ||
[ | ||
'/bin/sh', | ||
'-c', | ||
'python3 -m pip install django-redis django-debug-toolbar django-debug-toolbar-request-history django-graphiql-debug-toolbar && uwsgi --ini /app/saleor/wsgi/uwsgi.ini', | ||
] | ||
ports: | ||
- containerPort: 8000 | ||
name: api | ||
env: | ||
- name: ENABLE_DEBUG_TOOLBAR | ||
value: 'True' | ||
- name: DEBUG | ||
value: 'True' | ||
- name: DATABASE_URL | ||
value: '{{ .Values.databaseUrl }}' | ||
- name: CACHE_URL | ||
value: '{{ .Values.redisUrl }}' | ||
- name: ALLOWED_CLIENT_HOSTS | ||
value: '{{ .Values.allowHosts }}, {{.Release.Name}}-saleor-dashboard, {{.Release.Name}}-saleor-storefront' | ||
- name: ALLOWED_HOSTS | ||
value: '{{ .Values.allowHosts }}, {{.Release.Name}}-saleor-dashboard, {{.Release.Name}}-saleor-storefront' | ||
- name: SECRET_KEY | ||
value: '{{ .Values.secretKey }}' | ||
- name: DJANGO_SUPERUSER_PASSWORD | ||
value: '{{ .Values.superUserPassword }}' | ||
- name: DASHBOARD_URL | ||
value: 'http://{{ .Values.dashboardIngress }}' | ||
- name: STOREFRONT_URL | ||
value: 'http://{{ .Values.storefrontIngress }}' | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: '{{.Release.Name}}-saleor-dashboard' | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-dashboard' | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-dashboard' | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-dashboard' | ||
spec: | ||
restartPolicy: Always | ||
containers: | ||
- image: hnminh/saleor-dashboard:2.10 | ||
name: saleor-dashboard | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
name: dashboard | ||
env: | ||
- name: API_URI | ||
value: 'http://{{.Release.Name}}-saleor-api:8000/graphql/' | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: '{{.Release.Name}}-saleor-storefront' | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-storefront' | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-storefront' | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-storefront' | ||
spec: | ||
restartPolicy: Always | ||
containers: | ||
- image: hnminh/saleor-storefront:2.10 | ||
name: saleor-storefront | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 3000 | ||
name: storefront | ||
env: | ||
- name: API_URI | ||
value: 'http://{{.Release.Name}}-saleor-api:8000/graphql/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-api' | ||
name: '{{.Release.Name}}-saleor-api' | ||
spec: | ||
ports: | ||
- name: 'api' | ||
port: 8000 | ||
targetPort: 8000 | ||
selector: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-api' | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-dashboard' | ||
name: '{{.Release.Name}}-saleor-dashboard' | ||
spec: | ||
ports: | ||
- name: 'dashboard' | ||
port: 9000 | ||
targetPort: 9000 | ||
selector: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-dashboard' | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-storefront' | ||
name: '{{.Release.Name}}-saleor-storefront' | ||
spec: | ||
ports: | ||
- name: 'storefront' | ||
port: 3000 | ||
targetPort: 3000 | ||
selector: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-storefront' | ||
type: ClusterIP | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
app: '{{.Release.Name}}-saleor' | ||
service: '{{.Release.Name}}-saleor-ingress' | ||
name: '{{.Release.Name}}-saleor' | ||
spec: | ||
rules: | ||
- host: '{{ .Values.apiIngress }}' | ||
http: | ||
paths: | ||
- backend: | ||
serviceName: '{{.Release.Name}}-saleor-api' | ||
servicePort: 8000 | ||
pathType: ImplementationSpecific | ||
- host: '{{ .Values.dashboardIngress }}' | ||
http: | ||
paths: | ||
- backend: | ||
serviceName: '{{.Release.Name}}-saleor-dashboard' | ||
servicePort: 9000 | ||
pathType: ImplementationSpecific | ||
- host: '{{ .Values.storefrontIngress }}' | ||
http: | ||
paths: | ||
- backend: | ||
serviceName: '{{.Release.Name}}-saleor-storefront' | ||
servicePort: 3000 | ||
pathType: ImplementationSpecific |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
databaseUrl: 'postgres://postgres:Coe@[email protected]:5432/saleor' | ||
redisUrl: 'redis://coe-redis-headless.default:6379/0' | ||
superUserPassword: 'Coe@2020' | ||
secretKey: 'Coe@2020' | ||
allowHosts: 'localhost, 127.0.0.1, 0.0.0.0, 192.168.10.69, saleor.testing.coe.com' | ||
apiIngress: 'saleor.testing.coe.com' | ||
dashboardIngress: 'saleor-dashboard.testing.coe.com' | ||
storefrontIngress: 'saleor-storefront.testing.coe.com' |