From 5c6c729a56ec1401cc41135b81420cb02be58675 Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Tue, 21 Jul 2020 00:38:50 +0100 Subject: [PATCH 1/8] Adding mysql and trading requirement --- charts/preview/requirements.yaml | 8 ++++++++ charts/preview/values.yaml | 9 +++++++++ 2 files changed, 17 insertions(+) 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/values.yaml b/charts/preview/values.yaml index 360dd7a..6655912 100755 --- a/charts/preview/values.yaml +++ b/charts/preview/values.yaml @@ -12,6 +12,15 @@ expose: exposer: Ingress http: true tlsacme: false +mysql: + fullnameOverride: mysql + persistence: + enabled: true + accessMode: ReadWriteOnce + size: 1Gi + annotations: {} + mysqlRootPassword: password + mysqlDatabase: moneyfx preview: image: pullPolicy: IfNotPresent From 060efc5bf67fef4cd4a1dfba40f80116620f732e Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Tue, 21 Jul 2020 00:38:50 +0100 Subject: [PATCH 2/8] Adding mysql and trading requirement (2) --- charts/preview/requirements.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/preview/requirements.yaml b/charts/preview/requirements.yaml index 6d5ff87..11b7fd8 100755 --- a/charts/preview/requirements.yaml +++ b/charts/preview/requirements.yaml @@ -11,7 +11,7 @@ dependencies: - name: mysql repository: https://kubernetes-charts.storage.googleapis.com/ - version: ">=0.15.0" + version: ~0.12.0 - name: rest-django-trading repository: http://jenkins-x-chartmuseum:8080/ From 3d13d56c8ea6221e03125ba0a001cf643a4a064e Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Tue, 21 Jul 2020 02:15:35 +0100 Subject: [PATCH 3/8] Updating ports --- charts/preview/values.yaml | 7 +++++-- charts/rest-django-payments/templates/service.yaml | 4 ++++ charts/rest-django-payments/values.yaml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/charts/preview/values.yaml b/charts/preview/values.yaml index 6655912..97ed113 100755 --- a/charts/preview/values.yaml +++ b/charts/preview/values.yaml @@ -21,9 +21,12 @@ mysql: 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..a56a7b2 100755 --- a/charts/rest-django-payments/values.yaml +++ b/charts/rest-django-payments/values.yaml @@ -47,7 +47,7 @@ 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" From 175b0618eb143017b6b4b737d0f63807f0e24026 Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Tue, 21 Jul 2020 02:32:05 +0100 Subject: [PATCH 4/8] Updating limits --- charts/rest-django-payments/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/rest-django-payments/values.yaml b/charts/rest-django-payments/values.yaml index a56a7b2..33239ad 100755 --- a/charts/rest-django-payments/values.yaml +++ b/charts/rest-django-payments/values.yaml @@ -53,11 +53,11 @@ service: 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: / From 5365d9325cc94e1fefdf0af20a4a3d1cfa330b3e Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Tue, 21 Jul 2020 02:57:04 +0100 Subject: [PATCH 5/8] Updating python version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bffca9d..bd56d16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3 +FROM python:3.7.8 ENV PYTHONUNBUFFERED 1 RUN mkdir -p /manning/rest_django_payments WORKDIR /manning/rest_django_payments From 13429deb0719645cfc377b1d9485488b2f3569e5 Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Tue, 21 Jul 2020 03:07:18 +0100 Subject: [PATCH 6/8] Adding pip3 install -r mysqlclient --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bd56d16..1fbe997 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ ENV PYTHONUNBUFFERED 1 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 pip3 install -r requirements.txt +RUN pip3 install -r mysqlclient ADD . /manning/rest_django_payments/ EXPOSE 8200 From a525ba980a2695a234d39b93b75394634f5edf9e Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Fri, 24 Jul 2020 23:16:11 +0100 Subject: [PATCH 7/8] PR test jx mysql --- Dockerfile | 4 ++-- charts/preview/requirements.yaml | 2 +- charts/preview/templates/mysql.yaml | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 charts/preview/templates/mysql.yaml diff --git a/Dockerfile b/Dockerfile index 1fbe997..fd0a386 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,6 @@ RUN pip3 install -r requirements.txt RUN pip3 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 11b7fd8..6d5ff87 100755 --- a/charts/preview/requirements.yaml +++ b/charts/preview/requirements.yaml @@ -11,7 +11,7 @@ dependencies: - name: mysql repository: https://kubernetes-charts.storage.googleapis.com/ - version: ~0.12.0 + version: ">=0.15.0" - name: rest-django-trading repository: http://jenkins-x-chartmuseum:8080/ 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 From 8ecfb358de375c105a527f374635ea621c3736c4 Mon Sep 17 00:00:00 2001 From: Miguel Montalvo Date: Fri, 24 Jul 2020 23:43:11 +0100 Subject: [PATCH 8/8] Updating Dockerfile 2 --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd0a386..9d16b3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.7.8 +FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir -p /manning/rest_django_payments WORKDIR /manning/rest_django_payments COPY requirements.txt /manning/rest_django_payments/ -RUN pip3 install -r requirements.txt -RUN pip3 install -r mysqlclient +RUN pip install -r requirements.txt +RUN pip install -r mysqlclient ADD . /manning/rest_django_payments/ EXPOSE 8080