Skip to content

Commit

Permalink
Update k8s manifest (#3809)
Browse files Browse the repository at this point in the history
* pvc to 300g

* ci runner max 3 will be fine

* aws lb -> v2.4.5

* autoscaler -> v1.23.0

* update cluster-autoscaler-policy

* 一次启动3个runner 减少CI等待时间

* 3 replicas for barnard

* 1 replicas for proxima

* 1 replicas for halley

* v1.12.6 -> v1.12.7

* add annotations for aws lb public ip

* testnets seed node addr update
  • Loading branch information
yourmoonlight authored Dec 6, 2022
1 parent aa7c72f commit b68755a
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 204 deletions.
9 changes: 1 addition & 8 deletions config/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,7 @@ pub static G_DEV_CONFIG: Lazy<GenesisConfig> = Lazy::new(|| {
});

pub static G_HALLEY_BOOT_NODES: Lazy<Vec<MultiaddrWithPeerId>> = Lazy::new(|| {
vec!["/dns4/halley1.seed.starcoin.org/tcp/9840/p2p/12D3KooW9yQoKZrByqrUjmmPHXtR23qCXRQvF5KowYgoqypuhuCn".parse().expect("parse multi addr should be ok"),
"/dns4/halley2.seed.starcoin.org/tcp/9840/p2p/12D3KooWCqWbB2Abp6co6vMGG7VcEC9yYJU3yB1VhVYvpRQAr3sv".parse().expect("parse multi addr should be ok"),
"/dns4/halley3.seed.starcoin.org/tcp/9840/p2p/12D3KooWRiF6ZtUouCHgrgoCJ2jL4LCzzTEwopPbzVvTTRY3c2mf".parse().expect("parse multi addr should be ok"), ]
vec!["/dns4/halley1.seed.starcoin.org/tcp/9840/p2p/12D3KooW9yQoKZrByqrUjmmPHXtR23qCXRQvF5KowYgoqypuhuCn".parse().expect("parse multi addr should be ok"), ]
});

pub static G_HALLEY_CONFIG: Lazy<GenesisConfig> = Lazy::new(|| {
Expand Down Expand Up @@ -872,8 +870,6 @@ pub static G_HALLEY_CONFIG: Lazy<GenesisConfig> = Lazy::new(|| {

pub static G_PROXIMA_BOOT_NODES: Lazy<Vec<MultiaddrWithPeerId>> = Lazy::new(|| {
vec!["/dns4/proxima1.seed.starcoin.org/tcp/9840/p2p/12D3KooWFvCKQ1n2JkSQpn8drqGwU27vTPkKx264zD4CFbgaKDJU".parse().expect("parse multi addr should be ok"),
"/dns4/proxima2.seed.starcoin.org/tcp/9840/p2p/12D3KooWAua4KokJMiCodGPEF2n4yN42B2Q26KgwrQTntnrCDRHd".parse().expect("parse multi addr should be ok"),
"/dns4/proxima3.seed.starcoin.org/tcp/9840/p2p/12D3KooW9vHQJk9o69tZPMM2viQ3eWpgp6veDBRz8tTvDFDBejwk".parse().expect("parse multi addr should be ok"),
]
});

Expand Down Expand Up @@ -932,9 +928,6 @@ pub static G_PROXIMA_CONFIG: Lazy<GenesisConfig> = Lazy::new(|| {

pub static G_BARNARD_BOOT_NODES: Lazy<Vec<MultiaddrWithPeerId>> = Lazy::new(|| {
vec![
"/dns4/barnard1.seed.starcoin.org/tcp/9840/p2p/12D3KooWJcsd9JQngZFsHgYgkHymk7anN8fKqBtD1x8jEbq64QET".parse().expect("parse multi addr should be ok"),
"/dns4/barnard2.seed.starcoin.org/tcp/9840/p2p/12D3KooWMKgVbWRQain4Sbw4DUnAJMykjdFanAcePn5xsTZihGTo".parse().expect("parse multi addr should be ok"),
"/dns4/barnard3.seed.starcoin.org/tcp/9840/p2p/12D3KooWAcg5cxPnnLNUcYR9WdyTBL1Sotr7W1Suq8b48x2F33Vx".parse().expect("parse multi addr should be ok"),
"/dns4/barnard4.seed.starcoin.org/tcp/9840/p2p/12D3KooWRUQ4CZ6tiy2kZo5vVjm27ksYJAqMwB2QPfqpB5WEfzy4".parse().expect("parse multi addr should be ok"),
"/dns4/barnard5.seed.starcoin.org/tcp/9840/p2p/12D3KooWPwRSY555ycvo8BNiEqWqaJRvgtkv7BfJhq9JWHty6e2R".parse().expect("parse multi addr should be ok"),
"/dns4/barnard6.seed.starcoin.org/tcp/9840/p2p/12D3KooWSMJRCgT4inuEZNxvjSCHY1d3DwVX3SQ6qrvqAZCLLMwJ".parse().expect("parse multi addr should be ok"),
Expand Down
51 changes: 27 additions & 24 deletions kube/manifest/aws/cluster-autoscaler-policy.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions"
],
"Resource": ["*"]
},
{
"Effect": "Allow",
"Action": [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup"
],
"Resource": ["*"]
}
]
}
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions"
],
"Resource": ["*"]
},
{
"Effect": "Allow",
"Action": [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeImages",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
],
"Resource": ["*"]
}
]
}
2 changes: 1 addition & 1 deletion kube/manifest/aws/deploy_auto_scaler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ kubectl -n kube-system edit deployment.apps/cluster-autoscaler

kubectl set image deployment cluster-autoscaler \
-n kube-system \
cluster-autoscaler=k8s.gcr.io/autoscaling/cluster-autoscaler:v1.19.1
cluster-autoscaler=k8s.gcr.io/autoscaling/cluster-autoscaler:v1.23.0
2 changes: 1 addition & 1 deletion kube/manifest/aws/load_balancer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
curl -o iam_policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.1.3/docs/install/iam_policy.json
curl -o iam_policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/install/iam_policy.json

aws iam create-policy \
--policy-name AWSLoadBalancerControllerIAMPolicy \
Expand Down
4 changes: 2 additions & 2 deletions kube/manifest/runner/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
scaleTargetRef:
name: starcoin-runner-deployment
minReplicas: 0
maxReplicas: 6
maxReplicas: 3
scaleDownDelaySecondsAfterScaleOut: 120
scaleUpTriggers:
- githubEvent:
Expand All @@ -60,5 +60,5 @@ spec:
checkRun:
types: ["created"]
status: "queued"
amount: 2
amount: 3
duration: "2m"
3 changes: 3 additions & 0 deletions kube/manifest/service-barnard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: barnard
Expand Down Expand Up @@ -83,6 +84,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: barnard
Expand Down Expand Up @@ -126,6 +128,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: barnard
Expand Down
79 changes: 1 addition & 78 deletions kube/manifest/service-halley.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: halley
Expand Down Expand Up @@ -67,82 +68,4 @@ spec:
app: starcoin
network: halley
statefulset.kubernetes.io/pod-name: starcoin-0
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
labels:
app: starcoin
network: halley
statefulset.kubernetes.io/pod-name: starcoin-1
name: starcoin-1
namespace: starcoin-halley
spec:
ports:
- port: 9840
name: node
protocol: TCP
targetPort: 9840
- port: 9850
name: http-rpc
protocol: TCP
targetPort: 9850
- port: 9860
name: tcp-rpc
protocol: TCP
targetPort: 9860
- port: 9870
name: ws-rpc
protocol: TCP
targetPort: 9870
- port: 9101
name: metrics
protocol: TCP
targetPort: 9101
selector:
app: starcoin
network: halley
statefulset.kubernetes.io/pod-name: starcoin-1
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
labels:
app: starcoin
network: halley
statefulset.kubernetes.io/pod-name: starcoin-2
name: starcoin-2
namespace: starcoin-halley
spec:
ports:
- port: 9840
name: node
protocol: TCP
targetPort: 9840
- port: 9850
name: http-rpc
protocol: TCP
targetPort: 9850
- port: 9860
name: tcp-rpc
protocol: TCP
targetPort: 9860
- port: 9870
name: ws-rpc
protocol: TCP
targetPort: 9870
- port: 9101
name: metrics
protocol: TCP
targetPort: 9101
selector:
app: starcoin
network: halley
statefulset.kubernetes.io/pod-name: starcoin-2
type: LoadBalancer
9 changes: 9 additions & 0 deletions kube/manifest/service-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -74,6 +75,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -113,6 +115,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -152,6 +155,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -191,6 +195,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -230,6 +235,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -269,6 +275,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -308,6 +315,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down Expand Up @@ -347,6 +355,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: main
Expand Down
81 changes: 2 additions & 79 deletions kube/manifest/service-proxima.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
labels:
app: starcoin
network: proxima
Expand Down Expand Up @@ -67,82 +68,4 @@ spec:
app: starcoin
network: proxima
statefulset.kubernetes.io/pod-name: starcoin-0
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
labels:
app: starcoin
network: proxima
statefulset.kubernetes.io/pod-name: starcoin-1
name: starcoin-1
namespace: starcoin-proxima
spec:
ports:
- port: 9840
name: node
protocol: TCP
targetPort: 9840
- port: 9850
name: http-rpc
protocol: TCP
targetPort: 9850
- port: 9860
name: tcp-rpc
protocol: TCP
targetPort: 9860
- port: 9870
name: ws-rpc
protocol: TCP
targetPort: 9870
- port: 9101
name: metrics
protocol: TCP
targetPort: 9101
selector:
app: starcoin
network: proxima
statefulset.kubernetes.io/pod-name: starcoin-1
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip
labels:
app: starcoin
network: proxima
statefulset.kubernetes.io/pod-name: starcoin-2
name: starcoin-2
namespace: starcoin-proxima
spec:
ports:
- port: 9840
name: node
protocol: TCP
targetPort: 9840
- port: 9850
name: http-rpc
protocol: TCP
targetPort: 9850
- port: 9860
name: tcp-rpc
protocol: TCP
targetPort: 9860
- port: 9870
name: ws-rpc
protocol: TCP
targetPort: 9870
- port: 9101
name: metrics
protocol: TCP
targetPort: 9101
selector:
app: starcoin
network: proxima
statefulset.kubernetes.io/pod-name: starcoin-2
type: LoadBalancer
type: LoadBalancer
Loading

0 comments on commit b68755a

Please sign in to comment.