Skip to content

Commit

Permalink
Merge pull request #8 from BSWANG/main
Browse files Browse the repository at this point in the history
support pod config from docker runtime
  • Loading branch information
l1b0k authored Jan 3, 2025
2 parents 0fe77a2 + 671b076 commit b07c002
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 102 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: check

on:
push: { }
pull_request: { }

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true

jobs:
go-mod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.2
- name: Check module vendoring
run: |
go mod tidy
go mod vendor
git diff --exit-code || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1)
go-lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.2
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
args: --config=.golangci.yml

super-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint Code Base
uses: super-linter/[email protected]
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_MARKDOWN: true
VALIDATE_BASH: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: .*(test|tests).*
SHELLCHECK_OPTS: "-e SC2166"
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# alibabacloud-erdma-controller

Kubernetes controller for alibabacloud erdma resource
Kubernetes controller for alibabacloud erdma resource

## Description
Dynamic configure erdma devices on kubernetes nodes, and automatically inject erdma-accelerated networks for Kubernetes Pods.
Expand Down Expand Up @@ -41,7 +40,7 @@ alibabacloud-erdma-controller need following permissions:
#### prepare configuration
prepare a values.yaml file with the following content to authorize controller to access erdma API:
##### use rrsa authorization
```
```yaml
credentials:
type: "oidc_role_arn"
serviceAccount:
Expand All @@ -57,7 +56,7 @@ credentials:
accessKeyID: "{access key}"
accessKeySecret: "{access key secret}"
```
#### helm install:
#### helm install
```sh
helm install -f values.yaml --namespace kube-system alibaba-erdma-controller deploy/helm/
```
Expand All @@ -78,10 +77,10 @@ kubectl get node -o yaml | grep aliyun/erdma

### Using ERDMA Accelerated Network
#### Pod Configurations to Enable ERDMA Accelerated Network
* add `aliyun/erdma` resource in pod spec # config erdma devices for pod
* 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, need `network.alibabacloud.com/erdma` enabled first.

#### Example:
#### Example
```yaml
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -140,7 +139,9 @@ 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
```text
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,
Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
name: cri-dir
- mountPath: /var/lib/kubelet/pod-resources/
name: pod-resource-dir
- mountPath: /var/run/
name: docker
volumes:
- name: pod-resource-dir
hostPath:
Expand All @@ -71,6 +73,9 @@ spec:
- name: device-plugin
hostPath:
path: /var/lib/kubelet/device-plugins
- name: docker
hostPath:
path: /var/run/
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
23 changes: 18 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/samber/lo v1.47.0
github.com/stretchr/testify v1.9.0
github.com/vishvananda/netlink v1.3.0
golang.org/x/net v0.26.0
google.golang.org/grpc v1.65.0
Expand All @@ -23,12 +22,27 @@ require (
)

require (
github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/provider v0.15.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
gotest.tools/v3 v3.5.1 // indirect
)

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.22+incompatible
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
)

require (
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
github.com/alibabacloud-go/debug v1.0.1 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0
github.com/alibabacloud-go/openapi-util v0.1.0 // indirect
github.com/alibabacloud-go/tea v1.2.2 // indirect
github.com/alibabacloud-go/tea v1.2.2
github.com/alibabacloud-go/tea-utils v1.3.6 // indirect
github.com/alibabacloud-go/tea-utils/v2 v2.0.6 // indirect
github.com/alibabacloud-go/tea-xml v1.1.3 // indirect
Expand Down Expand Up @@ -72,7 +86,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
Expand Down
Loading

0 comments on commit b07c002

Please sign in to comment.