diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0e74795..0000000 --- a/.gitignore +++ /dev/null @@ -1,162 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -.idea/ - -# vscode -.vscode \ No newline at end of file diff --git a/app/.env b/app/.env deleted file mode 100644 index a529bc0..0000000 --- a/app/.env +++ /dev/null @@ -1,14 +0,0 @@ -LOCAL_POSTGRESQL_HOST="192.168.10.10:31850" -LOCAL_POSTGRESQL_USER="root" -LOCAL_POSTGRESQL_PASSWORD="password" -LOCAL_POSTGRESQL_DB="jcp" - -DEV_POSTGRESQL_HOST="127.0.0.1:5432" -DEV_POSTGRESQL_USER="root" -DEV_POSTGRESQL_PASSWORD="password" -DEV_POSTGRESQL_DB="jcp" - -PROD_POSTGRESQL_HOST="127.0.0.1:5432" -PROD_POSTGRESQL_USER="root" -PROD_POSTGRESQL_PASSWORD="password" -PROD_POSTGRESQL_DB="jcp" \ No newline at end of file diff --git a/app/api/__init__.py b/app/api/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/api/project.py b/app/api/project.py deleted file mode 100644 index 9de51d6..0000000 --- a/app/api/project.py +++ /dev/null @@ -1,93 +0,0 @@ -from fastapi import APIRouter, Depends, status -from fastapi.responses import JSONResponse -from sqlalchemy.orm import Session -from db_session import get_db -from domain.project.schemas import ( - RequestCreateProject, - RequestDeleteProject, - RequestGetProject -) -from domain.project.service import ProjectManager -from logger import log - -router = APIRouter( - prefix="/api/v1/project", - tags=["project"] -) - -@router.get("/") -async def project( - name: str = None, db: Session = Depends(get_db) - ): - """프로젝트 조회""" - log.info("============= /project/ is called ============= ") - project_manager = ProjectManager() - - if name is None: - return JSONResponse( - status_code=status.HTTP_400_BAD_REQUEST, - content="이름을 입력하지 않았습니다" - ) - - request = RequestGetProject(name=name) - - try: - status_code, detail = project_manager.getProject(request=request, db=db) - except Exception as e: - log.error(f"[프로젝트 조회 서비스 호출오류] 예기치 못한 오류: {e}") - return JSONResponse( - status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - content="" - ) - - return JSONResponse( - status_code=status_code, - content=dict(detail) - ) - -@router.post("/") -async def create( - request: RequestCreateProject, db: Session = Depends(get_db) - ): - """프로젝트 생성""" - log.info("============= /project/create is called ============= ") - project_manager = ProjectManager() - try: - status_code, detail = project_manager.createProject(request=request, db=db) - except Exception as e: - log.error(f"[프로젝트 생성 서비스 호출오류] 예기치 못한 오류: {e}") - return JSONResponse( - status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - content="" - ) - - return JSONResponse( - status_code=status_code, - content=dict(detail) - ) - -@router.delete("/") -async def delete( - request: RequestDeleteProject, db: Session = Depends(get_db) - ): - """ - 프로젝트 삭제 - :param request: 사용자 삭제요청 - :param db: db 세션 - :return: - """ - log.info("============= /project/delete is called ============= ") - project_manager = ProjectManager() - try: - status_code, detail = project_manager.deleteProject(request=request, db=db) - except Exception as e: - log.error(f"[프로젝트 삭제 서비스 호출오류] 예기치 못한 오류: {e}") - return JSONResponse( - status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - content="프로젝트 삭제 실패" - ) - - return JSONResponse( - status_code=status_code, - content=dict(detail) - ) \ No newline at end of file diff --git a/app/config.py b/app/config.py deleted file mode 100644 index f716ec0..0000000 --- a/app/config.py +++ /dev/null @@ -1,52 +0,0 @@ -from typing import Optional -from pydantic import BaseSettings, Field - - -class GlobalConfig(BaseSettings): - """공통 설정""" - ENV_STATE: str = Field("local", env="MODE") - - POSTGRESQL_HOST: Optional[str] = None - POSTGRESQL_USER: Optional[str] = None - POSTGRESQL_PASSWORD: Optional[str] = None - POSTGRESQL_DB: Optional[str] = None - - class Config: - """BaseSettings 설정""" - env_file: str = ".env" - -class LocalConfig(GlobalConfig): - """개발 설정""" - class Config: - """BaseSettings 설정""" - env_prefix: str = "LOCAL_" - -class DevConfig(GlobalConfig): - """개발 설정""" - class Config: - """BaseSettings 설정""" - env_prefix: str = "DEV_" - -class ProdConfig(GlobalConfig): - """운영 설정""" - class Config: - """BaseSettings 설정""" - env_prefix: str = "PROD_" - -class FactoryConfig: - """설정 로드""" - def __init__(self, env_state: Optional[str]): - self.env_state = env_state - - def __call__(self): - if self.env_state == "local": - return LocalConfig() - - if self.env_state == "dev": - return DevConfig() - - elif self.env_state == "prod": - return ProdConfig() - - -cnf = FactoryConfig(GlobalConfig().ENV_STATE)() diff --git a/app/database.py b/app/database.py deleted file mode 100644 index e442d04..0000000 --- a/app/database.py +++ /dev/null @@ -1,8 +0,0 @@ -from sqlalchemy import create_engine -from config import cnf -from sqlalchemy.orm import sessionmaker - -SQLALCHEMY_DATABASE_URL = f"postgresql://{cnf.POSTGRESQL_USER}:{cnf.POSTGRESQL_PASSWORD}@{cnf.POSTGRESQL_HOST}/{cnf.POSTGRESQL_DB}" -engine = create_engine(SQLALCHEMY_DATABASE_URL, echo=True) - -SessionLocal = sessionmaker(bind=engine, autocommit=False, autoflush=False) diff --git a/app/db_session.py b/app/db_session.py deleted file mode 100644 index 607fd36..0000000 --- a/app/db_session.py +++ /dev/null @@ -1,10 +0,0 @@ -from database import SessionLocal - - -def get_db(): - '''DB 세션관리''' - db = SessionLocal() - try: - yield db - finally: - db.close() diff --git a/app/documents/shcema.md b/app/documents/shcema.md deleted file mode 100644 index 1e0bf65..0000000 --- a/app/documents/shcema.md +++ /dev/null @@ -1,27 +0,0 @@ -# 개요 -* DB 초기화 스크립트 - -# 스크립트 -```sql - -CREATE TABLE users ( - id serial PRIMARY KEY, - name VARCHAR (50) UNIQUE NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL -); - -CREATE TABLE projects ( - id serial PRIMARY KEY, - user_id integer NOT NULL, - name VARCHAR ( 50 ) UNIQUE NOT NULL, - description VARCHAR ( 255 ), - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - CONSTRAINT fk_user_id FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT - INTO users (name, created_at, updated_at) - VALUES ('test-user', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); -``` \ No newline at end of file diff --git a/app/domain/__init__.py b/app/domain/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/domain/project/__init__.py b/app/domain/project/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/domain/project/crud.py b/app/domain/project/crud.py deleted file mode 100644 index 2465e94..0000000 --- a/app/domain/project/crud.py +++ /dev/null @@ -1,73 +0,0 @@ -from sqlalchemy.orm import Session -from domain.project.schemas import ( - RequestCreateProject, - RequestDeleteProject, - RequestGetProject -) -from sqlalchemy import exc, text -from logger import log - - -def createProject(request: RequestCreateProject, db: Session): - """프로젝트 생성""" - try: - statement = text(""" - INSERT INTO - projects (name, user_id, created_at, updated_at) - VALUES(:name, :user_id ,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP) - """) - db.execute(statement, { - "name": request.name, - "user_id": request.user_id - }) - db.commit() - log.info(f"create project success: {request.name}") - except exc.IntegrityError as e: - db.rollback() - raise RuntimeError(e) - except Exception as e: - log.error(f"[-] other error: {e}") - db.rollback() - raise RuntimeError(e) - -def deleteProject(request: RequestDeleteProject, db: Session): - """프로젝트 삭제""" - try: - statement = text(""" - DELETE FROM projects where user_id=(:user_id) and name=(:name) - """) - db.execute(statement, { - "user_id": request.user_id, - "name": request.name - }) - db.commit() - log.info(f"delete project success: {request.name}") - except exc.IntegrityError as e: - log.error(f"[-] {e}이 project table에 없습니다.: {e}") - db.rollback() - raise RuntimeError(e) - except Exception as e: - db.rollback() - raise RuntimeError(e) - -def getProject(request: RequestGetProject, db: Session): - """프로젝트 조회""" - try: - statement = text(""" - SELECT id, name, description - from projects - where user_id=(:user_id) and name=(:name) - """) - row = db.execute(statement, { - "user_id": request.user_id, - "name": request.name - }) - log.info(f"get project success: {request.name}") - except exc.IntegrityError as e: - log.error(f"[-] {e}이 project table에 없습니다.: {e}") - raise RuntimeError(e) - except Exception as e: - log.error(f"[-] other error: {e}") - raise RuntimeError(e) - else: - return row diff --git a/app/domain/project/schemas.py b/app/domain/project/schemas.py deleted file mode 100644 index a418e81..0000000 --- a/app/domain/project/schemas.py +++ /dev/null @@ -1,33 +0,0 @@ -from pydantic import BaseModel - - -class RequestGetProject(BaseModel): - """프로젝트 조회 요청""" - user_id: int = 1 # 테스트 user_id - name: str - -class ResponseGetProject(BaseModel): - """프로젝트 조회 응답""" - id: str - name: str - error_detail: str - -class RequestCreateProject(BaseModel): - """프로젝트 생성 요청""" - user_id: int = 1 # 테스트 user_id - name: str - -class ResponseCreateProject(BaseModel): - """프로젝트 생성 응답""" - name: str - error_detail: str - -class RequestDeleteProject(BaseModel): - """프로젝트 삭제 요청""" - user_id: int = 1 # 테스트 user_id - name: str - -class ResponseDeleteProject(BaseModel): - """프로젝트 삭제 응답""" - name: str - error_detail: str \ No newline at end of file diff --git a/app/domain/project/service.py b/app/domain/project/service.py deleted file mode 100644 index b99e740..0000000 --- a/app/domain/project/service.py +++ /dev/null @@ -1,158 +0,0 @@ -from fastapi import status -from kubernetes.client.exceptions import ApiException -from domain.project.schemas import ( - RequestCreateProject, - ResponseCreateProject, - RequestDeleteProject, - ResponseDeleteProject, - ResponseGetProject, - RequestGetProject -) -import domain.project.crud as project_crud -from logger import log -from module.k8s import JCPK8S - - -class ProjectManager: - def createProject(self, request: RequestCreateProject, db) -> (int, ResponseCreateProject): - """프로젝트 생성""" - k8s = JCPK8S() - - if not self.createProjectValid(namespace=request.name): - return False - - # 쿠버네티스 namespace 생성 - try: - k8s.createNamespace(namespace=request.name) - except ApiException as e: - if e.status == 409: - log.error(f"[프로젝트 생성 오류] k8s namespace {request.name}이 이미 존재합니다") - return status.HTTP_409_CONFLICT, \ - ResponseCreateProject( - name=request.name, - error_detail=f"{request.name}이 이미 존재합니다." - ) - - log.error(f"[프로젝트 생성 오류] k8s namespace {request.name} 기타 생성오류: {e.status}. {e}") - return status.HTTP_500_INTERNAL_SERVER_ERROR, \ - ResponseCreateProject( - name=request.name, - error_detail=str(e) - ) - - # github repo 생성 - # createRepo(repo_name=request.name, token=request.github_token) - - # db 업데이트 - try: - project_crud.createProject(request=request, db=db) - except Exception as e: - db_error_code = e.args[0].orig.pgcode - if db_error_code == "23503": - log.error(f"[프로젝트 생성 오류] 데이터베이스 오류: user_id가 존재하지 않음 {db_error_code}->{e}") - else: - log.error(f"[프로젝트 생성 오류] 데이터베이스 오류: 기타에러 {e.args[0].code}->{e}") - - # 생성했던 쿠버네티스 네임스페이스 삭제 - try: - k8s.deleteNamespace(namespace=request.name) - except Exception: - pass - - return status.HTTP_500_INTERNAL_SERVER_ERROR, \ - ResponseCreateProject( - name=request.name, - error_detail="프로젝트 생성을 실패했습니다." - ) - - return status.HTTP_201_CREATED, \ - ResponseCreateProject( - name=request.name, - error_detail="" - ) - - def deleteProject(self, request: RequestDeleteProject, db) -> (int, ResponseDeleteProject): - """프로젝트 삭제""" - k8s = JCPK8S() - - # 쿠버네티스 네임스페이스 삭제 - try: - k8s.deleteNamespace(namespace=request.name) - except ApiException as e: - pass - - # DB행 삭제 - try: - project_crud.deleteProject(request=request, db=db) - except Exception as e: - pass - - return status.HTTP_200_OK, \ - ResponseDeleteProject( - name=request.name, - error_detail="" - ) - - def getProject(self, request: RequestGetProject, db) -> (int, ResponseGetProject): - """프로젝트 조회""" - - try: - result = project_crud.getProject(requset=request, db=db) - except Exception as e: - log.error(f"[프로젝트 조회 오류] {request.name} 조회 실패 -> 데이터베이스 오류: {e}") - return status.HTTP_500_INTERNAL_SERVER_ERROR, \ - ResponseGetProject( - id=-1, - name=request.name, - error_detail="프로젝트 조회를 실패했습니다." - ) - - if result.rowcount != 1: - log.error(f"[프로젝트 조회 실패] 단일건 조회({request.name})지만 2개 이상 조회 되었습니다") - return status.HTTP_500_INTERNAL_SERVER_ERROR, \ - ResponseGetProject( - id=-1, - name=request.name, - error_detail="프로젝트 조회를 실패했습니다" - ) - - searched_project = {} - for row in result: - searched_project = dict(row) - - return status.HTTP_200_OK, \ - ResponseGetProject( - id=searched_project["id"], - name=searched_project["name"], - error_detail="" - ) - - def createProjectValid(self, namespace: str) -> bool: - """ - 프로젝트 생성 유효성 검사 - ① k8s namespace 확인 - - :params - namespace: 생성할 쿠버네티스 namespace - - :return - bool - True: 유효성 검사 성공 - False: 유효성 검사 실패 - """ - - return self.isExistK8sNamespace(namespace=namespace) - - def isExistK8sNamespace(self, namespace) -> bool: - """ - 쿠버네티스 namespace 있는지 확인 - - :params - namespace: 생성할 쿠버네티스 namespace - - :return - bool - True: namespace 존재 - False: namespace 미존재 - """ - return True diff --git a/app/log.yaml b/app/log.yaml deleted file mode 100644 index 4dba71e..0000000 --- a/app/log.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# reference: https://docs.python.org/ko/3/howto/logging.html -version: 1 -formatters: - simple: - format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' -handlers: - console: - class: logging.StreamHandler - level: DEBUG - formatter: simple - stream: ext://sys.stdout -loggers: - simple: - level: DEBUG - handlers: [console] - propagate: no -root: - level: DEBUG - handlers: [console] \ No newline at end of file diff --git a/app/logger.py b/app/logger.py deleted file mode 100644 index 012df62..0000000 --- a/app/logger.py +++ /dev/null @@ -1,8 +0,0 @@ -import logging -import yaml - -with open('log.yaml', 'r') as f: - config = yaml.safe_load(f) - -logging.config.dictConfig(config) -log = logging.getLogger('simple') diff --git a/app/main.py b/app/main.py deleted file mode 100644 index aed815e..0000000 --- a/app/main.py +++ /dev/null @@ -1,15 +0,0 @@ -from fastapi import FastAPI -from config import cnf -from api.project import router as project_router -from logger import log - - -app = FastAPI() -app.include_router(project_router) - -@app.get("/") -def read_root(): - log.info(cnf.POSTGRESQL_HOST) - log.info(cnf.POSTGRESQL_USER) - log.info(cnf.POSTGRESQL_PASSWORD) - return {"Hello": "World"} diff --git a/app/module/__init__.py b/app/module/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/module/k8s.py b/app/module/k8s.py deleted file mode 100644 index 3a862a6..0000000 --- a/app/module/k8s.py +++ /dev/null @@ -1,32 +0,0 @@ -from kubernetes import client, config -from config import cnf - - -class JCPK8S: - def __init__(self): - if cnf.ENV_STATE == "local": - config.load_kube_config() - - self.v1 = client.CoreV1Api() - - def createNamespace(self, namespace) -> None: - """ - namespace 생성 - - :param - namespace: namespace 이름 - """ - ns = client.V1Namespace() - ns.metadata = client.V1ObjectMeta(name=namespace) - self.v1.create_namespace(ns) - - def deleteNamespace(self, namespace) -> None: - """ - namespace 삭제 - - :param - namespace: namespace 이름 - :return: - """ - ns = client.V1Namespace() - self.v1.delete_namespace(namespace) diff --git a/app/requirements.txt b/app/requirements.txt deleted file mode 100644 index 6207959..0000000 --- a/app/requirements.txt +++ /dev/null @@ -1,45 +0,0 @@ -anyio==3.5.0 -asgiref==3.5.0 -cachetools==5.1.0 -certifi==2021.10.8 -cffi==1.15.0 -charset-normalizer==2.0.12 -click==8.1.2 -colorama==0.4.4 -Deprecated==1.2.13 -fastapi==0.75.2 -flake8==4.0.1 -google-auth==2.6.6 -greenlet==1.1.2 -h11==0.13.0 -idna==3.3 -kubernetes==23.6.0 -mccabe==0.6.1 -oauthlib==3.2.0 -psycopg2-binary==2.9.3 -pyaml==21.10.1 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -pycodestyle==2.8.0 -pycparser==2.21 -pydantic==1.9.0 -pyflakes==2.4.0 -PyGithub==1.55 -PyJWT==2.4.0 -PyNaCl==1.5.0 -python-dateutil==2.8.2 -python-dotenv==0.20.0 -pytz==2022.1 -PyYAML==6.0 -requests==2.27.1 -requests-oauthlib==1.3.1 -rsa==4.8 -six==1.16.0 -sniffio==1.2.0 -SQLAlchemy==1.4.36 -starlette==0.17.1 -typing_extensions==4.2.0 -urllib3==1.26.9 -uvicorn==0.17.6 -websocket-client==1.3.2 -wrapt==1.14.1 diff --git a/base/deployment.yaml b/base/deployment.yaml new file mode 100644 index 0000000..a5fde55 --- /dev/null +++ b/base/deployment.yaml @@ -0,0 +1,26 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: backend-python +spec: + revisionHistoryLimit: 3 + selector: + matchLabels: + app: backend-python + template: + metadata: + labels: + app: backend-python + spec: + serviceAccount: "backend" + nodeSelector: + role: infra + containers: + - name: core + image: core-image + resources: + limits: + memory: "512Mi" + cpu: "0.5" + ports: + - containerPort: 80 \ No newline at end of file diff --git a/base/ingress.yaml b/base/ingress.yaml new file mode 100644 index 0000000..e750c7c --- /dev/null +++ b/base/ingress.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: backend-python +spec: + ingressClassName: nginx + rules: + - host: core.choilab.xyz + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: backend-python + port: + number: 80 \ No newline at end of file diff --git a/base/kustomization.yaml b/base/kustomization.yaml new file mode 100644 index 0000000..cdc82fe --- /dev/null +++ b/base/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- deployment.yaml +- service.yaml +- ingress.yaml +namespace: jcp \ No newline at end of file diff --git a/base/service.yaml b/base/service.yaml new file mode 100644 index 0000000..c66fdd0 --- /dev/null +++ b/base/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: backend-python +spec: + selector: + app: backend-python + ports: + - port: 80 + targetPort: 80 \ No newline at end of file diff --git a/dev/kustomization.yaml b/dev/kustomization.yaml new file mode 100644 index 0000000..7686eb5 --- /dev/null +++ b/dev/kustomization.yaml @@ -0,0 +1,19 @@ +bases: + - ../base +patches: + - target: + kind: Ingress + name: backend-python + patch: |- + - op: replace + path: /spec/rules/0/host + value: dev-backend.choilab.xyz +namePrefix: dev- +configurations: + - nameReference.yaml +commonLabels: + app: dev-backend-python +images: + - name: core-image + newName: 192.168.0.66:31831/python-backend + newTag: "26" diff --git a/dev/nameReference.yaml b/dev/nameReference.yaml new file mode 100644 index 0000000..9517332 --- /dev/null +++ b/dev/nameReference.yaml @@ -0,0 +1,6 @@ +nameReference: +- kind: Service + version: v1 + fieldSpecs: + - path: spec/rules/http/paths/backend/serviceName + kind: Ingress \ No newline at end of file