CHORE(app): add ArgoCD SSL configuration
- Enable SSL for ArgoCD API - Configure TLS settings
This commit is contained in:
@@ -37,6 +37,12 @@ spec:
|
|||||||
name: argocd-token
|
name: argocd-token
|
||||||
key: token
|
key: token
|
||||||
optional: false
|
optional: false
|
||||||
|
- name: ARGOCD_CA_CERT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: argocd-ca-cert
|
||||||
|
key: ca.crt
|
||||||
|
optional: true
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "100Mi"
|
memory: "100Mi"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ commonLabels:
|
|||||||
# 이미지 태그 설정
|
# 이미지 태그 설정
|
||||||
images:
|
images:
|
||||||
- name: ghcr.io/mayne0213/portfolio
|
- name: ghcr.io/mayne0213/portfolio
|
||||||
newTag: main-sha-db21ed85671bdb8b6153d06250e41821772003dc
|
newTag: main-sha-4f895110ef62cc58495fc98f825d39ed42088d25
|
||||||
|
|
||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
- deployment-patch.yaml
|
- deployment-patch.yaml
|
||||||
|
|||||||
@@ -4,6 +4,36 @@ import { NextRequest, NextResponse } from 'next/server';
|
|||||||
// 외부에서 실행되는 경우 환경 변수로 설정 가능
|
// 외부에서 실행되는 경우 환경 변수로 설정 가능
|
||||||
const ARGOCD_SERVER_URL = process.env.ARGOCD_SERVER_URL || 'https://argocd-server.argocd.svc.cluster.local';
|
const ARGOCD_SERVER_URL = process.env.ARGOCD_SERVER_URL || 'https://argocd-server.argocd.svc.cluster.local';
|
||||||
const ARGOCD_TOKEN = process.env.ARGOCD_TOKEN || '';
|
const ARGOCD_TOKEN = process.env.ARGOCD_TOKEN || '';
|
||||||
|
const ARGOCD_CA_CERT = process.env.ARGOCD_CA_CERT || '';
|
||||||
|
|
||||||
|
// Node.js 환경에서 커스텀 fetch 함수 생성 (인증서 지원)
|
||||||
|
async function fetchWithCert(url: string, options: RequestInit = {}): Promise<Response> {
|
||||||
|
// 브라우저 환경에서는 기본 fetch 사용
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
return fetch(url, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Node.js 환경에서 인증서가 있으면 커스텀 agent 사용
|
||||||
|
if (ARGOCD_CA_CERT) {
|
||||||
|
const https = require('https');
|
||||||
|
const { Agent } = https;
|
||||||
|
|
||||||
|
const agent = new Agent({
|
||||||
|
ca: ARGOCD_CA_CERT,
|
||||||
|
rejectUnauthorized: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Node.js의 fetch에 agent 전달
|
||||||
|
const nodeOptions: any = {
|
||||||
|
...options,
|
||||||
|
agent,
|
||||||
|
};
|
||||||
|
|
||||||
|
return fetch(url, nodeOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
return fetch(url, options);
|
||||||
|
}
|
||||||
|
|
||||||
interface ArgoCDApplication {
|
interface ArgoCDApplication {
|
||||||
metadata: {
|
metadata: {
|
||||||
@@ -51,12 +81,11 @@ export async function GET(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ArgoCD API v1 - Get applications
|
// ArgoCD API v1 - Get applications
|
||||||
const response = await fetch(`${ARGOCD_SERVER_URL}/api/v1/applications`, {
|
const response = await fetchWithCert(`${ARGOCD_SERVER_URL}/api/v1/applications`, {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${ARGOCD_TOKEN}`,
|
'Authorization': `Bearer ${ARGOCD_TOKEN}`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
// Next.js에서 외부 API 호출 시 캐시 설정
|
|
||||||
cache: 'no-store',
|
cache: 'no-store',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const HeaderMenuItemsMobile = () => {
|
|||||||
const Header = () => {
|
const Header = () => {
|
||||||
return (
|
return (
|
||||||
<header
|
<header
|
||||||
className="fixed h-[70px] top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60"
|
className="fixed h-[70px] top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60"
|
||||||
>
|
>
|
||||||
<div className="flex justify-between items-center tracking-wider tablet:tracking-widest font-brand-book px-4 pc:px-8 py-4 max-w-[1920px] mx-auto">
|
<div className="flex justify-between items-center tracking-wider tablet:tracking-widest font-brand-book px-4 pc:px-8 py-4 max-w-[1920px] mx-auto">
|
||||||
<HeaderProfile
|
<HeaderProfile
|
||||||
|
|||||||
Reference in New Issue
Block a user