wzshiming / fake-k8s

[Moved to https://github.com/kubernetes-sigs/kwok] fake-k8s is a tool for running Fake Kubernetes clusters, It can be used as an alternative to Kind in some scenarios where you don’t need to actually run the Pod
https://github.com/kubernetes-sigs/kwok
MIT License
18 stars 1 forks source link

download fake-kubelet_linux_amd64 failed #112

Closed moyuduo closed 1 year ago

moyuduo commented 2 years ago

hello, i'm using fake-k8s to create a fake cluster, bug it seems that download some resource failed, i have already open proxy. Is there someone tell me how to resolve this problem?

[root@centos72 ~]# ./fake-k8s create cluster --name c2
Cluster "fake-k8s-c2" already exists
Cluster "fake-k8s-c2" is not ready yet, will be restarted
Download https://github.com/wzshiming/fake-kubelet/releases/download/v0.7.4/fake-kubelet_linux_amd64
#############################################               | 76.2% 18m50s
Failed to continue install cluster "fake-k8s-c2": read tcp 192.168.37.131:46274->185.199.109.133:443: read: connection reset by peer
Error: read tcp 192.168.37.131:46274->185.199.109.133:443: read: connection reset by peer
wzshiming commented 2 years ago

It looks like it was interrupted halfway down, have you set the environment variables in advance, like below:

export http_proxy=http://127.0.0.1:1087 https_proxy=http://127.0.0.1:1087;
moyuduo commented 2 years ago

i'm sure my http proxy is working, i try several times but every time i meet this.

wzshiming commented 2 years ago

In that case, I can think of downloading it in advance or you can try switching to another runtime --runtime docker or --runtime nerdctl

wzshiming commented 2 years ago

like below

KUBE_IMAGE_PREFIX=registry.aliyuncs.com/google_containers KUBE_VERSION=v1.24.1 fake-k8s create cluster --runtime docker
wzshiming commented 2 years ago

Or try this all-in-one image

docker run --rm -it -p 8080:8080 ghcr.io/wzshiming/fake-k8s/cluster:v1.24 
moyuduo commented 2 years ago

like below

KUBE_IMAGE_PREFIX=registry.aliyuncs.com/google_containers KUBE_VERSION=v1.24.1 fake-k8s create cluster --runtime docker

do not work. output blow:

[root@centos72 ~]# KUBE_IMAGE_PREFIX=registry.aliyuncs.com/google_containers KUBE_VERSION=v1.24.1 ./fake-k8s create cluster --name myd --runtime docker
Creating cluster "fake-k8s-myd"
Starting cluster "fake-k8s-myd"
unknown shorthand flag: 'd' in -d
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default
                           "/root/.docker")
  -c, --context string     Name of the context to use to connect to the
                           daemon (overrides DOCKER_HOST env var and
                           default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level
                           ("debug"|"info"|"warn"|"error"|"fatal")
                           (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default
                           "/root/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default
                           "/root/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default
                           "/root/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  app*        Docker App (Docker Inc., v0.9.1-beta3)
  builder     Manage builds
  buildx*     Build with BuildKit (Docker Inc., v0.6.1-docker)
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  scan*       Docker Scan (Docker Inc., v0.8.0)
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/

Error: failed start cluster "fake-k8s-myd": docker compose up -d: exit status 125
Usage:
  fake-k8s create cluster [flags]

Flags:
      --apiserver-port uint32                   port of the apiserver, default is random
      --etcd-binary-tar string                  tar of etcd, only for binary runtime
                                                 (default "https://github.com/etcd-io/etcd/releases/download/v3.5.4/etcd-v3.5.4-linux-amd64.tar.gz")
      --etcd-image string                       image of etcd, only for docker/nerdctl runtime
                                                '${KUBE_IMAGE_PREFIX}/etcd:${ETCD_VERSION}'
                                                 (default "registry.aliyuncs.com/google_containers/etcd:3.5.4-0")
      --fake-kubelet-binary string              binary of fake-kubelet, only for binary runtime
                                                 (default "https://github.com/wzshiming/fake-kubelet/releases/download/v0.7.4/fake-kubelet_linux_amd64")
      --fake-kubelet-image string               image of fake-kubelet, only for docker/nerdctl/kind runtime
                                                '${FAKE_IMAGE_PREFIX}/fake-kubelet:${FAKE_VERSION}'
                                                 (default "ghcr.io/wzshiming/fake-kubelet/fake-kubelet:v0.7.4")
      --feature-gates string                    a set of key=value pairs that describe feature gates for alpha/experimental features of Kubernetes (default "APIListChunking=false,APIPriorityAndFairness=false,APIResponseCompression=false,AnyVolumeDataSource=false,AppArmor=false,CPUManager=false,CPUManagerPolicyBetaOptions=false,CPUManagerPolicyOptions=false,CSIInlineVolume=false,CSIMigration=false,CSIMigrationAWS=false,CSIMigrationAzureFile=false,CSIMigrationGCE=false,CSIMigrationvSphere=false,DaemonSetUpdateSurge=false,DelegateFSGroupToCSIDriver=false,DevicePlugins=false,DisableAcceleratorUsageMetrics=false,DownwardAPIHugePages=false,EndpointSliceTerminatingCondition=false,EphemeralContainers=false,ExperimentalHostUserNamespaceDefaulting=false,GRPCContainerProbe=false,GracefulNodeShutdown=false,GracefulNodeShutdownBasedOnPodPriority=false,IdentifyPodOS=false,JobMutableNodeSchedulingDirectives=false,JobReadyPods=false,JobTrackingWithFinalizers=false,KubeletCredentialProviders=false,KubeletPodResources=false,KubeletPodResourcesGetAllocatable=false,LegacyServiceAccountTokenNoAutoGeneration=false,LocalStorageCapacityIsolation=false,LogarithmicScaleDown=false,MemoryManager=false,MixedProtocolLBService=false,NetworkPolicyEndPort=false,OpenAPIEnums=false,OpenAPIV3=false,PodDeletionCost=false,PodSecurity=false,ProbeTerminationGracePeriod=false,RotateKubeletServerCertificate=false,ServiceInternalTrafficPolicy=false,SizeMemoryBackedVolumes=false,StatefulSetMinReadySeconds=false,TopologyAwareHints=false,TopologyManager=false,WinOverlay=false,WindowsHostProcessContainers=false")
      --generate-node-name string               node name of the fake node (default "fake-")
      --generate-replicas uint32                replicas of the fake node (default 5)
  -h, --help                                    help for cluster
      --kind-node-image string                  image of kind node, only for kind runtime
                                                '${KIND_NODE_IMAGE_PREFIX}/node:${KUBE_VERSION}'
                                                 (default "docker.io/kindest/node:v1.24.1")
      --kube-apiserver-binary string            binary of kube-apiserver, only for binary runtime
                                                '${KUBE_BINARY_PREFIX}/kube-apiserver'
                                                 (default "https://dl.k8s.io/release/v1.24.1/bin/linux/amd64/kube-apiserver")
      --kube-apiserver-image string             image of kube-apiserver, only for docker/nerdctl runtime
                                                '${KUBE_IMAGE_PREFIX}/kube-apiserver:${KUBE_VERSION}'
                                                 (default "registry.aliyuncs.com/google_containers/kube-apiserver:v1.24.1")
      --kube-controller-manager-binary string   binary of kube-controller-manager, only for binary runtime
                                                '${KUBE_BINARY_PREFIX}/kube-controller-manager'
                                                 (default "https://dl.k8s.io/release/v1.24.1/bin/linux/amd64/kube-controller-manager")
      --kube-controller-manager-image string    image of kube-controller-manager, only for docker/nerdctl runtime
                                                '${KUBE_IMAGE_PREFIX}/kube-controller-manager:${KUBE_VERSION}'
                                                 (default "registry.aliyuncs.com/google_containers/kube-controller-manager:v1.24.1")
      --kube-scheduler-binary string            binary of kube-scheduler, only for binary runtime
                                                '${KUBE_BINARY_PREFIX}/kube-scheduler'
                                                 (default "https://dl.k8s.io/release/v1.24.1/bin/linux/amd64/kube-scheduler")
      --kube-scheduler-image string             image of kube-scheduler, only for docker/nerdctl runtime
                                                '${KUBE_IMAGE_PREFIX}/kube-scheduler:${KUBE_VERSION}'
                                                 (default "registry.aliyuncs.com/google_containers/kube-scheduler:v1.24.1")
      --node-name stringArray                   node name of the fake node
      --prometheus-binary-tar string            tar of Prometheus, only for binary runtime
                                                 (default "https://github.com/prometheus/prometheus/releases/download/v2.35.0/prometheus-2.35.0.linux-amd64.tar.gz")
      --prometheus-image string                 image of Prometheus, only for docker/nerdctl/kind runtime
                                                '${PROMETHEUS_IMAGE_PREFIX}/prometheus:${PROMETHEUS_VERSION}'
                                                 (default "docker.io/prom/prometheus:v2.35.0")
      --prometheus-port uint32                  port to expose Prometheus metrics
      --quiet-pull                              pull without printing progress information
      --runtime string                          runtime of the fake cluster (binary or docker or kind or nerdctl) (default "binary")
      --runtime-config string                   a set of key=value pairs that enable or disable built-in APIs (default "api/legacy=false,api/alpha=false")
      --secure-port                             apiserver use TLS (default true)

Global Flags:
      --name string   cluster name (default "default")
wzshiming commented 2 years ago

Use --runtime=docker on Linux, need to install the compose v2

wzshiming commented 1 year ago

Moved to https://github.com/kubernetes-sigs/kwok Close this