Kubernetes controller for alibabacloud erdma resource
Dynamic configure erdma devices on kubernetes nodes, and automatically inject erdma-accelerated networks for Kubernetes Pods.
- helm
- Kubernetes Cluster With AlibabaCloud ECS Nodes
- AlibabaCloud Linux 3 with Kernel Version >= 5.10.134-17
alibabacloud-erdma-controller need following permissions:
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInstanceTypes",
"ecs:DescribeNetworkInterfaces",
"ecs:ModifyNetworkInterfaceAttribute",
"ecs:CreateNetworkInterface",
"ecs:AttachNetworkInterface"
],
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}
prepare a values.yaml file with the following content to authorize controller to access erdma API:
credentials:
type: "oidc_role_arn"
serviceAccount:
annotations:
pod-identity.alibabacloud.com/role-name: {your-ram-role-name}
need config rrsa components on ACK, refer doc.
credentials:
type: "access_key"
accessKeyID: "{access key}"
accessKeySecret: "{access key secret}"
helm install -f values.yaml --namespace kube-system alibaba-erdma-controller deploy/helm/
kubectl get pod -n kube-system | grep erdma
kubectl get erdmadevices
kubectl get node -o yaml | grep aliyun/erdma
- add
aliyun/erdma
resource in pod spec # config erdma devices for pod network.alibabacloud.com/erdma-smcr: "true"
# config smcr for pod, dynamicially replace tcp connection to erdma, neednetwork.alibabacloud.com/erdma
enabled first.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: erdma
name: erdma
spec:
replicas: 1
selector:
matchLabels:
app: erdma
template:
metadata:
labels:
app: erdma
annotations:
network.alibabacloud.com/erdma-smcr: "true"
spec:
containers:
- command:
- sleep
- "360000"
image: registry.aliyuncs.com/wangbs/netdia:latest
name: erdma
resources:
limits:
aliyun/erdma: 1
uninstall helm
helm -n kube-system uninstall alibaba-erdma-controller
docker build --tag registry.aliyuncs.com/erdma/controller:latest --target controller .
docker build --tag registry.aliyuncs.com/erdma/agent:latest --target agent .
docker build --tag registry.aliyuncs.com/erdma/smcr_init:latest --target smcr_init .
Copyright 2024.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.