Skip to content

Commit

Permalink
bugfix: make infra image configurable
Browse files Browse the repository at this point in the history
Signed-off-by: YaoZengzeng <[email protected]>
  • Loading branch information
YaoZengzeng committed Apr 18, 2018
1 parent 5f57ba3 commit 46dc486
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cri/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ type Config struct {
NetworkPluginBinDir string
// NetworkPluginConfDir is the directory in which the admin places a CNI conf.
NetworkPluginConfDir string
// SandboxImage is the image used by sandbox container.
SandboxImage string
}
8 changes: 4 additions & 4 deletions daemon/mgr/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ const (
// nameDelimiter is used to construct pouch container names.
nameDelimiter = "_"

defaultSandboxImage = "k8s.gcr.io/pause-amd64:3.0"

// Address and port of stream server.
// TODO: specify them in the parameters of pouchd.
streamServerAddress = ""
Expand Down Expand Up @@ -92,6 +90,8 @@ type CriManager struct {

// SandboxStore stores the configuration of sandboxes.
SandboxStore *collect.SafeMap
// SandboxImage is the image used by sandbox container.
SandboxImage string
}

// NewCriManager creates a brand new cri manager.
Expand All @@ -108,6 +108,7 @@ func NewCriManager(config *config.Config, ctrMgr ContainerMgr, imgMgr ImageMgr)
StreamServer: streamServer,
SandboxBaseDir: path.Join(config.HomeDir, "sandboxes"),
SandboxStore: collect.NewSafeMap(),
SandboxImage: config.CriConfig.SandboxImage,
}

return NewCriWrapper(c), nil
Expand Down Expand Up @@ -136,8 +137,7 @@ func (c *CriManager) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
config := r.GetConfig()

// Step 1: Prepare image for the sandbox.
// TODO: make sandbox image configurable.
image := defaultSandboxImage
image := c.SandboxImage

// Make sure the sandbox image exists.
err := c.ensureSandboxImageExists(ctx, image)
Expand Down
4 changes: 4 additions & 0 deletions docs/kubernetes/pouch_with_kubernetes_deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,8 @@ rtt min/avg/max/mdev = 0.041/0.055/0.068/0.012 ms

- Kubernetes 1.10.0 has been released recently and you may install it by default.However, for the NOTE metioned above, Kubernetes 1.9.X is recommanded for current Pouch.In ubuntu, we could use `apt-cache madison kubelet` to search the Kubernetes version which is available, then specify the version when install it, like `apt-get install kubelet=1.9.4-00`.

- By default Pouch will not enable the CRI. If you'd like to deploy Kubernetes with Pouch, you should start pouchd with the configuration like `pouchd --enable-cri`.

- By default Pouch will use `registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0` as the image of infra container. If you'd like use image other than that, you could start pouchd with the configuration like `pouchd --enable-cri --sandbox-image XXX`.

- Any other troubles? Make an issue to connect with us!
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func setupFlags(cmd *cobra.Command) {
flagSet.StringVar(&cfg.CriConfig.Listen, "listen-cri", "/var/run/pouchcri.sock", "Specify listening address of CRI")
flagSet.StringVar(&cfg.CriConfig.NetworkPluginBinDir, "cni-bin-dir", "/opt/cni/bin", "The directory for putting cni plugin binaries.")
flagSet.StringVar(&cfg.CriConfig.NetworkPluginConfDir, "cni-conf-dir", "/etc/cni/net.d", "The directory for putting cni plugin configuration files.")
flagSet.StringVar(&cfg.CriConfig.SandboxImage, "sandbox-image", "registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0", "The image used by sandbox container.")
flagSet.BoolVarP(&cfg.Debug, "debug", "D", false, "Switch daemon log level to DEBUG mode")
flagSet.StringVarP(&cfg.ContainerdAddr, "containerd", "c", "/var/run/containerd.sock", "Specify listening address of containerd")
flagSet.StringVar(&cfg.ContainerdPath, "containerd-path", "", "Specify the path of containerd binary")
Expand Down

0 comments on commit 46dc486

Please sign in to comment.