chore(deploy): 운영 hyeonworks.com 매니페스트를 지금 상태 그대로 기록한다
hyeonworks-prod의 앱 객체는 kubectl apply로만 들어가 있고 어느 repo에도 정본이 없다. 그래서 무엇이 운영에 떠 있는지 Git으로 볼 수 없고, 이미지나 설정을 바꿀 때 기준이 되는 파일도 없다. live 객체 16개를 deploy/production에 그대로 옮긴다. backend·frontend·redis Deployment, Service 넷, ServiceMonitor, logging ConfigMap, Ingress, NetworkPolicy 여섯이다. 각 객체의 last-applied 설정을 쓰고, 서버가 채우는 칸(uid, resourceVersion, status, clusterIP 등)은 뺐다. 정본 위치는 소유자 결정(2026-11-11, 「앱 쪽은 tech-log repo deploy/」)을 따른다. Namespace, techlog DB Role·Database, 다른 namespace의 NetworkPolicy·Probe· 규칙은 platform-core services/tenants/techlog가 맡는다. hyeonworks-secrets Secret은 Git에 두지 않는다. 위험·한계: 동작은 바뀌지 않는다. 운영 source commit(frontend 7a4e201, backend 46b1cc7)은 아직 Gitea에 없어서, 이 파일들이 가리키는 이미지를 이 repo의 main에서 다시 만들 수는 없다. 검증: kubectl kustomize deploy/production을 live 클러스터에 대고 kubectl diff를 돌렸다. 16개 객체 모두 차이가 0줄이다. 값을 하나씩 보고 비밀 값은 secretKeyRef 참조뿐인 것을 확인했다.
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: techlog-backend
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: techlog-backend
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: techlog-backend
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
containers:
|
||||
- env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: local
|
||||
- name: SPRING_DATASOURCE_URL
|
||||
value: jdbc:postgresql://platform-postgres-rw.platform-data.svc.cluster.local:5432/techlog
|
||||
- name: SPRING_DATASOURCE_USERNAME
|
||||
value: techlog
|
||||
- name: SPRING_DATASOURCE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: APP_DB_PASSWORD
|
||||
name: hyeonworks-secrets
|
||||
- name: SPRING_DATASOURCE_DRIVER_CLASS_NAME
|
||||
value: org.postgresql.Driver
|
||||
- name: SPRING_FLYWAY_ENABLED
|
||||
value: 'true'
|
||||
- name: SPRING_JPA_HIBERNATE_DDL_AUTO
|
||||
value: none
|
||||
- name: CA_SKELETON_PERSISTENCE_VENDOR
|
||||
value: postgresql
|
||||
- name: CA_SKELETON_SECURITY_AUTH_MODE
|
||||
value: redis-session
|
||||
- name: CA_SKELETON_SECURITY_SESSION_COOKIE_NAME
|
||||
value: TECHLOG_SESSION
|
||||
- name: CA_SKELETON_SECURITY_SESSION_PATH
|
||||
value: /
|
||||
- name: CA_SKELETON_SECURITY_SESSION_SECURE
|
||||
value: 'true'
|
||||
- name: CA_SKELETON_SECURITY_SESSION_SAME_SITE
|
||||
value: Lax
|
||||
- name: APP_REDIS_ENABLED
|
||||
value: 'true'
|
||||
- name: APP_REDIS_AUTHENTICATION_ANONYMOUS_ACCESS_ACCEPTED
|
||||
value: 'true'
|
||||
- name: SPRING_DATA_REDIS_HOST
|
||||
value: redis
|
||||
- name: SPRING_DATA_REDIS_PORT
|
||||
value: '6379'
|
||||
- name: SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KEYCLOAK_ISSUER_URI
|
||||
value: https://id.learn.hyeonworks.com/realms/prod
|
||||
- name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KEYCLOAK_CLIENT_ID
|
||||
value: tech-log-bff
|
||||
- name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KEYCLOAK_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: TECHLOG_OIDC_CLIENT_SECRET
|
||||
name: hyeonworks-secrets
|
||||
- name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KEYCLOAK_SCOPE
|
||||
value: openid,profile,email
|
||||
- name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KEYCLOAK_AUTHORIZATION_GRANT_TYPE
|
||||
value: authorization_code
|
||||
- name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KEYCLOAK_REDIRECT_URI
|
||||
value: https://hyeonworks.com/login/oauth2/code/keycloak
|
||||
- name: APP_STUDIO_AUTHOR_ROLE
|
||||
value: site-admin
|
||||
- name: APP_SESSION_TIMEOUT
|
||||
value: 24h
|
||||
- name: APP_STUDIO_POST_LOGIN_REDIRECT
|
||||
value: https://hyeonworks.com/studio
|
||||
- name: APP_SERVER_FORWARD_HEADERS_STRATEGY
|
||||
value: framework
|
||||
- name: CA_SKELETON_CORS_ALLOWED_ORIGINS
|
||||
value: https://hyeonworks.com
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_BACKEND
|
||||
value: s3
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_ENDPOINT
|
||||
value: http://minio.object-storage.svc.cluster.local
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_REGION
|
||||
value: us-east-1
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_PATH_STYLE_ACCESS
|
||||
value: 'true'
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_AUTO_CREATE_BUCKET
|
||||
value: 'false'
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_BUCKET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: S3_BUCKET
|
||||
name: hyeonworks-secrets
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: S3_ACCESS_KEY
|
||||
name: hyeonworks-secrets
|
||||
- name: CA_SKELETON_OBJECTSTORAGE_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: S3_SECRET_KEY
|
||||
name: hyeonworks-secrets
|
||||
- name: TZ
|
||||
value: UTC
|
||||
- name: MANAGEMENT_ENDPOINT_HEALTH_SHOW_COMPONENTS
|
||||
value: always
|
||||
- name: LOGGING_CONFIG
|
||||
value: /etc/techlog-logging/logback-spring.xml
|
||||
- name: APP_TRACING_SAMPLE_RATE
|
||||
value: '0.1'
|
||||
- name: APP_LOG_LEVEL_APP
|
||||
value: INFO
|
||||
- name: APP_LOG_LEVEL_ROOT
|
||||
value: INFO
|
||||
- name: APP_REDIS_NODES
|
||||
value: redis.hyeonworks-prod.svc.cluster.local:6379
|
||||
- name: APP_TRACING_ENABLED
|
||||
value: 'true'
|
||||
image: tech-log-backend:46b1cc7
|
||||
imagePullPolicy: Never
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: management
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 3
|
||||
name: backend
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
protocol: TCP
|
||||
- containerPort: 9001
|
||||
name: management
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 6
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: management
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
resources:
|
||||
limits:
|
||||
memory: 1536Mi
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
startupProbe:
|
||||
failureThreshold: 36
|
||||
httpGet:
|
||||
path: /actuator/health/startup
|
||||
port: management
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
volumeMounts:
|
||||
- mountPath: /etc/techlog-logging
|
||||
name: logging-config
|
||||
readOnly: true
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
securityContext: {}
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- configMap:
|
||||
name: techlog-logging
|
||||
name: logging-config
|
||||
@@ -0,0 +1,81 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
logback-spring.xml: "<configuration>\n <include resource=\"org/springframework/boot/logging/logback/defaults.xml\"\
|
||||
\ />\n\n \n <springProperty scope=\"context\" name=\"APP_NAME\" source=\"APP_NAME\" defaultValue=\"\
|
||||
tech-log-backend\" />\n <springProperty scope=\"context\" name=\"APP_PROFILE\" source=\"SPRING_PROFILES_ACTIVE\"\
|
||||
\ defaultValue=\"local\" />\n\n <springProperty scope=\"context\" name=\"FILE_ENABLED\" source=\"\
|
||||
APP_LOG_FILE_ENABLED\" defaultValue=\"false\" />\n <springProperty scope=\"context\" name=\"FILE_PATH\"\
|
||||
\ source=\"APP_LOG_FILE_PATH\" defaultValue=\"logs/tech-log-backend.json\" />\n <springProperty\
|
||||
\ scope=\"context\" name=\"FILE_MAX_SIZE\" source=\"APP_LOG_FILE_MAX_SIZE\" defaultValue=\"100MB\"\
|
||||
\ />\n <springProperty scope=\"context\" name=\"FILE_MAX_HISTORY\" source=\"APP_LOG_FILE_MAX_HISTORY\"\
|
||||
\ defaultValue=\"14\" />\n <springProperty scope=\"context\" name=\"FILE_TOTAL_SIZE_CAP\" source=\"\
|
||||
APP_LOG_FILE_TOTAL_SIZE_CAP\" defaultValue=\"3GB\" />\n\n <springProperty scope=\"context\" name=\"\
|
||||
ASYNC_ENABLED\" source=\"APP_LOG_ASYNC_ENABLED\" defaultValue=\"true\" />\n <springProperty scope=\"\
|
||||
context\" name=\"ASYNC_QUEUE_SIZE\" source=\"APP_LOG_ASYNC_QUEUE_SIZE\" defaultValue=\"512\" />\n\
|
||||
\ <springProperty scope=\"context\" name=\"ASYNC_DISCARDING_THRESHOLD\" source=\"APP_LOG_ASYNC_DISCARDING_THRESHOLD\"\
|
||||
\ defaultValue=\"20\" />\n\n <springProperty scope=\"context\" name=\"JSON_TIMEZONE\" source=\"\
|
||||
APP_LOG_JSON_TIMEZONE\" defaultValue=\"UTC\" />\n <springProperty scope=\"context\" name=\"JSON_TIMESTAMP_PATTERN\"\
|
||||
\ source=\"APP_LOG_JSON_TIMESTAMP_PATTERN\" defaultValue=\"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\" />\n \
|
||||
\ <springProperty scope=\"context\" name=\"JSON_INCLUDE_CALLER_DATA\" source=\"APP_LOG_JSON_INCLUDE_CALLER_DATA\"\
|
||||
\ defaultValue=\"false\" />\n <springProperty scope=\"context\" name=\"JSON_LOGGER_NAME_LENGTH\"\
|
||||
\ source=\"APP_LOG_JSON_LOGGER_NAME_LENGTH\" defaultValue=\"0\" />\n\n \n <springProperty scope=\"\
|
||||
context\" name=\"LOG_SAMPLING_RATE\" source=\"APP_LOG_SAMPLING_RATE\" defaultValue=\"1.0\" />\n\n\
|
||||
\ \n <conversionRule conversionWord=\"maskedMsg\" class=\"dev.caskeleton.bootstrap.logging.SecretMaskingMessageConverter\"\
|
||||
\ />\n\n \n <turboFilter class=\"dev.caskeleton.bootstrap.logging.SamplingTurboFilter\">\n \
|
||||
\ <rate>${LOG_SAMPLING_RATE}</rate>\n </turboFilter>\n <turboFilter class=\"dev.caskeleton.bootstrap.logging.StartupFailureSpringBootLogFilter\"\
|
||||
\ />\n\n \n\n \n <appender name=\"CONSOLE\" class=\"ch.qos.logback.core.ConsoleAppender\"\
|
||||
>\n <encoder class=\"net.logstash.logback.encoder.LogstashEncoder\">\n <includeContext>false</includeContext>\n\
|
||||
\ <customFields>{\"app\":\"${APP_NAME}\",\"profile\":\"${APP_PROFILE}\"}</customFields>\n\
|
||||
\ <includeMdcKeyName>trace_id</includeMdcKeyName>\n <includeMdcKeyName>span_id</includeMdcKeyName>\n\
|
||||
\ <includeMdcKeyName>request_id</includeMdcKeyName>\n <includeMdcKeyName>correlation_id</includeMdcKeyName>\n\
|
||||
\ <includeMdcKeyName>user_principal</includeMdcKeyName>\n <timeZone>${JSON_TIMEZONE}</timeZone>\n\
|
||||
\ <timestampPattern>${JSON_TIMESTAMP_PATTERN}</timestampPattern>\n <includeCallerData>${JSON_INCLUDE_CALLER_DATA}</includeCallerData>\n\
|
||||
\ <shortenedLoggerNameLength>${JSON_LOGGER_NAME_LENGTH}</shortenedLoggerNameLength>\n\
|
||||
\ <jsonGeneratorDecorator class=\"dev.caskeleton.bootstrap.logging.SecretMaskingJsonGeneratorDecorator\"\
|
||||
\ />\n </encoder>\n </appender>\n <condition class=\"ch.qos.logback.core.boolex.PropertyEqualityCondition\"\
|
||||
>\n <key>FILE_ENABLED</key><value>true</value>\n </condition>\n <if>\n <then>\n\
|
||||
\ <appender name=\"JSON_FILE\" class=\"ch.qos.logback.core.rolling.RollingFileAppender\"\
|
||||
>\n <file>${FILE_PATH}</file>\n <rollingPolicy class=\"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy\"\
|
||||
>\n <fileNamePattern>${FILE_PATH}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>\n \
|
||||
\ <maxFileSize>${FILE_MAX_SIZE}</maxFileSize>\n <maxHistory>${FILE_MAX_HISTORY}</maxHistory>\n\
|
||||
\ <totalSizeCap>${FILE_TOTAL_SIZE_CAP}</totalSizeCap>\n </rollingPolicy>\n\
|
||||
\ <encoder class=\"net.logstash.logback.encoder.LogstashEncoder\">\n \
|
||||
\ <includeContext>false</includeContext>\n <customFields>{\"app\":\"${APP_NAME}\"\
|
||||
,\"profile\":\"${APP_PROFILE}\"}</customFields>\n <includeMdcKeyName>trace_id</includeMdcKeyName>\n\
|
||||
\ <includeMdcKeyName>span_id</includeMdcKeyName>\n <includeMdcKeyName>request_id</includeMdcKeyName>\n\
|
||||
\ <includeMdcKeyName>correlation_id</includeMdcKeyName>\n <includeMdcKeyName>user_principal</includeMdcKeyName>\n\
|
||||
\ <timeZone>${JSON_TIMEZONE}</timeZone>\n <timestampPattern>${JSON_TIMESTAMP_PATTERN}</timestampPattern>\n\
|
||||
\ <includeCallerData>${JSON_INCLUDE_CALLER_DATA}</includeCallerData>\n \
|
||||
\ <shortenedLoggerNameLength>${JSON_LOGGER_NAME_LENGTH}</shortenedLoggerNameLength>\n \
|
||||
\ <jsonGeneratorDecorator class=\"dev.caskeleton.bootstrap.logging.SecretMaskingJsonGeneratorDecorator\"\
|
||||
\ />\n </encoder>\n </appender>\n </then>\n </if>\n\n \n\n\
|
||||
\ <condition class=\"ch.qos.logback.core.boolex.PropertyEqualityCondition\">\n <key>ASYNC_ENABLED</key><value>true</value>\n\
|
||||
\ </condition>\n <if>\n <then>\n <appender name=\"ASYNC_CONSOLE\" class=\"\
|
||||
dev.caskeleton.bootstrap.logging.MetricsAsyncAppender\">\n <queueSize>${ASYNC_QUEUE_SIZE}</queueSize>\n\
|
||||
\ <discardingThreshold>${ASYNC_DISCARDING_THRESHOLD}</discardingThreshold>\n \
|
||||
\ <neverBlock>false</neverBlock>\n <appender-ref ref=\"CONSOLE\" />\n \
|
||||
\ </appender>\n <condition class=\"ch.qos.logback.core.boolex.PropertyEqualityCondition\"\
|
||||
>\n <key>FILE_ENABLED</key><value>true</value>\n </condition>\n \
|
||||
\ <if>\n <then>\n <appender name=\"ASYNC_FILE\" class=\"dev.caskeleton.bootstrap.logging.MetricsAsyncAppender\"\
|
||||
>\n <queueSize>${ASYNC_QUEUE_SIZE}</queueSize>\n <discardingThreshold>${ASYNC_DISCARDING_THRESHOLD}</discardingThreshold>\n\
|
||||
\ <neverBlock>false</neverBlock>\n <appender-ref ref=\"\
|
||||
JSON_FILE\" />\n </appender>\n </then>\n </if>\n \
|
||||
\ </then>\n </if>\n\n \n\n \n <condition class=\"ch.qos.logback.core.boolex.PropertyEqualityCondition\"\
|
||||
>\n <key>ASYNC_ENABLED</key><value>true</value>\n </condition>\n <if>\n <then>\n\
|
||||
\ <condition class=\"ch.qos.logback.core.boolex.PropertyEqualityCondition\">\n \
|
||||
\ <key>FILE_ENABLED</key><value>true</value>\n </condition>\n <if>\n\
|
||||
\ <then>\n <root level=\"INFO\">\n <appender-ref\
|
||||
\ ref=\"ASYNC_CONSOLE\" />\n <appender-ref ref=\"ASYNC_FILE\" />\n \
|
||||
\ </root>\n </then>\n <else>\n <root level=\"\
|
||||
INFO\">\n <appender-ref ref=\"ASYNC_CONSOLE\" />\n </root>\n\
|
||||
\ </else>\n </if>\n </then>\n <else>\n <condition\
|
||||
\ class=\"ch.qos.logback.core.boolex.PropertyEqualityCondition\">\n <key>FILE_ENABLED</key><value>true</value>\n\
|
||||
\ </condition>\n <if>\n <then>\n <root level=\"\
|
||||
INFO\">\n <appender-ref ref=\"CONSOLE\" />\n <appender-ref\
|
||||
\ ref=\"JSON_FILE\" />\n </root>\n </then>\n <else>\n\
|
||||
\ <root level=\"INFO\">\n <appender-ref ref=\"CONSOLE\"\
|
||||
\ />\n </root>\n </else>\n </if>\n </else>\n \
|
||||
\ </if>\n</configuration>"
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: techlog-logging
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
labels:
|
||||
observability.hyeonworks.com/instance: home
|
||||
name: techlog-backend
|
||||
spec:
|
||||
endpoints:
|
||||
- interval: 30s
|
||||
path: /actuator/prometheus
|
||||
port: management
|
||||
relabelings:
|
||||
- replacement: techlog
|
||||
targetLabel: application
|
||||
scrapeTimeout: 10s
|
||||
selector:
|
||||
matchLabels:
|
||||
app: techlog-backend
|
||||
component: management
|
||||
@@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: techlog-backend
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: techlog-backend
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: techlog-backend
|
||||
component: management
|
||||
name: techlog-management
|
||||
spec:
|
||||
ports:
|
||||
- name: management
|
||||
port: 9001
|
||||
targetPort: management
|
||||
selector:
|
||||
app: techlog-backend
|
||||
type: ClusterIP
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: techlog-frontend
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: techlog-frontend
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 25%
|
||||
maxUnavailable: 25%
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: techlog-frontend
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
containers:
|
||||
- image: docker.io/library/tech-log-frontend:7a4e201
|
||||
imagePullPolicy: Never
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /config.json
|
||||
port: 80
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: frontend
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /config.json
|
||||
port: 80
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 5
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 20m
|
||||
memory: 32Mi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
securityContext: {}
|
||||
terminationGracePeriodSeconds: 30
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: techlog-frontend
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: techlog-frontend
|
||||
type: ClusterIP
|
||||
@@ -0,0 +1,47 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||
name: hyeonworks-core
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: hyeonworks.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: techlog-backend
|
||||
port:
|
||||
number: 8080
|
||||
path: /api
|
||||
pathType: Prefix
|
||||
- backend:
|
||||
service:
|
||||
name: techlog-backend
|
||||
port:
|
||||
number: 8080
|
||||
path: /oauth2
|
||||
pathType: Prefix
|
||||
- backend:
|
||||
service:
|
||||
name: techlog-backend
|
||||
port:
|
||||
number: 8080
|
||||
path: /login
|
||||
pathType: Prefix
|
||||
- backend:
|
||||
service:
|
||||
name: techlog-backend
|
||||
port:
|
||||
number: 8080
|
||||
path: /logout
|
||||
pathType: Prefix
|
||||
- backend:
|
||||
service:
|
||||
name: techlog-frontend
|
||||
port:
|
||||
number: 80
|
||||
path: /
|
||||
pathType: Prefix
|
||||
@@ -0,0 +1,21 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
# Application side of hyeonworks.com in the hyeonworks-prod namespace.
|
||||
# The Namespace, the techlog database role and database, and the
|
||||
# NetworkPolicies, Probes and rules in platform namespaces belong to
|
||||
# platform-core services/tenants/techlog. The hyeonworks-secrets Secret is
|
||||
# created outside Git.
|
||||
namespace: hyeonworks-prod
|
||||
|
||||
resources:
|
||||
- backend-logging-configmap.yaml
|
||||
- backend-deployment.yaml
|
||||
- backend-services.yaml
|
||||
- backend-servicemonitor.yaml
|
||||
- redis-deployment.yaml
|
||||
- redis-service.yaml
|
||||
- frontend-deployment.yaml
|
||||
- frontend-service.yaml
|
||||
- ingress.yaml
|
||||
- network-policies.yaml
|
||||
@@ -0,0 +1,161 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: techlog-backend-egress
|
||||
spec:
|
||||
egress:
|
||||
- ports:
|
||||
- port: 5432
|
||||
protocol: TCP
|
||||
to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: platform-data
|
||||
podSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: platform-postgres
|
||||
- ports:
|
||||
- port: 9000
|
||||
protocol: TCP
|
||||
to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: object-storage
|
||||
podSelector:
|
||||
matchLabels:
|
||||
aistor.min.io/objectStore: minio-aistor
|
||||
- ports:
|
||||
- port: 6379
|
||||
protocol: TCP
|
||||
to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: hyeonworks-prod
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
- ports:
|
||||
- port: 443
|
||||
protocol: TCP
|
||||
to:
|
||||
- ipBlock:
|
||||
cidr: 192.168.0.107/32
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: techlog-backend
|
||||
policyTypes:
|
||||
- Egress
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: techlog-backend-ingress
|
||||
spec:
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: traefik
|
||||
ports:
|
||||
- port: 8080
|
||||
protocol: TCP
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: observability
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: prometheus
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: observability
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: prometheus-blackbox-exporter
|
||||
ports:
|
||||
- port: 9001
|
||||
protocol: TCP
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: techlog-backend
|
||||
policyTypes:
|
||||
- Ingress
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: techlog-default-deny
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: techlog-dns-egress
|
||||
spec:
|
||||
egress:
|
||||
- ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
- port: 53
|
||||
protocol: TCP
|
||||
to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
k8s-app: kube-dns
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Egress
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: techlog-frontend-ingress
|
||||
spec:
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: traefik
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: techlog-frontend
|
||||
policyTypes:
|
||||
- Ingress
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: techlog-redis-ingress
|
||||
spec:
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: hyeonworks-prod
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: techlog-backend
|
||||
ports:
|
||||
- port: 6379
|
||||
protocol: TCP
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
policyTypes:
|
||||
- Ingress
|
||||
@@ -0,0 +1,66 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
containers:
|
||||
- args:
|
||||
- redis-server
|
||||
- --save
|
||||
- ''
|
||||
- --appendonly
|
||||
- 'no'
|
||||
image: redis:7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- redis-cli
|
||||
- ping
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 15
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: redis
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: redis
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- redis-cli
|
||||
- ping
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 256Mi
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
securityContext: {}
|
||||
terminationGracePeriodSeconds: 30
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
spec:
|
||||
ports:
|
||||
- name: redis
|
||||
port: 6379
|
||||
protocol: TCP
|
||||
targetPort: 6379
|
||||
selector:
|
||||
app: redis
|
||||
type: ClusterIP
|
||||
Reference in New Issue
Block a user