diff --git a/Dockerfile b/Dockerfile index bffca9d..9d16b3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,9 @@ RUN mkdir -p /manning/rest_django_payments WORKDIR /manning/rest_django_payments COPY requirements.txt /manning/rest_django_payments/ RUN pip install -r requirements.txt +RUN pip install -r mysqlclient ADD . /manning/rest_django_payments/ -EXPOSE 8200 +EXPOSE 8080 -CMD ["gunicorn", "--chdir", "rest_django_payments", "--bind", ":8200", "rest_django_payments.wsgi:application"] +CMD ["gunicorn", "--bind", ":8080", "rest_django_payments.wsgi:application"] diff --git a/charts/preview/requirements.yaml b/charts/preview/requirements.yaml index 7c8c5bc..6d5ff87 100755 --- a/charts/preview/requirements.yaml +++ b/charts/preview/requirements.yaml @@ -9,6 +9,14 @@ dependencies: repository: http://chartmuseum.jenkins-x.io version: 2.3.92 +- name: mysql + repository: https://kubernetes-charts.storage.googleapis.com/ + version: ">=0.15.0" + +- name: rest-django-trading + repository: http://jenkins-x-chartmuseum:8080/ + version: ">= 0.0.1" + # !! "alias: preview" must be last entry in dependencies array !! # !! Place custom dependencies above !! - alias: preview diff --git a/charts/preview/templates/mysql.yaml b/charts/preview/templates/mysql.yaml new file mode 100644 index 0000000..ae922a0 --- /dev/null +++ b/charts/preview/templates/mysql.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql +spec: + externalName: mysql + ports: + - port: 3306 \ No newline at end of file diff --git a/charts/preview/values.yaml b/charts/preview/values.yaml index 360dd7a..97ed113 100755 --- a/charts/preview/values.yaml +++ b/charts/preview/values.yaml @@ -12,9 +12,21 @@ expose: exposer: Ingress http: true tlsacme: false +mysql: + fullnameOverride: mysql + persistence: + enabled: true + accessMode: ReadWriteOnce + size: 1Gi + annotations: {} + mysqlRootPassword: password + mysqlDatabase: moneyfx + preview: + nameOverride: rest-django-payments + replicaCount: 1 image: + repository: + tag: pullPolicy: IfNotPresent - repository: null - tag: null namespace: jx-previews diff --git a/charts/rest-django-payments/templates/service.yaml b/charts/rest-django-payments/templates/service.yaml index 9a2a4c7..67db946 100755 --- a/charts/rest-django-payments/templates/service.yaml +++ b/charts/rest-django-payments/templates/service.yaml @@ -21,6 +21,10 @@ spec: targetPort: {{ .Values.service.internalPort }} protocol: TCP name: http + - port: 8200 + targetPort: {{ .Values.service.internalPort }} + protocol: TCP + name: http-old selector: app: {{ template "fullname" . }} {{- end }} diff --git a/charts/rest-django-payments/values.yaml b/charts/rest-django-payments/values.yaml index ce00c77..33239ad 100755 --- a/charts/rest-django-payments/values.yaml +++ b/charts/rest-django-payments/values.yaml @@ -47,17 +47,17 @@ service: name: rest-django-payments type: ClusterIP externalPort: 80 - internalPort: 8080 + internalPort: 8200 annotations: fabric8.io/expose: "true" fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx" resources: limits: - cpu: 100m - memory: 128Mi + cpu: 200m + memory: 512Mi requests: - cpu: 100m - memory: 128Mi + cpu: 200m + memory: 512Mi ingress: enabled: false probePath: /