generated from LinuxSuRen/.github
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add containerd config files * Add containerd.service file * Bump go version from 1.13 to 1.16 * Ignore G306 for go sec
- Loading branch information
1 parent
90cf193
commit 193bba5
Showing
13 changed files
with
285 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ jobs: | |
name: Build | ||
runs-on: macos-10.15 | ||
steps: | ||
- name: Set up Go 1.13 | ||
- name: Set up Go 1.16 | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.13 | ||
go-version: 1.16 | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/[email protected] | ||
|
@@ -29,10 +29,10 @@ jobs: | |
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.13 | ||
- name: Set up Go 1.16 | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.13 | ||
go-version: 1.16 | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/[email protected] | ||
|
@@ -51,7 +51,7 @@ jobs: | |
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: '-exclude=G402,G204,G304,G110 ./...' | ||
args: '-exclude=G402,G204,G304,G110,G306 ./...' | ||
CodeQL: | ||
name: CodeQL | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.13.x | ||
go-version: 1.16.x | ||
- name: Upgrade upx | ||
run: | | ||
# try to fix https://github.com/jenkins-zh/jenkins-cli/issues/493 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# /etc/containerd/config.toml | ||
[plugins] | ||
[plugins."io.containerd.grpc.v1.cri"] | ||
sandbox_image = "kubesphere/pause:3.2" | ||
[plugins."io.containerd.grpc.v1.cri".registry] | ||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors] | ||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] | ||
endpoint = ["https://registry-1.docker.io"] | ||
[plugins."io.containerd.grpc.v1.cri".cni] | ||
bin_dir = "/opt/cni/bin" | ||
conf_dir = "/etc/cni/net.d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[Unit] | ||
Description=containerd container runtime | ||
Documentation=https://containerd.io | ||
After=network.target | ||
|
||
[Service] | ||
ExecStartPre=/sbin/modprobe overlay | ||
ExecStart=/usr/local/bin/containerd | ||
Restart=always | ||
RestartSec=5 | ||
Delegate=yes | ||
KillMode=process | ||
OOMScoreAdjust=-999 | ||
LimitNOFILE=1048576 | ||
# Having non-zero Limit*s causes performance problems due to accounting overhead | ||
# in the kernel. We recommend using cgroups to do container-local accounting. | ||
LimitNPROC=infinity | ||
LimitCORE=infinity | ||
TasksMax=infinity | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# /etc/crictl.yaml | ||
runtime-endpoint: unix:///run/containerd/containerd.sock | ||
image-endpoint: unix:///run/containerd/containerd.sock | ||
timeout: 2 | ||
debug: false | ||
pull-image-on-create: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: kubekey.kubesphere.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: kk-config-file | ||
spec: | ||
hosts: | ||
- {name: node1, address: {{.address}}, inetnalAddress: {{.address}}} | ||
roleGroups: | ||
etcd: | ||
- node1 | ||
master: | ||
- node1 | ||
worker: | ||
- node1 | ||
controlPlaneEndpoint: | ||
domain: lb.kubesphere.local | ||
address: "" | ||
port: 6443 | ||
kubernetes: | ||
version: v1.19.8 | ||
imageRepo: kubesphere | ||
clusterName: cluster.local | ||
containerManager: {{.container}} | ||
network: | ||
plugin: calico | ||
kubePodsCIDR: 10.233.64.0/18 | ||
kubeServiceCIDR: 10.233.0.0/18 | ||
registry: | ||
registryMirrors: [] | ||
insecureRegistries: [] | ||
addons: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package containerd | ||
|
||
import ( | ||
// Enable go embed | ||
_ "embed" | ||
) | ||
|
||
//go:embed config.toml | ||
var configToml string | ||
|
||
// GetConfigToml returns the default containerd config file content | ||
func GetConfigToml() string { | ||
return configToml | ||
} | ||
|
||
//go:embed crictl.yaml | ||
var crictl string | ||
|
||
// GetCrictl returns the default crictl config file content | ||
func GetCrictl() string { | ||
return crictl | ||
} | ||
|
||
//go:embed kk_config.yaml | ||
var kkConfig string | ||
|
||
// GetKKConfig returns the default kubekey config file content | ||
func GetKKConfig() string { | ||
return kkConfig | ||
} | ||
|
||
//go:embed containerd.service | ||
var containerdService string | ||
|
||
// GetContainerdService returns the default containerd.service file content | ||
func GetContainerdService() string { | ||
return containerdService | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package containerd | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestEmebdContent(t *testing.T) { | ||
assert.NotEmpty(t, GetCrictl(), "crictl config file is empty") | ||
assert.NotEmpty(t, GetConfigToml(), "containerd config file is empty") | ||
assert.NotEmpty(t, GetKKConfig(), "kk config file is empty") | ||
assert.NotEmpty(t, GetContainerdService(), "containerd.service is empty") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.