-
Notifications
You must be signed in to change notification settings - Fork 889
Description
General Question
When using the K8S YAML project, I created a very simple Go project, which can create environments, but it always reports errors when executing workflows. Here are the detailed information. Could you help me take a look?
main.go
package main
import (
"fmt"
"time"
)
func main() {
for {
currentTime := time.Now().Format("2006-01-02 15:04:05")
fmt.Printf("[%s] Hello Worldaaaaaaa\n", currentTime)
time.Sleep(1 * time.Second)
}
}
Dockerfile:
FROM 192.168.5.15:5000/zadig/golang:1.22-alpine AS builder
WORKDIR /app
COPY . .
RUN go build -o main
FROM 192.168.5.15:5000/zadig/alpine:20251206
WORKDIR /root/
COPY --from=builder /app/main .
CMD ["./main"]
k8s-yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-app
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: 192.168.5.15:5000/zadig/hello-world-app:20251206 # 替换为实际镜像地址
ports:
- containerPort: 8080
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
selector:
app: hello-world
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: LoadBalancer
error:
Normal Created 11s kubelet Created container: job-0-0-0-goujian
Warning Failed 11s kubelet Error: failed to start container "job-0-0-0-goujian": Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error setting cgroup config for procHooks process: failed to write "400000": write /sys/fs/cgroup/cpu,cpuacct/kubepods/burstable/pod76c568a4-e166-445a-af64-c16369d580c4/job-0-0-0-goujian/cpu.cfs_quota_us: invalid argument: unknown
docker:28.1.1
minikube:1.36.0
kubectl:1.33.1