[INFO]
1. Prod 환경 node process 정리 2. script 추가
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-12-13T05:21:10Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-a
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/rel-process:NoSchedule
|
||||
@@ -0,0 +1,26 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-12-13T05:21:10Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-a2
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-a2
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/rel-process:NoSchedule
|
||||
@@ -0,0 +1,26 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-12-13T05:21:10Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-b
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/rel-process:NoSchedule
|
||||
@@ -0,0 +1,26 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-12-13T05:21:10Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-c
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/rel-process:NoSchedule
|
||||
74
aws_kubernetes/aws_kops_prod/node_yaml/druid.yaml
Normal file
74
aws_kubernetes/aws_kops_prod/node_yaml/druid.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m5a.2xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-a
|
||||
datasaker/group: data-druid
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-b
|
||||
datasaker/group: data-druid
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m5a.4xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-c
|
||||
datasaker/group: data-druid
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
74
aws_kubernetes/aws_kops_prod/node_yaml/es.yaml
Normal file
74
aws_kubernetes/aws_kops_prod/node_yaml/es.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-es-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-es-a
|
||||
datasaker/group: data-es
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-es:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-es-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-es-b
|
||||
datasaker/group: data-es
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-es:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-es-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-es-c
|
||||
datasaker/group: data-es
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-es:NoSchedule
|
||||
74
aws_kubernetes/aws_kops_prod/node_yaml/kafka.yaml
Normal file
74
aws_kubernetes/aws_kops_prod/node_yaml/kafka.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-a
|
||||
datasaker/group: data-kafka
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-b
|
||||
datasaker/group: data-kafka
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-c
|
||||
datasaker/group: data-kafka
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
79
aws_kubernetes/aws_kops_prod/node_yaml/process.yaml
Normal file
79
aws_kubernetes/aws_kops_prod/node_yaml/process.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-a
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-a2
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-a2
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-b
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-c
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
@@ -0,0 +1,411 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: Cluster
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 2
|
||||
name: k8s-prod.datasaker.io
|
||||
spec:
|
||||
api:
|
||||
loadBalancer:
|
||||
class: Network
|
||||
type: Public
|
||||
authorization:
|
||||
rbac: {}
|
||||
channel: stable
|
||||
cloudProvider: aws
|
||||
configBase: s3://clusters.prod.datasaker.io/k8s-prod.datasaker.io
|
||||
containerRuntime: containerd
|
||||
etcdClusters:
|
||||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2a
|
||||
name: a
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2b
|
||||
name: b
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2c
|
||||
name: c
|
||||
memoryRequest: 100Mi
|
||||
name: main
|
||||
- cpuRequest: 100m
|
||||
etcdMembers:
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2a
|
||||
name: a
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2b
|
||||
name: b
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2c
|
||||
name: c
|
||||
memoryRequest: 100Mi
|
||||
name: events
|
||||
iam:
|
||||
allowContainerRegistry: true
|
||||
legacy: false
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
kubernetesApiAccess:
|
||||
- 0.0.0.0/0
|
||||
- ::/0
|
||||
kubernetesVersion: 1.25.2
|
||||
masterInternalName: api.internal.k8s-prod.datasaker.io
|
||||
masterPublicName: api.k8s-prod.datasaker.io
|
||||
networkCIDR: 172.24.0.0/19
|
||||
networkID: vpc-00ba2b0e9ad59f0ed
|
||||
networking:
|
||||
calico: {}
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
sshAccess:
|
||||
- 0.0.0.0/0
|
||||
- ::/0
|
||||
subnets:
|
||||
- cidr: 172.24.8.0/23
|
||||
id: subnet-024f0deda82039fa4
|
||||
name: ap-northeast-2a
|
||||
type: Private
|
||||
zone: ap-northeast-2a
|
||||
- cidr: 172.24.10.0/23
|
||||
id: subnet-050d942fa1c46540a
|
||||
name: ap-northeast-2b
|
||||
type: Private
|
||||
zone: ap-northeast-2b
|
||||
- cidr: 172.24.12.0/23
|
||||
id: subnet-0946eb806af7377be
|
||||
name: ap-northeast-2c
|
||||
type: Private
|
||||
zone: ap-northeast-2c
|
||||
- cidr: 172.24.0.0/24
|
||||
id: subnet-00c363356f133411d
|
||||
name: utility-ap-northeast-2a
|
||||
type: Utility
|
||||
zone: ap-northeast-2a
|
||||
- cidr: 172.24.1.0/24
|
||||
id: subnet-07aa5e879a262014d
|
||||
name: utility-ap-northeast-2b
|
||||
type: Utility
|
||||
zone: ap-northeast-2b
|
||||
- cidr: 172.24.2.0/24
|
||||
id: subnet-0073a61bc56a68a3e
|
||||
name: utility-ap-northeast-2c
|
||||
type: Utility
|
||||
zone: ap-northeast-2c
|
||||
topology:
|
||||
dns:
|
||||
type: Public
|
||||
masters: private
|
||||
nodes: private
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:50:52Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-a
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-druid
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-a
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:50:52Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-b
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-druid
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-b
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:50:52Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-c
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-druid
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-c
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:35Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-a
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-kafka
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-a
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:35Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-b
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-kafka
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-b
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:35Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-c
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-kafka
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-c
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:49Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-a
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
machineType: c5.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-a
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:49Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-b
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
machineType: c5.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-b
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:49Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-c
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
machineType: c5.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-c
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: master-ap-northeast-2a
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
instanceMetadata:
|
||||
httpPutResponseHopLimit: 3
|
||||
httpTokens: required
|
||||
machineType: c5a.large
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: master-ap-northeast-2b
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
instanceMetadata:
|
||||
httpPutResponseHopLimit: 3
|
||||
httpTokens: required
|
||||
machineType: c5a.large
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 1
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: master-ap-northeast-2c
|
||||
spec:
|
||||
image: ami-0abb33b73a78cae31
|
||||
instanceMetadata:
|
||||
httpPutResponseHopLimit: 3
|
||||
httpTokens: required
|
||||
machineType: c5a.large
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
@@ -0,0 +1,411 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: Cluster
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 5
|
||||
name: k8s-prod.datasaker.io
|
||||
spec:
|
||||
api:
|
||||
loadBalancer:
|
||||
class: Network
|
||||
type: Public
|
||||
authorization:
|
||||
rbac: {}
|
||||
channel: stable
|
||||
cloudProvider: aws
|
||||
configBase: s3://clusters.prod.datasaker.io/k8s-prod.datasaker.io
|
||||
containerRuntime: containerd
|
||||
etcdClusters:
|
||||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2a
|
||||
name: a
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2b
|
||||
name: b
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2c
|
||||
name: c
|
||||
memoryRequest: 100Mi
|
||||
name: main
|
||||
- cpuRequest: 100m
|
||||
etcdMembers:
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2a
|
||||
name: a
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2b
|
||||
name: b
|
||||
- encryptedVolume: true
|
||||
instanceGroup: master-ap-northeast-2c
|
||||
name: c
|
||||
memoryRequest: 100Mi
|
||||
name: events
|
||||
iam:
|
||||
allowContainerRegistry: true
|
||||
legacy: false
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
kubernetesApiAccess:
|
||||
- 0.0.0.0/0
|
||||
- ::/0
|
||||
kubernetesVersion: 1.25.2
|
||||
masterInternalName: api.internal.k8s-prod.datasaker.io
|
||||
masterPublicName: api.k8s-prod.datasaker.io
|
||||
networkCIDR: 172.24.0.0/19
|
||||
networkID: vpc-00ba2b0e9ad59f0ed
|
||||
networking:
|
||||
calico: {}
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
sshAccess:
|
||||
- 0.0.0.0/0
|
||||
- ::/0
|
||||
subnets:
|
||||
- cidr: 172.24.8.0/23
|
||||
id: subnet-024f0deda82039fa4
|
||||
name: ap-northeast-2a
|
||||
type: Private
|
||||
zone: ap-northeast-2a
|
||||
- cidr: 172.24.10.0/23
|
||||
id: subnet-050d942fa1c46540a
|
||||
name: ap-northeast-2b
|
||||
type: Private
|
||||
zone: ap-northeast-2b
|
||||
- cidr: 172.24.12.0/23
|
||||
id: subnet-0946eb806af7377be
|
||||
name: ap-northeast-2c
|
||||
type: Private
|
||||
zone: ap-northeast-2c
|
||||
- cidr: 172.24.0.0/24
|
||||
id: subnet-00c363356f133411d
|
||||
name: utility-ap-northeast-2a
|
||||
type: Utility
|
||||
zone: ap-northeast-2a
|
||||
- cidr: 172.24.1.0/24
|
||||
id: subnet-07aa5e879a262014d
|
||||
name: utility-ap-northeast-2b
|
||||
type: Utility
|
||||
zone: ap-northeast-2b
|
||||
- cidr: 172.24.2.0/24
|
||||
id: subnet-0073a61bc56a68a3e
|
||||
name: utility-ap-northeast-2c
|
||||
type: Utility
|
||||
zone: ap-northeast-2c
|
||||
topology:
|
||||
dns:
|
||||
type: Public
|
||||
masters: private
|
||||
nodes: private
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:50:52Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-druid
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-a
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:50:52Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-druid
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-b
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:50:52Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-druid-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-druid
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-druid-c
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-druid:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:35Z"
|
||||
generation: 3
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-kafka
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-a
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:35Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-kafka
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-b
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:35Z"
|
||||
generation: 3
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-data-kafka-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
kubelet:
|
||||
anonymousAuth: false
|
||||
nodeLabels:
|
||||
node-role.kubernetes.io/node: ""
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: data-kafka
|
||||
kops.k8s.io/instancegroup: k8s-prod-data-kafka-c
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/data-kafka:NoSchedule
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:49Z"
|
||||
generation: 3
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: c5.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-a
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:49Z"
|
||||
generation: 3
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: c5.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-b
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-02T01:51:49Z"
|
||||
generation: 3
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: c5.large
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-c
|
||||
role: Node
|
||||
rootVolumeSize: 100
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: master-ap-northeast-2a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
instanceMetadata:
|
||||
httpPutResponseHopLimit: 3
|
||||
httpTokens: required
|
||||
machineType: c5a.large
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: master-ap-northeast-2b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
instanceMetadata:
|
||||
httpPutResponseHopLimit: 3
|
||||
httpTokens: required
|
||||
machineType: c5a.large
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2022-11-01T05:36:36Z"
|
||||
generation: 2
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: master-ap-northeast-2c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
instanceMetadata:
|
||||
httpPutResponseHopLimit: 3
|
||||
httpTokens: required
|
||||
machineType: c5a.large
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
95
aws_kubernetes/aws_kops_prod/node_yaml/spot-process.yaml
Normal file
95
aws_kubernetes/aws_kops_prod/node_yaml/spot-process.yaml
Normal file
@@ -0,0 +1,95 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-a
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-a2
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-a2
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-b
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m6i.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-b
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-rel-process-c
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: m5a.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
mixedInstancesPolicy:
|
||||
onDemandAboveBase: 0
|
||||
onDemandBase: 0
|
||||
spotAllocationStrategy: capacity-optimized
|
||||
nodeLabels:
|
||||
datasaker/group: rel-process
|
||||
kops.k8s.io/instancegroup: k8s-rel-process-c
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
20
aws_kubernetes/aws_kops_prod/node_yaml/std_process.yaml
Normal file
20
aws_kubernetes/aws_kops_prod/node_yaml/std_process.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
labels:
|
||||
kops.k8s.io/cluster: k8s-prod.datasaker.io
|
||||
name: k8s-prod-process-a
|
||||
spec:
|
||||
image: ami-0409b7ddbc59e3222
|
||||
machineType: c5.xlarge
|
||||
manager: CloudGroup
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
nodeLabels:
|
||||
datasaker/group: process
|
||||
kops.k8s.io/instancegroup: k8s-prod-process-a
|
||||
rootVolumeSize: 100
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
|
||||
@@ -21,6 +21,8 @@ spec:
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/spot:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
@@ -45,6 +47,8 @@ spec:
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2a
|
||||
taints:
|
||||
- prod/spot:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
@@ -69,6 +73,8 @@ spec:
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2b
|
||||
taints:
|
||||
- prod/spot:NoSchedule
|
||||
---
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
@@ -89,3 +95,5 @@ spec:
|
||||
role: Node
|
||||
subnets:
|
||||
- ap-northeast-2c
|
||||
taints:
|
||||
- prod/spot:NoSchedule
|
||||
|
||||
@@ -42,3 +42,33 @@ resource "aws_route53_record" "datagate" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_route53_record" "release_ui" {
|
||||
zone_id = "${var.datasaker-io}"
|
||||
name = "app.rel.kr.datasaker.io"
|
||||
type = "A"
|
||||
alias {
|
||||
name = aws_alb.nlb-prod-kr-ingress.dns_name
|
||||
zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
|
||||
evaluate_target_health = true
|
||||
}
|
||||
}
|
||||
resource "aws_route53_record" "release_krakend" {
|
||||
zone_id = "${var.datasaker-io}"
|
||||
name = "api.rel.kr.datasaker.io"
|
||||
type = "A"
|
||||
alias {
|
||||
name = aws_alb.nlb-prod-kr-ingress.dns_name
|
||||
zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
|
||||
evaluate_target_health = true
|
||||
}
|
||||
}
|
||||
resource "aws_route53_record" "release_datagate" {
|
||||
zone_id = "${var.datasaker-io}"
|
||||
name = "gate.rel.kr.datasaker.io"
|
||||
type = "A"
|
||||
alias {
|
||||
name = aws_alb.nlb-prod-kr-ingress.dns_name
|
||||
zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
|
||||
evaluate_target_health = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@ variable "port_list" {
|
||||
#---------------------------------------------------------------#
|
||||
# LB 구성 후 target group 매칭 시 필요한 인스턴스 ID
|
||||
variable "master-2a" {
|
||||
default = "i-014c424f66623b752"
|
||||
default = "i-06743c6115368596c"
|
||||
}
|
||||
|
||||
variable "master-2b" {
|
||||
default = "i-023d4870352e29e95"
|
||||
default = "i-01b5f7d2d7382274d"
|
||||
}
|
||||
|
||||
variable "master-2c" {
|
||||
default = "i-092f6ffe189c86fe2"
|
||||
default = "i-0739c2d32a88b7962"
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.3.1",
|
||||
"serial": 231,
|
||||
"serial": 442,
|
||||
"lineage": "032f4e32-eac2-150d-d701-e7669deda40a",
|
||||
"outputs": {},
|
||||
"resources": [
|
||||
@@ -112,7 +112,7 @@
|
||||
"port": 31300,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -154,7 +154,7 @@
|
||||
"port": 31301,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -196,7 +196,7 @@
|
||||
"port": 31302,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -238,7 +238,7 @@
|
||||
"port": 31303,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -280,7 +280,7 @@
|
||||
"port": 31304,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -322,7 +322,7 @@
|
||||
"port": 443,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -364,7 +364,7 @@
|
||||
"port": 80,
|
||||
"protocol": "TCP",
|
||||
"ssl_policy": "",
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"timeouts": null
|
||||
},
|
||||
@@ -423,7 +423,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -485,7 +485,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -547,7 +547,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -609,7 +609,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -671,7 +671,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -733,7 +733,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -795,7 +795,7 @@
|
||||
"type": "source_ip"
|
||||
}
|
||||
],
|
||||
"tags": null,
|
||||
"tags": {},
|
||||
"tags_all": {},
|
||||
"target_failover": [
|
||||
{
|
||||
@@ -821,10 +821,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f-20221214064759615400000003",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f-20221223032107461300000004",
|
||||
"port": 30000,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -844,10 +844,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f-20221214064759654900000005",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f-20221223032108558400000011",
|
||||
"port": 30000,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -867,10 +867,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f-20221214064759535600000001",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f-20221223032107816500000009",
|
||||
"port": 30000,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30000/dbc0dba72448ec1f",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -890,10 +890,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8-2022121406475981470000000d",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8-20221223032107718900000008",
|
||||
"port": 30001,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -913,10 +913,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8-20221214064759989500000014",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8-20221223032107396200000002",
|
||||
"port": 30001,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -936,10 +936,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8-20221214064759570700000002",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8-20221223032107666200000007",
|
||||
"port": 30001,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-30001/32f75b1c3463b8e8",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -959,10 +959,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e-2022121406475982620000000e",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e-20221223032108505300000010",
|
||||
"port": 31300,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -982,10 +982,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e-20221214064759933100000013",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e-20221223032107421400000003",
|
||||
"port": 31300,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1005,10 +1005,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e-2022121406475986210000000f",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e-20221223032107374000000001",
|
||||
"port": 31300,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31300/37a260b4c911162e",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1028,10 +1028,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661-20221214064759636700000004",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661-2022122303210842110000000f",
|
||||
"port": 31301,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1051,10 +1051,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661-20221214064759698300000006",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661-2022122303210830580000000e",
|
||||
"port": 31301,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1074,10 +1074,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661-20221214064759725500000008",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661-2022122303210822000000000d",
|
||||
"port": 31301,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31301/c69a0602adf80661",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1097,10 +1097,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35-20221214064800118600000015",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35-20221223032109004600000014",
|
||||
"port": 31302,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1120,10 +1120,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35-20221214064759924100000012",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35-20221223032108614000000012",
|
||||
"port": 31302,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1143,10 +1143,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35-20221214064759893800000011",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35-20221223032108674200000013",
|
||||
"port": 31302,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31302/90b5772fefe00a35",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1166,10 +1166,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334-2022121406475980780000000c",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334-20221223032107522000000006",
|
||||
"port": 31303,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1189,10 +1189,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334-2022121406475978600000000b",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334-20221223032109149300000015",
|
||||
"port": 31303,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1212,10 +1212,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334-20221214064759885400000010",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334-20221223032107490400000005",
|
||||
"port": 31303,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31303/2a237ebe36d7f334",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1235,10 +1235,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880-2022121406475978090000000a",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880-2022122303210791990000000a",
|
||||
"port": 31304,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880",
|
||||
"target_id": "i-014c424f66623b752"
|
||||
"target_id": "i-06743c6115368596c"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1258,10 +1258,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880-20221214064759735600000009",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880-2022122303210801140000000b",
|
||||
"port": 31304,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880",
|
||||
"target_id": "i-023d4870352e29e95"
|
||||
"target_id": "i-01b5f7d2d7382274d"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1281,10 +1281,10 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"availability_zone": null,
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880-20221214064759712600000007",
|
||||
"id": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880-2022122303210811950000000c",
|
||||
"port": 31304,
|
||||
"target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:508259851457:targetgroup/tg-prod-kr-tcp-31304/3bd0ebf005c36880",
|
||||
"target_id": "i-092f6ffe189c86fe2"
|
||||
"target_id": "i-0739c2d32a88b7962"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
@@ -1314,14 +1314,134 @@
|
||||
"failover_routing_policy": [],
|
||||
"fqdn": "gate.kr.datasaker.io",
|
||||
"geolocation_routing_policy": [],
|
||||
"health_check_id": null,
|
||||
"health_check_id": "",
|
||||
"id": "Z072735718G25WNVKU834_gate.kr.datasaker.io_A",
|
||||
"latency_routing_policy": [],
|
||||
"multivalue_answer_routing_policy": null,
|
||||
"name": "gate.kr.datasaker.io",
|
||||
"records": null,
|
||||
"set_identifier": null,
|
||||
"ttl": null,
|
||||
"records": [],
|
||||
"set_identifier": "",
|
||||
"ttl": 0,
|
||||
"type": "A",
|
||||
"weighted_routing_policy": [],
|
||||
"zone_id": "Z072735718G25WNVKU834"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||
"dependencies": [
|
||||
"aws_alb.nlb-prod-kr-ingress"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "aws_route53_record",
|
||||
"name": "release_datagate",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 2,
|
||||
"attributes": {
|
||||
"alias": [
|
||||
{
|
||||
"evaluate_target_health": true,
|
||||
"name": "nlb-prod-kr-ingress-a1b7c286701236ba.elb.ap-northeast-2.amazonaws.com",
|
||||
"zone_id": "ZIBE1TIR4HY56"
|
||||
}
|
||||
],
|
||||
"allow_overwrite": null,
|
||||
"failover_routing_policy": [],
|
||||
"fqdn": "gate.rel.kr.datasaker.io",
|
||||
"geolocation_routing_policy": [],
|
||||
"health_check_id": "",
|
||||
"id": "Z072735718G25WNVKU834_gate.rel.kr.datasaker.io_A",
|
||||
"latency_routing_policy": [],
|
||||
"multivalue_answer_routing_policy": null,
|
||||
"name": "gate.rel.kr.datasaker.io",
|
||||
"records": [],
|
||||
"set_identifier": "",
|
||||
"ttl": 0,
|
||||
"type": "A",
|
||||
"weighted_routing_policy": [],
|
||||
"zone_id": "Z072735718G25WNVKU834"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||
"dependencies": [
|
||||
"aws_alb.nlb-prod-kr-ingress"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "aws_route53_record",
|
||||
"name": "release_krakend",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 2,
|
||||
"attributes": {
|
||||
"alias": [
|
||||
{
|
||||
"evaluate_target_health": true,
|
||||
"name": "nlb-prod-kr-ingress-a1b7c286701236ba.elb.ap-northeast-2.amazonaws.com",
|
||||
"zone_id": "ZIBE1TIR4HY56"
|
||||
}
|
||||
],
|
||||
"allow_overwrite": null,
|
||||
"failover_routing_policy": [],
|
||||
"fqdn": "api.rel.kr.datasaker.io",
|
||||
"geolocation_routing_policy": [],
|
||||
"health_check_id": "",
|
||||
"id": "Z072735718G25WNVKU834_api.rel.kr.datasaker.io_A",
|
||||
"latency_routing_policy": [],
|
||||
"multivalue_answer_routing_policy": null,
|
||||
"name": "api.rel.kr.datasaker.io",
|
||||
"records": [],
|
||||
"set_identifier": "",
|
||||
"ttl": 0,
|
||||
"type": "A",
|
||||
"weighted_routing_policy": [],
|
||||
"zone_id": "Z072735718G25WNVKU834"
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||
"dependencies": [
|
||||
"aws_alb.nlb-prod-kr-ingress"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "aws_route53_record",
|
||||
"name": "release_ui",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 2,
|
||||
"attributes": {
|
||||
"alias": [
|
||||
{
|
||||
"evaluate_target_health": true,
|
||||
"name": "nlb-prod-kr-ingress-a1b7c286701236ba.elb.ap-northeast-2.amazonaws.com",
|
||||
"zone_id": "ZIBE1TIR4HY56"
|
||||
}
|
||||
],
|
||||
"allow_overwrite": null,
|
||||
"failover_routing_policy": [],
|
||||
"fqdn": "app.rel.kr.datasaker.io",
|
||||
"geolocation_routing_policy": [],
|
||||
"health_check_id": "",
|
||||
"id": "Z072735718G25WNVKU834_app.rel.kr.datasaker.io_A",
|
||||
"latency_routing_policy": [],
|
||||
"multivalue_answer_routing_policy": null,
|
||||
"name": "app.rel.kr.datasaker.io",
|
||||
"records": [],
|
||||
"set_identifier": "",
|
||||
"ttl": 0,
|
||||
"type": "A",
|
||||
"weighted_routing_policy": [],
|
||||
"zone_id": "Z072735718G25WNVKU834"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
102
scripts/prod/lambda/lambda_restart.sh
Executable file
102
scripts/prod/lambda/lambda_restart.sh
Executable file
@@ -0,0 +1,102 @@
|
||||
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 변수 선언
|
||||
echo_line="=========================================================================="
|
||||
search_tag="prod"
|
||||
start_function="autoscailing_start_prod"
|
||||
stop_function="autoscailing_stop_prod"
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# aws 인스턴스 조회
|
||||
_get_aws_status (){
|
||||
aws_query="Reservations[].Instances[].[ InstanceId, Tags[?Key=='Name'].Value|[0] ]"
|
||||
aws_filter="Name=instance-state-name,Values=running"
|
||||
current_ec2_num=`aws ec2 describe-instances --query "${aws_query}" --filter ${aws_filter} --output text | grep ${search_tag} | egrep -iv '(bastion|wireguard)' |wc -l`
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# log 출력
|
||||
_get_time_log (){
|
||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
string=$1
|
||||
echo "[${datetime}] ${string}"
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# aws lambda 실행 후 인스턴스 조회하여 성공/실패 여부 체크
|
||||
|
||||
_main (){
|
||||
lambda_function=$1
|
||||
echo ${echo_line}
|
||||
if [[ ${lambda_fuction} == *"stop"* ]]; then
|
||||
what_func='stop'
|
||||
else
|
||||
what_func='start'
|
||||
fi
|
||||
|
||||
_get_time_log "[INFO] aws lambda ${lambda_function} start"
|
||||
|
||||
aws lambda invoke --function-name ${lambda_function} --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json > /tmp/aws_func_result
|
||||
#echo "aws lambda invoke --function-name ${lambda_function} --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json"
|
||||
|
||||
succ_flag=0
|
||||
while read line
|
||||
do
|
||||
if [[ $line == *"200"* ]]; then
|
||||
succ_flag=1
|
||||
_get_time_log "[INFO] aws lambda ${lambda_function} success!"
|
||||
break
|
||||
else
|
||||
succ_flag=0
|
||||
fi
|
||||
done < /tmp/aws_func_result
|
||||
|
||||
if [[ ${succ_flag} == 1 ]]; then
|
||||
aws lambda invoke --function-name ${lambda_function} out --log-type Tail --query 'LogResult' --output text | base64 -d > /tmp/aws_func_output
|
||||
if [[ ${what_func} == 'stop' ]]; then
|
||||
final_ec2_num=0
|
||||
else
|
||||
final_ec2_num=`grep "Starting" /tmp/aws_func_output | wc -l`
|
||||
fi
|
||||
|
||||
num=0
|
||||
while true
|
||||
do
|
||||
_get_aws_status
|
||||
num=`echo $(( $num + 1 ))`
|
||||
if [[ ${current_ec2_num} == ${final_ec2_num} ]]; then
|
||||
_get_time_log "[INFO] aws ${search_tag} instance number: ${final_ec2_num} check success!"
|
||||
break
|
||||
elif [[ ${num} == 30 ]]; then
|
||||
_get_time_log "[Error] time out!"
|
||||
break
|
||||
else
|
||||
_get_time_log "[Retry: ${num}] aws ${search_tag} instance number: ${final_ec2_num} checking..."
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
else
|
||||
echo ${echo_line}
|
||||
_get_time_log "[Error] aws lambda ${lambda_function} failed!"
|
||||
exit
|
||||
fi
|
||||
echo ${echo_line}
|
||||
#---------------
|
||||
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 실행
|
||||
|
||||
_main ${stop_function}
|
||||
|
||||
_main ${start_function}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 임시 파일 삭제
|
||||
|
||||
unlink out
|
||||
unlink response.json
|
||||
unlink /tmp/aws_func_output
|
||||
unlink /tmp/aws_func_result
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
99
scripts/prod/lambda/lambda_start.sh
Executable file
99
scripts/prod/lambda/lambda_start.sh
Executable file
@@ -0,0 +1,99 @@
|
||||
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 변수 선언
|
||||
echo_line="=========================================================================="
|
||||
search_tag="prod"
|
||||
start_function="autoscailing_start_prod"
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# aws 인스턴스 조회
|
||||
_get_aws_status (){
|
||||
aws_query="Reservations[].Instances[].[ InstanceId, Tags[?Key=='Name'].Value|[0] ]"
|
||||
aws_filter="Name=instance-state-name,Values=running"
|
||||
current_ec2_num=`aws ec2 describe-instances --query "${aws_query}" --filter ${aws_filter} --output text | grep ${search_tag} | egrep -iv '(bastion|wireguard)' |wc -l`
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# log 출력
|
||||
_get_time_log (){
|
||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
string=$1
|
||||
echo "[${datetime}] ${string}"
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# aws lambda 실행 후 인스턴스 조회하여 성공/실패 여부 체크
|
||||
|
||||
_main (){
|
||||
lambda_function=$1
|
||||
echo ${echo_line}
|
||||
if [[ ${lambda_fuction} == *"stop"* ]]; then
|
||||
what_func='stop'
|
||||
else
|
||||
what_func='start'
|
||||
fi
|
||||
|
||||
_get_time_log "[INFO] aws lambda ${lambda_function} start"
|
||||
|
||||
aws lambda invoke --function-name ${lambda_function} --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json > /tmp/aws_func_result
|
||||
#echo "aws lambda invoke --function-name ${lambda_function} --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json"
|
||||
|
||||
succ_flag=0
|
||||
while read line
|
||||
do
|
||||
if [[ $line == *"200"* ]]; then
|
||||
succ_flag=1
|
||||
_get_time_log "[INFO] aws lambda ${lambda_function} success!"
|
||||
break
|
||||
else
|
||||
succ_flag=0
|
||||
fi
|
||||
done < /tmp/aws_func_result
|
||||
|
||||
if [[ ${succ_flag} == 1 ]]; then
|
||||
aws lambda invoke --function-name ${lambda_function} out --log-type Tail --query 'LogResult' --output text | base64 -d > /tmp/aws_func_output
|
||||
if [[ ${what_func} == 'stop' ]]; then
|
||||
final_ec2_num=0
|
||||
else
|
||||
final_ec2_num=`grep "Starting" /tmp/aws_func_output | wc -l`
|
||||
fi
|
||||
|
||||
num=0
|
||||
while true
|
||||
do
|
||||
_get_aws_status
|
||||
num=`echo $(( $num + 1 ))`
|
||||
if [[ ${current_ec2_num} == ${final_ec2_num} ]]; then
|
||||
_get_time_log "[INFO] aws ${search_tag} instance number: ${final_ec2_num} check success!"
|
||||
break
|
||||
elif [[ ${num} == 30 ]]; then
|
||||
_get_time_log "[Error] time out!"
|
||||
break
|
||||
else
|
||||
_get_time_log "[Retry: ${num}] aws ${search_tag} instance number: ${final_ec2_num} checking..."
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
else
|
||||
echo ${echo_line}
|
||||
_get_time_log "[Error] aws lambda ${lambda_function} failed!"
|
||||
exit
|
||||
fi
|
||||
echo ${echo_line}
|
||||
#---------------
|
||||
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 실행
|
||||
|
||||
_main ${start_function}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 임시 파일 삭제
|
||||
|
||||
unlink out
|
||||
unlink response.json
|
||||
unlink /tmp/aws_func_output
|
||||
unlink /tmp/aws_func_result
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
100
scripts/prod/lambda/lambda_stop.sh
Executable file
100
scripts/prod/lambda/lambda_stop.sh
Executable file
@@ -0,0 +1,100 @@
|
||||
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 변수 선언
|
||||
echo_line="=========================================================================="
|
||||
search_tag="prod"
|
||||
stop_function="autoscailing_stop_prod"
|
||||
start_function="autoscailing_start_prod"
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# aws 인스턴스 조회
|
||||
_get_aws_status (){
|
||||
aws_query="Reservations[].Instances[].[ InstanceId, Tags[?Key=='Name'].Value|[0] ]"
|
||||
aws_filter="Name=instance-state-name,Values=running"
|
||||
current_ec2_num=`aws ec2 describe-instances --query "${aws_query}" --filter ${aws_filter} --output text | grep ${search_tag} | wc -l`
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# log 출력
|
||||
_get_time_log (){
|
||||
datetime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
string=$1
|
||||
echo "[${datetime}] ${string}"
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# aws lambda 실행 후 인스턴스 조회하여 성공/실패 여부 체크
|
||||
|
||||
_main (){
|
||||
lambda_function=$1
|
||||
echo ${echo_line}
|
||||
if [[ ${lambda_fuction} == *"stop"* ]]; then
|
||||
what_func='stop'
|
||||
else
|
||||
what_func='start'
|
||||
fi
|
||||
|
||||
_get_time_log "[INFO] aws lambda ${lambda_function} start"
|
||||
|
||||
aws lambda invoke --function-name ${lambda_function} --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json > /tmp/aws_func_result
|
||||
#echo "aws lambda invoke --function-name ${lambda_function} --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json"
|
||||
|
||||
succ_flag=0
|
||||
while read line
|
||||
do
|
||||
if [[ $line == *"200"* ]]; then
|
||||
succ_flag=1
|
||||
_get_time_log "[INFO] aws lambda ${lambda_function} success!"
|
||||
break
|
||||
else
|
||||
succ_flag=0
|
||||
fi
|
||||
done < /tmp/aws_func_result
|
||||
|
||||
if [[ ${succ_flag} == 1 ]]; then
|
||||
aws lambda invoke --function-name ${lambda_function} out --log-type Tail --query 'LogResult' --output text | base64 -d > /tmp/aws_func_output
|
||||
if [[ ${what_func} == 'stop' ]]; then
|
||||
final_ec2_num=0
|
||||
else
|
||||
final_ec2_num=`grep "Starting" /tmp/aws_func_output | wc -l`
|
||||
fi
|
||||
|
||||
num=0
|
||||
while true
|
||||
do
|
||||
_get_aws_status
|
||||
num=`echo $(( $num + 1 ))`
|
||||
if [[ ${current_ec2_num} == ${final_ec2_num} ]]; then
|
||||
_get_time_log "[INFO] aws ${search_tag} instance number: ${final_ec2_num} check success!"
|
||||
break
|
||||
elif [[ ${num} == 30 ]]; then
|
||||
_get_time_log "[Error] time out!"
|
||||
break
|
||||
else
|
||||
_get_time_log "[Retry: ${num}] aws ${search_tag} instance number: ${final_ec2_num} checking..."
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
else
|
||||
echo ${echo_line}
|
||||
_get_time_log "[Error] aws lambda ${lambda_function} failed!"
|
||||
exit
|
||||
fi
|
||||
echo ${echo_line}
|
||||
#---------------
|
||||
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 실행
|
||||
|
||||
_main ${stop_function}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 임시 파일 삭제
|
||||
|
||||
unlink out
|
||||
unlink response.json
|
||||
unlink /tmp/aws_func_output
|
||||
unlink /tmp/aws_func_result
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
66
scripts/prod/prod.sh
Executable file
66
scripts/prod/prod.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 변수 선언
|
||||
current_path=`pwd`
|
||||
line="*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*"
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 파일 및 폴더 경로 확인
|
||||
__find_path (){
|
||||
script_file="00_terraform_var_change.sh"
|
||||
cd ../../
|
||||
tmp_path=`find -name ${script_file} | grep -vi old`
|
||||
tmp_num=`grep -c "/" ${tmp_path}`
|
||||
path_num=`echo $(( $tmp_num - 1 ))`
|
||||
script_path=`echo ${tmp_path}| cut -d "/" -f1-${path_num}`
|
||||
_bash=`which bash`
|
||||
_terraform=`which terraform`
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# lambda 실행
|
||||
__lambda_execute (){
|
||||
lambda_file="lambda_${1}.sh"
|
||||
cd "${current_path}/lambda"
|
||||
#./${lambda_file}
|
||||
echo ${line}
|
||||
echo "lambda file : $(pwd)/${lambda_file}" #DEBUG
|
||||
${_bash} ${lambda_file}
|
||||
echo ${line}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
# 변수 변경 스크립트 실행 뒤 terraform apply 실행
|
||||
__terraform_target (){
|
||||
cd ${current_path}
|
||||
cd ../../
|
||||
cd ${script_path}
|
||||
echo "script_file : ${script_file}" #DEBUG
|
||||
${_bash} ${script_file}
|
||||
echo ${line}
|
||||
${_terraform} apply
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
if [[ ${1} == '' ]];then
|
||||
echo "[Usage] ${0} { start | stop | restart } "
|
||||
exit
|
||||
else
|
||||
script_func=${1}
|
||||
__find_path
|
||||
if [[ ${script_func} == 'start' ]];then
|
||||
__lambda_execute start
|
||||
__terraform_target
|
||||
elif [[ ${script_func} == 'stop' ]];then
|
||||
__lambda_execute stop
|
||||
elif [[ ${script_func} == 'restart' ]];then
|
||||
__lambda_execute restart
|
||||
__terraform_target
|
||||
else
|
||||
echo "[Usage] ${0} { start | stop | restart } "
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user