Skip to content

Commit

Permalink
FEAT
Browse files Browse the repository at this point in the history
init apply web application yaml
  • Loading branch information
MJun111 committed Jan 8, 2024
1 parent 3eef3ac commit a64495e
Show file tree
Hide file tree
Showing 32 changed files with 504 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
env.yaml
env.yaml
**docker-compose.yml
**ingress.yaml
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
# jeontongju.infra
# K8S Command

## Namespace 적용 (default)

```
kubectl ns default
```

## EFS 마운트 확인

```
df -hT --type nfs4
```

## Metric server 설치

```
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
```

## kubectl apply 환경 변수 적용

```
REPOSITORY_URI=<your repository uri>
REPOSITORY_URI=$REPOSITORY_URI envsubst < deployment.yaml | kubectl apply -f -
```

## AWS Load Balancer Controller 설치

```
helm repo add eks https://aws.github.io/eks-charts
helm repo update
helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=$CLUSTER_NAME \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller
```

## ExternalDNS 설치

```
MyDomain=<your domain>
// HostedZone 여러 개일 경우 맞춰서 선택
MyDnsHostedZoneId=$(aws route53 list-hosted-zones-by-name --dns-name "${MyDomain}." --query "HostedZones[0].Id" --output text)
echo $MyDomain, $MyDnsHostedZoneId
curl -s -O https://raw.githubusercontent.com/cloudneta/cnaeblab/master/_data/externaldns.yaml
MyDomain=$MyDomain MyDnsHostedZoneId=$MyDnsHostedZoneId envsubst < externaldns.yaml | kubectl apply -f -
```

## AWS Cert Manager 인증서 확인

```
// ACM 인증서 확인
aws acm list-certificates
// ACM 인증서 변수 선언
// 여러 개일 경우 맞춰서 선택
CERT_ARN=`aws acm list-certificates --query 'CertificateSummaryList[].CertificateArn[]' --output text`; echo $CERT_ARN
```
2 changes: 1 addition & 1 deletion api-gateway-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: api-gateway-service
image: jtg/api-gateway:latest
image: ${REPOSITORY_URI}/jeontongju-api-gateway-service
ports:
- containerPort: 8000
imagePullPolicy: Always
1 change: 0 additions & 1 deletion api-gateway-service/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: api-gateway-service
namespace: prod
spec:
type: LoadBalancer
ports:
- protocol: TCP
port: 8000
Expand Down
2 changes: 1 addition & 1 deletion auction-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: auction-service
image: jtg/auction-service:latest
image: ${REPOSITORY_URI}/jeontongju-auction-service
ports:
- containerPort: 8080
imagePullPolicy: Always
24 changes: 24 additions & 0 deletions authentication-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: authentication-deployment
namespace: prod
labels:
app: authentication-service
spec:
selector:
matchLabels:
app: authentication-service
replicas: 1
template:
metadata:
name: authentication-pod
labels:
app: authentication-service
spec:
containers:
- name: authentication-service
image: ${REPOSITORY_URI}/jeontongju-authentication-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions authentication-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: authentication-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: authentication-service
2 changes: 1 addition & 1 deletion config-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
app: config-service
spec:
containers:
- image: jtg/config:latest
- image: ${REPOSITORY_URI}/jeontongju-config-service
imagePullPolicy: Always
name: config-service
ports:
Expand Down
2 changes: 1 addition & 1 deletion config-service/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: config-service
namespace: prod
spec:
type: LoadBalancer
type: ClusterIP
ports:
- targetPort: 8888
port: 8888
Expand Down
24 changes: 24 additions & 0 deletions consumer-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: consumer-deployment
namespace: prod
labels:
app: consumer-service
spec:
selector:
matchLabels:
app: consumer-service
replicas: 1
template:
metadata:
name: consumer-pod
labels:
app: consumer-service
spec:
containers:
- name: consumer-service
image: ${REPOSITORY_URI}/jeontongju-consumer-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions consumer-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: consumer-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: consumer-service
24 changes: 24 additions & 0 deletions coupon-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: coupon-deployment
namespace: prod
labels:
app: coupon-service
spec:
selector:
matchLabels:
app: coupon-service
replicas: 1
template:
metadata:
name: coupon-pod
labels:
app: coupon-service
spec:
containers:
- name: coupon-service
image: ${REPOSITORY_URI}/jeontongju-coupon-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions coupon-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: coupon-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: coupon-service
2 changes: 1 addition & 1 deletion discovery-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: discovery-service
image: jtg/discovery:latest
image: ${REPOSITORY_URI}/jeontongju-discovery-service
ports:
- containerPort: 8761
imagePullPolicy: Always
24 changes: 24 additions & 0 deletions notification-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: notification-deployment
namespace: prod
labels:
app: notification-service
spec:
selector:
matchLabels:
app: notification-service
replicas: 1
template:
metadata:
name: notification-pod
labels:
app: notification-service
spec:
containers:
- name: notification-service
image: ${REPOSITORY_URI}/jeontongju-notification-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions notification-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: notification-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: notification-service
24 changes: 24 additions & 0 deletions order-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: order-deployment
namespace: prod
labels:
app: order-service
spec:
selector:
matchLabels:
app: order-service
replicas: 1
template:
metadata:
name: order-pod
labels:
app: order-service
spec:
containers:
- name: order-service
image: ${REPOSITORY_URI}/jeontongju-order-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions order-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: order-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: order-service
24 changes: 24 additions & 0 deletions payment-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: payment-deployment
namespace: prod
labels:
app: payment-service
spec:
selector:
matchLabels:
app: payment-service
replicas: 1
template:
metadata:
name: payment-pod
labels:
app: payment-service
spec:
containers:
- name: payment-service
image: ${REPOSITORY_URI}/jeontongju-payment-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions payment-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: payment-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: payment-service
24 changes: 24 additions & 0 deletions product-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-deployment
namespace: prod
labels:
app: product-service
spec:
selector:
matchLabels:
app: product-service
replicas: 1
template:
metadata:
name: product-pod
labels:
app: product-service
spec:
containers:
- name: product-service
image: ${REPOSITORY_URI}/jeontongju-product-service
ports:
- containerPort: 8080
imagePullPolicy: Always
12 changes: 12 additions & 0 deletions product-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: product-service
namespace: prod
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
app: product-service
Loading

0 comments on commit a64495e

Please sign in to comment.