From ce6b3d4244c6906a2cc47e3f7fb550ee08a8a966 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Mon, 6 Mar 2023 10:24:58 -0300 Subject: [PATCH 01/31] Update package-lock.json my-first-commit --- package-lock.json | 285 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 199 insertions(+), 86 deletions(-) diff --git a/package-lock.json b/package-lock.json index bbb93e9..81306c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,28 +1,39 @@ { "name": "vue-electron-todolist-api", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "accepts": { + "packages": { + "": { + "name": "vue-electron-todolist-api", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.16.4" + } + }, + "node_modules/accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { + "dependencies": { "mime-types": "~2.1.18", "negotiator": "0.6.1" + }, + "engines": { + "node": ">= 0.6" } }, - "array-flatten": { + "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, - "body-parser": { + "node_modules/body-parser": { "version": "1.18.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "requires": { + "dependencies": { "bytes": "3.0.0", "content-type": "~1.0.4", "debug": "2.6.9", @@ -33,76 +44,100 @@ "qs": "6.5.2", "raw-body": "2.3.3", "type-is": "~1.6.16" + }, + "engines": { + "node": ">= 0.8" } }, - "bytes": { + "node_modules/bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "engines": { + "node": ">= 0.8" + } }, - "content-disposition": { + "node_modules/content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "engines": { + "node": ">= 0.6" + } }, - "content-type": { + "node_modules/content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } }, - "cookie": { + "node_modules/cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "engines": { + "node": ">= 0.6" + } }, - "cookie-signature": { + "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "debug": { + "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { + "dependencies": { "ms": "2.0.0" } }, - "depd": { + "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } }, - "destroy": { + "node_modules/destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, - "ee-first": { + "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "encodeurl": { + "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "engines": { + "node": ">= 0.8" + } }, - "escape-html": { + "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, - "etag": { + "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "engines": { + "node": ">= 0.6" + } }, - "express": { + "node_modules/express": { "version": "4.16.4", "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", - "requires": { + "dependencies": { "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.3", @@ -133,13 +168,16 @@ "type-is": "~1.6.16", "utils-merge": "1.0.1", "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" } }, - "finalhandler": { + "node_modules/finalhandler": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "requires": { + "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -147,153 +185,207 @@ "parseurl": "~1.3.2", "statuses": "~1.4.0", "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "forwarded": { + "node_modules/forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "engines": { + "node": ">= 0.6" + } }, - "fresh": { + "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "engines": { + "node": ">= 0.6" + } }, - "http-errors": { + "node_modules/http-errors": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "requires": { + "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" } }, - "iconv-lite": { + "node_modules/iconv-lite": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "ipaddr.js": { + "node_modules/ipaddr.js": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", + "engines": { + "node": ">= 0.10" + } }, - "media-typer": { + "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "engines": { + "node": ">= 0.6" + } }, - "merge-descriptors": { + "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, - "methods": { + "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "engines": { + "node": ">= 0.6" + } }, - "mime": { + "node_modules/mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "bin": { + "mime": "cli.js" + } }, - "mime-db": { + "node_modules/mime-db": { "version": "1.40.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "engines": { + "node": ">= 0.6" + } }, - "mime-types": { + "node_modules/mime-types": { "version": "2.1.24", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { + "dependencies": { "mime-db": "1.40.0" + }, + "engines": { + "node": ">= 0.6" } }, - "ms": { + "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "negotiator": { + "node_modules/negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "engines": { + "node": ">= 0.6" + } }, - "on-finished": { + "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { + "dependencies": { "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "parseurl": { + "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } }, - "path-to-regexp": { + "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, - "proxy-addr": { + "node_modules/proxy-addr": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", - "requires": { + "dependencies": { "forwarded": "~0.1.2", "ipaddr.js": "1.9.0" + }, + "engines": { + "node": ">= 0.10" } }, - "qs": { + "node_modules/qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "engines": { + "node": ">=0.6" + } }, - "range-parser": { + "node_modules/range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "engines": { + "node": ">= 0.6" + } }, - "raw-body": { + "node_modules/raw-body": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", - "requires": { + "dependencies": { "bytes": "3.0.0", "http-errors": "1.6.3", "iconv-lite": "0.4.23", "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "send": { + "node_modules/send": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "requires": { + "dependencies": { "debug": "2.6.9", "depd": "~1.1.2", "destroy": "~1.0.4", @@ -307,52 +399,73 @@ "on-finished": "~2.3.0", "range-parser": "~1.2.0", "statuses": "~1.4.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "serve-static": { + "node_modules/serve-static": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "requires": { + "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.2", "send": "0.16.2" + }, + "engines": { + "node": ">= 0.8.0" } }, - "setprototypeof": { + "node_modules/setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, - "statuses": { + "node_modules/statuses": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "engines": { + "node": ">= 0.6" + } }, - "type-is": { + "node_modules/type-is": { "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "requires": { + "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.18" + }, + "engines": { + "node": ">= 0.6" } }, - "unpipe": { + "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "engines": { + "node": ">= 0.8" + } }, - "utils-merge": { + "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "engines": { + "node": ">= 0.4.0" + } }, - "vary": { + "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "engines": { + "node": ">= 0.8" + } } } } From 97df1cf91d0151475e8afb9e57813c87ea1bd99a Mon Sep 17 00:00:00 2001 From: codezeron Date: Mon, 27 Mar 2023 09:29:04 -0300 Subject: [PATCH 02/31] feat: configurado para entrar na porta 49160:1337 e criar imagem --- .Dockerignore | 2 ++ Dockerfile | 16 ++++++++++++++++ example-ingress.yml | 18 ++++++++++++++++++ routes.js | 4 +++- server.js | 2 +- 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .Dockerignore create mode 100644 Dockerfile create mode 100644 example-ingress.yml diff --git a/.Dockerignore b/.Dockerignore new file mode 100644 index 0000000..5171c54 --- /dev/null +++ b/.Dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f95f02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:current-slim + +RUN apt-get update -y && apt-get upgrade -y + + +WORKDIR /SIMPLE-NODE-API + +COPY ./package.json ./package.json +RUN npm install + +COPY ./routes.js routes.js +COPY ./server.js server.js +COPY ./todos.js todos.js + +EXPOSE 1337 +ENTRYPOINT [ "node", "server" ] diff --git a/example-ingress.yml b/example-ingress.yml new file mode 100644 index 0000000..a47aa89 --- /dev/null +++ b/example-ingress.yml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: example-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$1 +spec: + rules: + - host: teste + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: teste + port: + number: 1337 diff --git a/routes.js b/routes.js index 97e3d93..5ae9046 100644 --- a/routes.js +++ b/routes.js @@ -3,7 +3,9 @@ const todos = require("./todos"); const router = express.Router(); -router.get("/todos", function(req, res) { +router.use( function(req, res) { + req.url + console.log(req.url); res.json(todos); }); diff --git a/server.js b/server.js index 68f9fbb..d5cffbb 100644 --- a/server.js +++ b/server.js @@ -5,7 +5,7 @@ const routes = require("./routes"); const app = express(); // Set port -const port = process.env.PORT || "1337"; +const port = "1337"; app.set("port", port); app.use('/', routes); From 9ea72fa3e53686d181826c370c5c430821408d4f Mon Sep 17 00:00:00 2001 From: codezeron Date: Mon, 27 Mar 2023 11:49:43 -0300 Subject: [PATCH 03/31] feat: add kustom argocd type --- kustom-webapp/README.md | 40 +++++++++++++++++++ kustom-webapp/base/deployment.yaml | 23 +++++++++++ kustom-webapp/base/kustomization.yaml | 15 +++++++ kustom-webapp/base/service.yaml | 10 +++++ kustom-webapp/overlays/dev/config.properties | 3 ++ kustom-webapp/overlays/dev/kustomization.yaml | 9 +++++ kustom-webapp/overlays/dev/replicas.yaml | 6 +++ kustom-webapp/overlays/prod/config.properties | 3 ++ .../overlays/prod/kustomization.yaml | 9 +++++ kustom-webapp/overlays/prod/replicas.yaml | 6 +++ 10 files changed, 124 insertions(+) create mode 100644 kustom-webapp/README.md create mode 100644 kustom-webapp/base/deployment.yaml create mode 100644 kustom-webapp/base/kustomization.yaml create mode 100644 kustom-webapp/base/service.yaml create mode 100644 kustom-webapp/overlays/dev/config.properties create mode 100644 kustom-webapp/overlays/dev/kustomization.yaml create mode 100644 kustom-webapp/overlays/dev/replicas.yaml create mode 100644 kustom-webapp/overlays/prod/config.properties create mode 100644 kustom-webapp/overlays/prod/kustomization.yaml create mode 100644 kustom-webapp/overlays/prod/replicas.yaml diff --git a/kustom-webapp/README.md b/kustom-webapp/README.md new file mode 100644 index 0000000..7b6391d --- /dev/null +++ b/kustom-webapp/README.md @@ -0,0 +1,40 @@ +# Installation +``` +kubectl version +``` +*If you have 1.21 or above of kubectl you will have access to kubectl kustomize which is the recommended method. If you aren't on version 1.21 or above, upgrade kubectl. +*You could also download/use the 'kutomize' binary seperatly but the cmds are different. + + +# Viewing Kustomize Configs - (Using kubectl kustomize integration) +``` +kubectl kustomize . +kubectl kustomize overlays/dev/ +kubectl kustomize overlays/prod/ +``` + +# Applying Kustomize Configs - (Using kubectl kustomize integration) +``` +kubectl apply -k . +kubectl apply -k overlays/dev/ +kubectl apply -k overlays/prod/ +``` +Note: if you get field is immutable error, check your configuration and try deleting the resources. + + +# Creating Namespaces if you dont have them already +``` +kubectl create namespace dev; kubectl create namespace prod; +``` + + +# Accessing the application +``` +minikube service kustom-mywebapp-v1 +minikube service kustom-mywebapp-v1 -n dev +minikube service kustom-mywebapp-v1 -n prod +``` + +# References: +https://github.com/kubernetes-sigs/kustomize/blob/master/README.md +https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/ diff --git a/kustom-webapp/base/deployment.yaml b/kustom-webapp/base/deployment.yaml new file mode 100644 index 0000000..4536d09 --- /dev/null +++ b/kustom-webapp/base/deployment.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mywebapp +spec: + replicas: 1 + template: + spec: # Pod spec + containers: + - name: mycontainer + image: "enzoyh/teste-repo:latest" + ports: + - containerPort: 80 + envFrom: + - configMapRef: + name: mykustom-map + resources: + requests: + memory: "16Mi" + cpu: "50m" # 500milliCPUs (1/2 CPU) + limits: + memory: "128Mi" + cpu: "100m" \ No newline at end of file diff --git a/kustom-webapp/base/kustomization.yaml b/kustom-webapp/base/kustomization.yaml new file mode 100644 index 0000000..503de80 --- /dev/null +++ b/kustom-webapp/base/kustomization.yaml @@ -0,0 +1,15 @@ +resources: +- deployment.yaml +- service.yaml + +commonLabels: + app: kustomwebapp + +commonAnnotations: + app: mykustom-annontations + +namePrefix: + kustom- + +nameSuffix: + -v1 \ No newline at end of file diff --git a/kustom-webapp/base/service.yaml b/kustom-webapp/base/service.yaml new file mode 100644 index 0000000..a97ff93 --- /dev/null +++ b/kustom-webapp/base/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: mywebapp +spec: + ports: + - port: 80 + protocol: TCP + name: node + type: NodePort \ No newline at end of file diff --git a/kustom-webapp/overlays/dev/config.properties b/kustom-webapp/overlays/dev/config.properties new file mode 100644 index 0000000..827dca0 --- /dev/null +++ b/kustom-webapp/overlays/dev/config.properties @@ -0,0 +1,3 @@ +BG_COLOR=#000000 +FONT_COLOR=#FFFFFF +CUSTOM_HEADER=Welcome to the DEV environment!! diff --git a/kustom-webapp/overlays/dev/kustomization.yaml b/kustom-webapp/overlays/dev/kustomization.yaml new file mode 100644 index 0000000..1fc6f81 --- /dev/null +++ b/kustom-webapp/overlays/dev/kustomization.yaml @@ -0,0 +1,9 @@ +bases: +- ../../base + +patches: + - replicas.yaml + +configMapGenerator: +- name: mykustom-map + env: config.properties \ No newline at end of file diff --git a/kustom-webapp/overlays/dev/replicas.yaml b/kustom-webapp/overlays/dev/replicas.yaml new file mode 100644 index 0000000..2417dd3 --- /dev/null +++ b/kustom-webapp/overlays/dev/replicas.yaml @@ -0,0 +1,6 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mywebapp +spec: + replicas: 3 \ No newline at end of file diff --git a/kustom-webapp/overlays/prod/config.properties b/kustom-webapp/overlays/prod/config.properties new file mode 100644 index 0000000..9bf4ed7 --- /dev/null +++ b/kustom-webapp/overlays/prod/config.properties @@ -0,0 +1,3 @@ +BG_COLOR=#12181b +FONT_COLOR=#FFFFFF +CUSTOM_HEADER=Welcome to the Prod environment!! diff --git a/kustom-webapp/overlays/prod/kustomization.yaml b/kustom-webapp/overlays/prod/kustomization.yaml new file mode 100644 index 0000000..1fc6f81 --- /dev/null +++ b/kustom-webapp/overlays/prod/kustomization.yaml @@ -0,0 +1,9 @@ +bases: +- ../../base + +patches: + - replicas.yaml + +configMapGenerator: +- name: mykustom-map + env: config.properties \ No newline at end of file diff --git a/kustom-webapp/overlays/prod/replicas.yaml b/kustom-webapp/overlays/prod/replicas.yaml new file mode 100644 index 0000000..569650e --- /dev/null +++ b/kustom-webapp/overlays/prod/replicas.yaml @@ -0,0 +1,6 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mywebapp +spec: + replicas: 4 \ No newline at end of file From 2fc709cb991b88e4a4817ebe1149da7be326be88 Mon Sep 17 00:00:00 2001 From: codezeron Date: Fri, 31 Mar 2023 09:10:39 -0300 Subject: [PATCH 04/31] feat: add resp do server com tempo agendado --- cron.js | 15 +++++++++++++++ package-lock.json | 17 +++++++++++++++++ package.json | 1 + 3 files changed, 33 insertions(+) create mode 100644 cron.js diff --git a/cron.js b/cron.js new file mode 100644 index 0000000..95b79cb --- /dev/null +++ b/cron.js @@ -0,0 +1,15 @@ +var CronJob = require('cron').CronJob; +var express = require('express'); +const http = require(`http`); +const app = express(); + +const job = new CronJob('0 */1 * * * *', function () { + app.get(`/health`, (req, res) => res.status(200).json(`OK`)); + const server = http.createServer(app); + server.listen( + 1337, + () => console.log(`-- Backend Service (1337) --`) + ); +}); +console.log('Resposta do servidor a cada minuto'); +job.start(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 81306c1..5eec638 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "cron": "^2.3.0", "express": "^4.16.4" } }, @@ -86,6 +87,14 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "node_modules/cron": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cron/-/cron-2.3.0.tgz", + "integrity": "sha512-ZN5HP8zDY41sJolMsbc+GksRATcbvkPKF5wR/qc8FrV4NBVi9ORQa1HmYa5GydaysUB80X9XpRlRkooa5uEtTA==", + "dependencies": { + "luxon": "^3.2.1" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -244,6 +253,14 @@ "node": ">= 0.10" } }, + "node_modules/luxon": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz", + "integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==", + "engines": { + "node": ">=12" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", diff --git a/package.json b/package.json index 0316124..3509b03 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "author": "", "license": "ISC", "dependencies": { + "cron": "^2.3.0", "express": "^4.16.4" } } From ee643c2301a4409f5535ba9bb0679513f5180761 Mon Sep 17 00:00:00 2001 From: codezeron Date: Fri, 31 Mar 2023 11:20:06 -0300 Subject: [PATCH 05/31] feat: add cron with api response --- Dockerfile | 6 ++-- cron.js | 22 ++++++++++----- package-lock.json | 72 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 4 files changed, 92 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7f95f02..1e55d0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM node:current-slim +FROM arm64v8/node:18.14-buster-slim -RUN apt-get update -y && apt-get upgrade -y +RUN apt-get update && apt-get upgrade -y WORKDIR /SIMPLE-NODE-API @@ -11,6 +11,8 @@ RUN npm install COPY ./routes.js routes.js COPY ./server.js server.js COPY ./todos.js todos.js +COPY ./cron.js cron.js + EXPOSE 1337 ENTRYPOINT [ "node", "server" ] diff --git a/cron.js b/cron.js index 95b79cb..35743eb 100644 --- a/cron.js +++ b/cron.js @@ -1,15 +1,23 @@ var CronJob = require('cron').CronJob; +const { default: axios } = require('axios'); var express = require('express'); const http = require(`http`); const app = express(); +app.get(`/health`, (req, res) => res.status(200).json(`OK`)); +const server = http.createServer(app); +server.listen( + 1337, + () => console.log(`-- Backend Service (1337) --`) +); + +const job = new CronJob('0 */1 * * * *', async function () { + try { + let response = await axios.get(process.env.CLIENT_URL)//configurar o CLIENT_URL=https://something/health + console.log('Resposta so servidor: OK', JSON.stringify(response.data)) + } catch (error) { + console.log('ocorreu um erro:', JSON.stringify(error)) + } -const job = new CronJob('0 */1 * * * *', function () { - app.get(`/health`, (req, res) => res.status(200).json(`OK`)); - const server = http.createServer(app); - server.listen( - 1337, - () => console.log(`-- Backend Service (1337) --`) - ); }); console.log('Resposta do servidor a cada minuto'); job.start(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5eec638..29e129b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "axios": "^1.3.4", "cron": "^2.3.0", "express": "^4.16.4" } @@ -30,6 +31,21 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", + "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/body-parser": { "version": "1.18.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", @@ -58,6 +74,17 @@ "node": ">= 0.8" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -103,6 +130,14 @@ "ms": "2.0.0" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -199,6 +234,38 @@ "node": ">= 0.8" } }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -358,6 +425,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", diff --git a/package.json b/package.json index 3509b03..0c6a850 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "author": "", "license": "ISC", "dependencies": { + "axios": "^1.3.4", "cron": "^2.3.0", "express": "^4.16.4" } From c4ddc7432bc7c53fe45073693e1f81c4e82a161d Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 10:35:51 -0300 Subject: [PATCH 06/31] fix: config for deployment in argocd --- kustom-webapp/base/configmap.yml | 6 ++++++ kustom-webapp/base/deployment.yaml | 23 -------------------- kustom-webapp/base/deployment.yml | 31 +++++++++++++++++++++++++++ kustom-webapp/base/ingress.yml | 25 +++++++++++++++++++++ kustom-webapp/base/kustomization.yaml | 15 ------------- kustom-webapp/base/service.yaml | 10 --------- kustom-webapp/base/service.yml | 12 +++++++++++ 7 files changed, 74 insertions(+), 48 deletions(-) create mode 100644 kustom-webapp/base/configmap.yml delete mode 100644 kustom-webapp/base/deployment.yaml create mode 100644 kustom-webapp/base/deployment.yml create mode 100644 kustom-webapp/base/ingress.yml delete mode 100644 kustom-webapp/base/kustomization.yaml delete mode 100644 kustom-webapp/base/service.yaml create mode 100644 kustom-webapp/base/service.yml diff --git a/kustom-webapp/base/configmap.yml b/kustom-webapp/base/configmap.yml new file mode 100644 index 0000000..ae5159b --- /dev/null +++ b/kustom-webapp/base/configmap.yml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: my-configmap +# data: +# DATABASE_URL: "postgres://user:password@db-hostname:5432/mydatabase" diff --git a/kustom-webapp/base/deployment.yaml b/kustom-webapp/base/deployment.yaml deleted file mode 100644 index 4536d09..0000000 --- a/kustom-webapp/base/deployment.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mywebapp -spec: - replicas: 1 - template: - spec: # Pod spec - containers: - - name: mycontainer - image: "enzoyh/teste-repo:latest" - ports: - - containerPort: 80 - envFrom: - - configMapRef: - name: mykustom-map - resources: - requests: - memory: "16Mi" - cpu: "50m" # 500milliCPUs (1/2 CPU) - limits: - memory: "128Mi" - cpu: "100m" \ No newline at end of file diff --git a/kustom-webapp/base/deployment.yml b/kustom-webapp/base/deployment.yml new file mode 100644 index 0000000..e325033 --- /dev/null +++ b/kustom-webapp/base/deployment.yml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: my-app + template: + metadata: + labels: + app: my-app + spec: + containers: + - name: tester + image: enzoyh/teste-repo:latest + ports: + - containerPort: 80 + # env: + # - name: NODE_ENV + # value: "production" + # - name: DATABASE_URL + # value: "postgres://user:password@db-host:5432/my-database" + resources: + requests: + memory: "16Mi" + cpu: "50m" # 500milliCPUs (1/2 CPU) + limits: + memory: "128Mi" + cpu: "100m" diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml new file mode 100644 index 0000000..e0b9011 --- /dev/null +++ b/kustom-webapp/base/ingress.yml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: my-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + rules: + - host: teste.com + http: + paths: + - path: /prod + pathType: Prefix + backend: + service: + name: app-service + port: + name: tester + - path: /dev + pathType: Prefix + backend: + service: + name: app-service + port: + name: tester diff --git a/kustom-webapp/base/kustomization.yaml b/kustom-webapp/base/kustomization.yaml deleted file mode 100644 index 503de80..0000000 --- a/kustom-webapp/base/kustomization.yaml +++ /dev/null @@ -1,15 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -commonLabels: - app: kustomwebapp - -commonAnnotations: - app: mykustom-annontations - -namePrefix: - kustom- - -nameSuffix: - -v1 \ No newline at end of file diff --git a/kustom-webapp/base/service.yaml b/kustom-webapp/base/service.yaml deleted file mode 100644 index a97ff93..0000000 --- a/kustom-webapp/base/service.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mywebapp -spec: - ports: - - port: 80 - protocol: TCP - name: node - type: NodePort \ No newline at end of file diff --git a/kustom-webapp/base/service.yml b/kustom-webapp/base/service.yml new file mode 100644 index 0000000..732cb23 --- /dev/null +++ b/kustom-webapp/base/service.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: app-service +spec: + selector: + app: my-app + container-name: tester + ports: + - protocol: TCP + port: 80 + targetPort: 80 From fd345193ccdf3d622d9c7472b6e54da1f67a60ab Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 10:49:24 -0300 Subject: [PATCH 07/31] fix: delete overlays files --- kustom-webapp/overlays/dev/config.properties | 3 --- kustom-webapp/overlays/dev/kustomization.yaml | 9 --------- kustom-webapp/overlays/dev/replicas.yaml | 6 ------ kustom-webapp/overlays/prod/config.properties | 3 --- kustom-webapp/overlays/prod/kustomization.yaml | 9 --------- kustom-webapp/overlays/prod/replicas.yaml | 6 ------ 6 files changed, 36 deletions(-) delete mode 100644 kustom-webapp/overlays/dev/config.properties delete mode 100644 kustom-webapp/overlays/dev/kustomization.yaml delete mode 100644 kustom-webapp/overlays/dev/replicas.yaml delete mode 100644 kustom-webapp/overlays/prod/config.properties delete mode 100644 kustom-webapp/overlays/prod/kustomization.yaml delete mode 100644 kustom-webapp/overlays/prod/replicas.yaml diff --git a/kustom-webapp/overlays/dev/config.properties b/kustom-webapp/overlays/dev/config.properties deleted file mode 100644 index 827dca0..0000000 --- a/kustom-webapp/overlays/dev/config.properties +++ /dev/null @@ -1,3 +0,0 @@ -BG_COLOR=#000000 -FONT_COLOR=#FFFFFF -CUSTOM_HEADER=Welcome to the DEV environment!! diff --git a/kustom-webapp/overlays/dev/kustomization.yaml b/kustom-webapp/overlays/dev/kustomization.yaml deleted file mode 100644 index 1fc6f81..0000000 --- a/kustom-webapp/overlays/dev/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -bases: -- ../../base - -patches: - - replicas.yaml - -configMapGenerator: -- name: mykustom-map - env: config.properties \ No newline at end of file diff --git a/kustom-webapp/overlays/dev/replicas.yaml b/kustom-webapp/overlays/dev/replicas.yaml deleted file mode 100644 index 2417dd3..0000000 --- a/kustom-webapp/overlays/dev/replicas.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mywebapp -spec: - replicas: 3 \ No newline at end of file diff --git a/kustom-webapp/overlays/prod/config.properties b/kustom-webapp/overlays/prod/config.properties deleted file mode 100644 index 9bf4ed7..0000000 --- a/kustom-webapp/overlays/prod/config.properties +++ /dev/null @@ -1,3 +0,0 @@ -BG_COLOR=#12181b -FONT_COLOR=#FFFFFF -CUSTOM_HEADER=Welcome to the Prod environment!! diff --git a/kustom-webapp/overlays/prod/kustomization.yaml b/kustom-webapp/overlays/prod/kustomization.yaml deleted file mode 100644 index 1fc6f81..0000000 --- a/kustom-webapp/overlays/prod/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -bases: -- ../../base - -patches: - - replicas.yaml - -configMapGenerator: -- name: mykustom-map - env: config.properties \ No newline at end of file diff --git a/kustom-webapp/overlays/prod/replicas.yaml b/kustom-webapp/overlays/prod/replicas.yaml deleted file mode 100644 index 569650e..0000000 --- a/kustom-webapp/overlays/prod/replicas.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mywebapp -spec: - replicas: 4 \ No newline at end of file From 8c84ad3755187e7aeafcc66fe76d7e8b02dbd9f2 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 11:31:18 -0300 Subject: [PATCH 08/31] fix: ingress file --- Dockerfile | 2 +- kustom-webapp/base/ingress.yml | 16 ++++++++++------ kustom-webapp/base/service.yml | 2 +- server.js | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e55d0e..a84ebfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,5 +14,5 @@ COPY ./todos.js todos.js COPY ./cron.js cron.js -EXPOSE 1337 +EXPOSE 80 ENTRYPOINT [ "node", "server" ] diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index e0b9011..1ba6def 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -3,23 +3,27 @@ kind: Ingress metadata: name: my-ingress annotations: - nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - - host: teste.com - http: - paths: - - path: /prod + - paths: + - path: /prod/(.*) pathType: Prefix backend: service: name: app-service port: name: tester - - path: /dev + - path: /dev/(.*) pathType: Prefix backend: service: name: app-service port: name: tester +resource.customizations: | + extensions/Ingress: + health.lua: | + hs = {} + hs.status = "Healthy" + return hs \ No newline at end of file diff --git a/kustom-webapp/base/service.yml b/kustom-webapp/base/service.yml index 732cb23..f54f75a 100644 --- a/kustom-webapp/base/service.yml +++ b/kustom-webapp/base/service.yml @@ -4,7 +4,7 @@ metadata: name: app-service spec: selector: - app: my-app + app: app-service container-name: tester ports: - protocol: TCP diff --git a/server.js b/server.js index d5cffbb..4002d7b 100644 --- a/server.js +++ b/server.js @@ -5,7 +5,7 @@ const routes = require("./routes"); const app = express(); // Set port -const port = "1337"; +const port = "80"; app.set("port", port); app.use('/', routes); From 093e71e003ee387818dddb159876e42b41320bb5 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 11:53:48 -0300 Subject: [PATCH 09/31] fix: ingress spec seccion --- kustom-webapp/base/ingress.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index 1ba6def..1f811a7 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -6,7 +6,8 @@ metadata: nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - - paths: + - http: + paths: - path: /prod/(.*) pathType: Prefix backend: From f920d9a20454fb264aec4d523e20ea2d90cfa476 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 10:38:16 -0300 Subject: [PATCH 10/31] fix: config for deployment in argocd --- Dockerfile | 1 - example-ingress.yml | 18 ------------------ 2 files changed, 19 deletions(-) delete mode 100644 example-ingress.yml diff --git a/Dockerfile b/Dockerfile index a84ebfb..7c2864a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,5 @@ COPY ./server.js server.js COPY ./todos.js todos.js COPY ./cron.js cron.js - EXPOSE 80 ENTRYPOINT [ "node", "server" ] diff --git a/example-ingress.yml b/example-ingress.yml deleted file mode 100644 index a47aa89..0000000 --- a/example-ingress.yml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: example-ingress - annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$1 -spec: - rules: - - host: teste - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: teste - port: - number: 1337 From e5d7ca3c3ef222978274b51b1784c341fc3031f7 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 12:06:40 -0300 Subject: [PATCH 11/31] fix: all base files modify --- kustom-webapp/base/deployment.yml | 10 ++++++---- kustom-webapp/base/ingress.yml | 16 +++++----------- kustom-webapp/base/service.yml | 1 + 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/kustom-webapp/base/deployment.yml b/kustom-webapp/base/deployment.yml index e325033..357d8ee 100644 --- a/kustom-webapp/base/deployment.yml +++ b/kustom-webapp/base/deployment.yml @@ -1,22 +1,24 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: app-deployment + name: app-service spec: replicas: 1 selector: matchLabels: - app: my-app + app: app-service template: metadata: labels: - app: my-app + app: app-service spec: containers: - - name: tester + - name: app-service image: enzoyh/teste-repo:latest + imagePullPolicy: Always ports: - containerPort: 80 + protocol: TCP # env: # - name: NODE_ENV # value: "production" diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index 1f811a7..483f39b 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -3,28 +3,22 @@ kind: Ingress metadata: name: my-ingress annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$1 + nginx.ingress.kubernetes.io/rewrite-target: / spec: rules: - http: paths: - - path: /prod/(.*) + - path: /prod pathType: Prefix backend: service: name: app-service port: - name: tester - - path: /dev/(.*) + name: app-service + - path: /dev pathType: Prefix backend: service: name: app-service port: - name: tester -resource.customizations: | - extensions/Ingress: - health.lua: | - hs = {} - hs.status = "Healthy" - return hs \ No newline at end of file + name: app-service diff --git a/kustom-webapp/base/service.yml b/kustom-webapp/base/service.yml index f54f75a..9a126da 100644 --- a/kustom-webapp/base/service.yml +++ b/kustom-webapp/base/service.yml @@ -3,6 +3,7 @@ kind: Service metadata: name: app-service spec: + type: ClusterIP selector: app: app-service container-name: tester From d7c504556812e71c37d570f2321441af7e91a058 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 14:22:20 -0300 Subject: [PATCH 12/31] fix: port 80 is server.js and cron.js --- cron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron.js b/cron.js index 35743eb..45668f1 100644 --- a/cron.js +++ b/cron.js @@ -6,7 +6,7 @@ const app = express(); app.get(`/health`, (req, res) => res.status(200).json(`OK`)); const server = http.createServer(app); server.listen( - 1337, + 80, () => console.log(`-- Backend Service (1337) --`) ); From e56179f9f8d613bf98af057a120729dc994a08c7 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 5 Apr 2023 14:28:56 -0300 Subject: [PATCH 13/31] feat: add heatlh check ingress --- kustom-webapp/base/ingress.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index 483f39b..5b51f0c 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -22,3 +22,9 @@ spec: name: app-service port: name: app-service +resource.customizations: | + extensions/Ingress: + health.lua: | + hs = {} + hs.status = "Healthy" + return hs From 838a510440a25eb217800c99be1d95c15a8f000f Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Mon, 10 Apr 2023 08:36:44 -0300 Subject: [PATCH 14/31] Update cron.js --- cron.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron.js b/cron.js index 45668f1..a2b0a6e 100644 --- a/cron.js +++ b/cron.js @@ -7,7 +7,7 @@ app.get(`/health`, (req, res) => res.status(200).json(`OK`)); const server = http.createServer(app); server.listen( 80, - () => console.log(`-- Backend Service (1337) --`) + () => console.log(`-- Backend Service (80) --`) ); const job = new CronJob('0 */1 * * * *', async function () { @@ -20,4 +20,4 @@ const job = new CronJob('0 */1 * * * *', async function () { }); console.log('Resposta do servidor a cada minuto'); -job.start(); \ No newline at end of file +job.start(); From dc6f2ff3e7ee6fbb79a6433409dfd58c905db917 Mon Sep 17 00:00:00 2001 From: codezeron Date: Mon, 10 Apr 2023 08:44:51 -0300 Subject: [PATCH 15/31] fix: port ingress and service --- kustom-webapp/base/ingress.yml | 8 ++++---- kustom-webapp/base/service.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index 5b51f0c..8e0c6c8 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -13,15 +13,15 @@ spec: backend: service: name: app-service - port: - name: app-service + port: 80 + - path: /dev pathType: Prefix backend: service: name: app-service - port: - name: app-service + port: 80 + resource.customizations: | extensions/Ingress: health.lua: | diff --git a/kustom-webapp/base/service.yml b/kustom-webapp/base/service.yml index 9a126da..5b84f95 100644 --- a/kustom-webapp/base/service.yml +++ b/kustom-webapp/base/service.yml @@ -6,7 +6,7 @@ spec: type: ClusterIP selector: app: app-service - container-name: tester + container-name: app-service ports: - protocol: TCP port: 80 From afb124a7f394fa8563e51b27848ce2f973f7fbdf Mon Sep 17 00:00:00 2001 From: Paulo Henrique Aquino da Silva <125984157+paulosilva3991@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:14:19 -0300 Subject: [PATCH 16/31] Update ingress.yml --- kustom-webapp/base/ingress.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index 8e0c6c8..ca573d3 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -1,7 +1,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: my-ingress + name: ingress-nginx annotations: nginx.ingress.kubernetes.io/rewrite-target: / spec: From 8add3900eaeaa4db469b246ac8e92a88cdb1d2e0 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Aquino da Silva <125984157+paulosilva3991@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:16:35 -0300 Subject: [PATCH 17/31] Update deployment.yml --- kustom-webapp/base/deployment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/kustom-webapp/base/deployment.yml b/kustom-webapp/base/deployment.yml index 357d8ee..e62ce54 100644 --- a/kustom-webapp/base/deployment.yml +++ b/kustom-webapp/base/deployment.yml @@ -18,7 +18,6 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 - protocol: TCP # env: # - name: NODE_ENV # value: "production" From dbc32c7bef531394e054e40ee4a891b4d7eafcf6 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Aquino da Silva <125984157+paulosilva3991@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:17:36 -0300 Subject: [PATCH 18/31] Update deployment.yml --- kustom-webapp/base/deployment.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kustom-webapp/base/deployment.yml b/kustom-webapp/base/deployment.yml index e62ce54..f75539d 100644 --- a/kustom-webapp/base/deployment.yml +++ b/kustom-webapp/base/deployment.yml @@ -23,10 +23,10 @@ spec: # value: "production" # - name: DATABASE_URL # value: "postgres://user:password@db-host:5432/my-database" - resources: - requests: - memory: "16Mi" - cpu: "50m" # 500milliCPUs (1/2 CPU) - limits: - memory: "128Mi" - cpu: "100m" +# resources: +# requests: +# memory: "16Mi" +# cpu: "50m" # 500milliCPUs (1/2 CPU) +# limits: +# memory: "128Mi" +# cpu: "100m" From 751455e4373137bfa383a16bff571fe4ca993ca6 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Aquino da Silva <125984157+paulosilva3991@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:23:41 -0300 Subject: [PATCH 19/31] Update ingress.yml --- kustom-webapp/base/ingress.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml index ca573d3..7582a15 100644 --- a/kustom-webapp/base/ingress.yml +++ b/kustom-webapp/base/ingress.yml @@ -4,6 +4,7 @@ metadata: name: ingress-nginx annotations: nginx.ingress.kubernetes.io/rewrite-target: / + namespace: ingress-nginx spec: rules: - http: From 9ffc130449140ebc28097c602f07126824cd8b87 Mon Sep 17 00:00:00 2001 From: codezeron Date: Wed, 12 Apr 2023 13:59:27 -0300 Subject: [PATCH 20/31] fix: fix deploy manifest files --- Dockerfile | 2 +- cron.js | 5 +-- kustom-webapp/base/configmap.yml | 6 ---- kustom-webapp/base/deployment.yml | 33 ----------------- kustom-webapp/base/ingress.yml | 30 ---------------- kustom-webapp/base/service.yml | 13 ------- {kustom-webapp => webapp}/README.md | 0 webapp/deployment.yml | 55 +++++++++++++++++++++++++++++ 8 files changed, 59 insertions(+), 85 deletions(-) delete mode 100644 kustom-webapp/base/configmap.yml delete mode 100644 kustom-webapp/base/deployment.yml delete mode 100644 kustom-webapp/base/ingress.yml delete mode 100644 kustom-webapp/base/service.yml rename {kustom-webapp => webapp}/README.md (100%) create mode 100644 webapp/deployment.yml diff --git a/Dockerfile b/Dockerfile index 7c2864a..4c8da66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ COPY ./todos.js todos.js COPY ./cron.js cron.js EXPOSE 80 -ENTRYPOINT [ "node", "server" ] +ENTRYPOINT [ "node", "cron" ] diff --git a/cron.js b/cron.js index 45668f1..7cfa99d 100644 --- a/cron.js +++ b/cron.js @@ -1,4 +1,5 @@ var CronJob = require('cron').CronJob; +let porta = process.env.PORT || 80; const { default: axios } = require('axios'); var express = require('express'); const http = require(`http`); @@ -6,8 +7,8 @@ const app = express(); app.get(`/health`, (req, res) => res.status(200).json(`OK`)); const server = http.createServer(app); server.listen( - 80, - () => console.log(`-- Backend Service (1337) --`) + porta, + () => console.log(`-- Backend Service (${porta}) --`) ); const job = new CronJob('0 */1 * * * *', async function () { diff --git a/kustom-webapp/base/configmap.yml b/kustom-webapp/base/configmap.yml deleted file mode 100644 index ae5159b..0000000 --- a/kustom-webapp/base/configmap.yml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: my-configmap -# data: -# DATABASE_URL: "postgres://user:password@db-hostname:5432/mydatabase" diff --git a/kustom-webapp/base/deployment.yml b/kustom-webapp/base/deployment.yml deleted file mode 100644 index 357d8ee..0000000 --- a/kustom-webapp/base/deployment.yml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: app-service -spec: - replicas: 1 - selector: - matchLabels: - app: app-service - template: - metadata: - labels: - app: app-service - spec: - containers: - - name: app-service - image: enzoyh/teste-repo:latest - imagePullPolicy: Always - ports: - - containerPort: 80 - protocol: TCP - # env: - # - name: NODE_ENV - # value: "production" - # - name: DATABASE_URL - # value: "postgres://user:password@db-host:5432/my-database" - resources: - requests: - memory: "16Mi" - cpu: "50m" # 500milliCPUs (1/2 CPU) - limits: - memory: "128Mi" - cpu: "100m" diff --git a/kustom-webapp/base/ingress.yml b/kustom-webapp/base/ingress.yml deleted file mode 100644 index 8e0c6c8..0000000 --- a/kustom-webapp/base/ingress.yml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: my-ingress - annotations: - nginx.ingress.kubernetes.io/rewrite-target: / -spec: - rules: - - http: - paths: - - path: /prod - pathType: Prefix - backend: - service: - name: app-service - port: 80 - - - path: /dev - pathType: Prefix - backend: - service: - name: app-service - port: 80 - -resource.customizations: | - extensions/Ingress: - health.lua: | - hs = {} - hs.status = "Healthy" - return hs diff --git a/kustom-webapp/base/service.yml b/kustom-webapp/base/service.yml deleted file mode 100644 index 5b84f95..0000000 --- a/kustom-webapp/base/service.yml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: app-service -spec: - type: ClusterIP - selector: - app: app-service - container-name: app-service - ports: - - protocol: TCP - port: 80 - targetPort: 80 diff --git a/kustom-webapp/README.md b/webapp/README.md similarity index 100% rename from kustom-webapp/README.md rename to webapp/README.md diff --git a/webapp/deployment.yml b/webapp/deployment.yml new file mode 100644 index 0000000..e3cae20 --- /dev/null +++ b/webapp/deployment.yml @@ -0,0 +1,55 @@ +kind: Service +apiVersion: v1 +metadata: + name: employee-app + labels: + app: employee-app +spec: + type: NodePort + selector: + app: employee-app + ports: + - port: 80 + targetPort: 80 + name: http +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: employee-app +spec: + replicas: 1 + selector: + matchLabels: + app: employee-app + template: + metadata: + labels: + app: employee-app + version: v1 + spec: + containers: + - name: employee-app + image: enzoyh/teste-repo:latest + imagePullPolicy: Always + ports: + - containerPort: 80 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: example-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: /$1 +spec: + rules: + - http: + paths: + - path: /testando + pathType: Prefix + backend: + service: + name: employee-app + port: + number: 80 \ No newline at end of file From 25c53cb7f49a7b8c0f2d128f71cc70cee6519bc5 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 19:17:59 -0300 Subject: [PATCH 21/31] Update deployment.yml --- webapp/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/deployment.yml b/webapp/deployment.yml index e3cae20..cd40aa2 100644 --- a/webapp/deployment.yml +++ b/webapp/deployment.yml @@ -41,7 +41,7 @@ metadata: name: example-ingress annotations: kubernetes.io/ingress.class: "nginx" - nginx.ingress.kubernetes.io/rewrite-target: /$1 + nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: rules: - http: @@ -52,4 +52,4 @@ spec: service: name: employee-app port: - number: 80 \ No newline at end of file + number: 80 From 4b7ceef34b9bb5a7a6d6d9ae56f7ed991b344017 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 19:25:57 -0300 Subject: [PATCH 22/31] Update deployment.yml --- webapp/deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/deployment.yml b/webapp/deployment.yml index cd40aa2..6db8ec8 100644 --- a/webapp/deployment.yml +++ b/webapp/deployment.yml @@ -41,12 +41,13 @@ metadata: name: example-ingress annotations: kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: rules: - http: paths: - - path: /testando + - path: /testando(/|$)(.*) pathType: Prefix backend: service: From 790cf0941d83c12d145ae25ad1e0f1f4d0f93c48 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 19:31:13 -0300 Subject: [PATCH 23/31] Update deployment.yml --- webapp/deployment.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webapp/deployment.yml b/webapp/deployment.yml index 6db8ec8..27eded7 100644 --- a/webapp/deployment.yml +++ b/webapp/deployment.yml @@ -41,13 +41,11 @@ metadata: name: example-ingress annotations: kubernetes.io/ingress.class: "nginx" - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: rules: - http: paths: - - path: /testando(/|$)(.*) + - path: /testando pathType: Prefix backend: service: From 2ecd3775024bb93b297d2fa6474ff3349bd54d3c Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 19:42:05 -0300 Subject: [PATCH 24/31] Revert "Update deployment.yml" --- webapp/deployment.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/deployment.yml b/webapp/deployment.yml index 27eded7..6db8ec8 100644 --- a/webapp/deployment.yml +++ b/webapp/deployment.yml @@ -41,11 +41,13 @@ metadata: name: example-ingress annotations: kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: rules: - http: paths: - - path: /testando + - path: /testando(/|$)(.*) pathType: Prefix backend: service: From f73341195ad1c5b3855b188a6b9eb6fbcb0a9c41 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 19:59:46 -0300 Subject: [PATCH 25/31] Update README.md --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7e8e5d9..c291ff3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ -# A Simple Nodejs API +## A Simple Nodejs API with OCI oke + +First you must have kubectl and Argo-cd intalled on your oci`s cluster +`https://argo-cd.readthedocs.io/en/stable/getting_started` + +Second, create app in Argo-cd server and write your custom namespace on "destination" space + +After syncing, write on browser: +`http://144.22.248.251/testando/health` + +Where above ip is your LoadBalancer external ip, if you don`t know, write +`kubectl get ingress --all-namespaces` +or +`kubectl get ingress -n ` -## Running the Application -1. Run `npm install` -2. Run `node server` From c5d75cd5bd82d86cc1e39fadc01d60566087bec9 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 20:00:16 -0300 Subject: [PATCH 26/31] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c291ff3..11acfca 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Second, create app in Argo-cd server and write your custom namespace on "destina After syncing, write on browser: `http://144.22.248.251/testando/health` -Where above ip is your LoadBalancer external ip, if you don`t know, write +Where above ip is your LoadBalancer external ip, if you don't know, write `kubectl get ingress --all-namespaces` or `kubectl get ingress -n ` From 9037446a2e8fbebc18a0d77f8f2e1fa8eb80beab Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 20:00:48 -0300 Subject: [PATCH 27/31] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11acfca..7cc0384 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## A Simple Nodejs API with OCI oke -First you must have kubectl and Argo-cd intalled on your oci`s cluster +First you must have kubectl and Argo-cd intalled on your oci's cluster\n `https://argo-cd.readthedocs.io/en/stable/getting_started` Second, create app in Argo-cd server and write your custom namespace on "destination" space @@ -8,7 +8,7 @@ Second, create app in Argo-cd server and write your custom namespace on "destina After syncing, write on browser: `http://144.22.248.251/testando/health` -Where above ip is your LoadBalancer external ip, if you don't know, write +Where above ip is your LoadBalancer external ip, if you don't know, write:\n `kubectl get ingress --all-namespaces` or `kubectl get ingress -n ` From e0a065a0d53e5e0686b38b5daadf2cfe84de35f4 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 20:01:51 -0300 Subject: [PATCH 28/31] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cc0384..30fe254 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## A Simple Nodejs API with OCI oke -First you must have kubectl and Argo-cd intalled on your oci's cluster\n +First you must have kubectl and Argo-cd intalled on your oci's cluster
`https://argo-cd.readthedocs.io/en/stable/getting_started` Second, create app in Argo-cd server and write your custom namespace on "destination" space @@ -8,7 +8,7 @@ Second, create app in Argo-cd server and write your custom namespace on "destina After syncing, write on browser: `http://144.22.248.251/testando/health` -Where above ip is your LoadBalancer external ip, if you don't know, write:\n +Where above ip is your LoadBalancer external ip, if you don't know, write: `kubectl get ingress --all-namespaces` or `kubectl get ingress -n ` From 26a3cac16f128ecd2222e7f3869885ea82e6e2ff Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 20:02:16 -0300 Subject: [PATCH 29/31] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30fe254..c71fc36 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,11 @@ Second, create app in Argo-cd server and write your custom namespace on "destina After syncing, write on browser: `http://144.22.248.251/testando/health` -Where above ip is your LoadBalancer external ip, if you don't know, write: +Where above ip is your LoadBalancer external ip, if you don't know, write:
`kubectl get ingress --all-namespaces` +
or +
`kubectl get ingress -n ` From 6666ad9480ca89a2212abe1accd6a8af1d995d0c Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 20:06:48 -0300 Subject: [PATCH 30/31] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c71fc36..6c3df2d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ Second, create app in Argo-cd server and write your custom namespace on "destina After syncing, write on browser: `http://144.22.248.251/testando/health` +It shoud return +`OK` + Where above ip is your LoadBalancer external ip, if you don't know, write:
`kubectl get ingress --all-namespaces`
From 57c61c8d5d9f92eb8162d09161d95479e324f272 Mon Sep 17 00:00:00 2001 From: "Enzo Y. Hashimoto" Date: Wed, 12 Apr 2023 20:07:06 -0300 Subject: [PATCH 31/31] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c3df2d..a12cfe8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ After syncing, write on browser: `http://144.22.248.251/testando/health` It shoud return -`OK` +`"OK"` Where above ip is your LoadBalancer external ip, if you don't know, write:
`kubectl get ingress --all-namespaces`