Skip to content

Commit

Permalink
Merge pull request #1235 from etungsten/host-ctr-refactor
Browse files Browse the repository at this point in the history
host-ctr: refactoring
  • Loading branch information
etungsten authored Dec 9, 2020
2 parents 2f2787d + 553e770 commit e8812ae
Show file tree
Hide file tree
Showing 9 changed files with 253 additions and 135 deletions.
9 changes: 5 additions & 4 deletions packages/kubernetes-1.15/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Type=notify
EnvironmentFile=/etc/kubernetes/kubelet/env
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT
# Pull the pause container image before starting `kubelet` so `containerd/cri` wouldn't have to
ExecStartPre=/usr/bin/host-ctr -source ${POD_INFRA_CONTAINER_IMAGE} \
-pull-image-only \
-containerd-socket /run/dockershim.sock \
-namespace k8s.io
ExecStartPre=/usr/bin/host-ctr \
--containerd-socket=/run/dockershim.sock \
--namespace=k8s.io \
pull-image \
--source=${POD_INFRA_CONTAINER_IMAGE}
ExecStart=/usr/bin/kubelet \
--cloud-provider aws \
--config /etc/kubernetes/kubelet/config \
Expand Down
9 changes: 5 additions & 4 deletions packages/kubernetes-1.16/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Type=notify
EnvironmentFile=/etc/kubernetes/kubelet/env
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT
# Pull the pause container image before starting `kubelet` so `containerd/cri` wouldn't have to
ExecStartPre=/usr/bin/host-ctr -source ${POD_INFRA_CONTAINER_IMAGE} \
-pull-image-only \
-containerd-socket /run/dockershim.sock \
-namespace k8s.io
ExecStartPre=/usr/bin/host-ctr \
--containerd-socket=/run/dockershim.sock \
--namespace=k8s.io \
pull-image \
--source=${POD_INFRA_CONTAINER_IMAGE}
ExecStart=/usr/bin/kubelet \
--cloud-provider aws \
--config /etc/kubernetes/kubelet/config \
Expand Down
9 changes: 5 additions & 4 deletions packages/kubernetes-1.17/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Type=notify
EnvironmentFile=/etc/kubernetes/kubelet/env
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT
# Pull the pause container image before starting `kubelet` so `containerd/cri` wouldn't have to
ExecStartPre=/usr/bin/host-ctr -source ${POD_INFRA_CONTAINER_IMAGE} \
-pull-image-only \
-containerd-socket /run/dockershim.sock \
-namespace k8s.io
ExecStartPre=/usr/bin/host-ctr \
--containerd-socket=/run/dockershim.sock \
--namespace=k8s.io \
pull-image \
--source=${POD_INFRA_CONTAINER_IMAGE}
ExecStart=/usr/bin/kubelet \
--cloud-provider aws \
--config /etc/kubernetes/kubelet/config \
Expand Down
9 changes: 5 additions & 4 deletions packages/kubernetes-1.18/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Type=notify
EnvironmentFile=/etc/kubernetes/kubelet/env
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT
# Pull the pause container image before starting `kubelet` so `containerd/cri` wouldn't have to
ExecStartPre=/usr/bin/host-ctr -source ${POD_INFRA_CONTAINER_IMAGE} \
-pull-image-only \
-containerd-socket /run/dockershim.sock \
-namespace k8s.io
ExecStartPre=/usr/bin/host-ctr \
--containerd-socket=/run/dockershim.sock \
--namespace=k8s.io \
pull-image \
--source=${POD_INFRA_CONTAINER_IMAGE}
ExecStart=/usr/bin/kubelet \
--cloud-provider aws \
--config /etc/kubernetes/kubelet/config \
Expand Down
5 changes: 4 additions & 1 deletion packages/os/host-containers@.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ EnvironmentFile=/etc/host-containers/%i.env
Environment=LOCAL_DIR=/local
# Create directories for container persistent storage
ExecStartPre=/usr/bin/mkdir -m 1777 -p ${LOCAL_DIR}/host-containers/%i
ExecStart=/usr/bin/host-ctr -ctr-id='%i' -source='${CTR_SOURCE}' -superpowered='${CTR_SUPERPOWERED}'
ExecStart=/usr/bin/host-ctr run \
--container-id='%i' \
--source='${CTR_SOURCE}' \
--superpowered='${CTR_SUPERPOWERED}'
Restart=always
RestartSec=45
TimeoutStopSec=60
Expand Down
2 changes: 1 addition & 1 deletion sources/host-ctr/cmd/host-ctr/logsplit.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (hook *LogSplitHook) Fire(entry *logrus.Entry) error {
return nil
}

// Returns the log levels this hook is being applied to
// Levels returns the log levels this hook is being applied to
func (hook *LogSplitHook) Levels() []logrus.Level {
return hook.levels
}
Loading

0 comments on commit e8812ae

Please sign in to comment.