From 5dedac8cbbc5211cf5d29dcfc16831b03c220bc8 Mon Sep 17 00:00:00 2001 From: Alvaro <1841612+inercia@users.noreply.github.com> Date: Wed, 30 Dec 2020 18:47:37 +0100 Subject: [PATCH 1/2] Print the creation time for containers (#431) * Added a new `created` field that exports the creation time for all the containers in the cluster. Signed-off-by: Alvaro Saurin --- pkg/runtimes/docker/translate.go | 3 +-- pkg/types/types.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/runtimes/docker/translate.go b/pkg/runtimes/docker/translate.go index 414ff012..f65ec0a8 100644 --- a/pkg/runtimes/docker/translate.go +++ b/pkg/runtimes/docker/translate.go @@ -39,7 +39,6 @@ import ( // TranslateNodeToContainer translates a k3d node specification to a docker container representation func TranslateNodeToContainer(node *k3d.Node) (*NodeInDocker, error) { - /* initialize everything that we need */ containerConfig := docker.Config{} hostConfig := docker.HostConfig{ @@ -134,7 +133,6 @@ func TranslateContainerToNode(cont *types.Container) (*k3d.Node, error) { // TranslateContainerDetailsToNode translates a docker containerJSON object into a k3d node representation func TranslateContainerDetailsToNode(containerDetails types.ContainerJSON) (*k3d.Node, error) { - // translate portMap to string representation ports := []string{} for containerPort, portBindingList := range containerDetails.HostConfig.PortBindings { @@ -201,6 +199,7 @@ func TranslateContainerDetailsToNode(containerDetails types.ContainerJSON) (*k3d Args: []string{}, // empty, since Cmd already contains flags Ports: ports, Restart: restart, + Created: containerDetails.Created, Labels: labels, Network: clusterNetwork, ServerOpts: serverOpts, diff --git a/pkg/types/types.go b/pkg/types/types.go index bf20e6df..654cdf51 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -240,6 +240,7 @@ type Node struct { Args []string `yaml:"extra_args" json:"extraArgs,omitempty"` Ports []string `yaml:"port_mappings" json:"portMappings,omitempty"` Restart bool `yaml:"restart" json:"restart,omitempty"` + Created string `yaml:"created" json:"created,omitempty"` Labels map[string]string // filled automatically Network string // filled automatically ExtraHosts []string // filled automatically From e7802d2def3dd781d65078be418ea1059658d51a Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 5 Jan 2021 02:15:36 -0500 Subject: [PATCH 2/2] docs: spell checking (#434, @jsoref) --- docs/usage/guides/calico.md | 2 +- docs/usage/guides/calico.yaml | 4 ++-- docs/usage/guides/cuda.md | 2 +- mkdocs.yml | 2 +- pkg/cluster/cluster.go | 6 +++--- pkg/tools/tools.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/usage/guides/calico.md b/docs/usage/guides/calico.md index 1a8a8a16..fd1c71eb 100644 --- a/docs/usage/guides/calico.md +++ b/docs/usage/guides/calico.md @@ -34,7 +34,7 @@ For watching for the pod(s) deployment watch "kubectl get pods -n kube-system" ``` -You will have something like this at begining (with the command line `kubectl get pods -n kube-system`) +You will have something like this at beginning (with the command line `kubectl get pods -n kube-system`) ``` NAME READY STATUS RESTARTS AGE helm-install-traefik-pn84f 0/1 Pending 0 3s diff --git a/docs/usage/guides/calico.yaml b/docs/usage/guides/calico.yaml index b077877e..9de2ffd0 100644 --- a/docs/usage/guides/calico.yaml +++ b/docs/usage/guides/calico.yaml @@ -2092,7 +2092,7 @@ spec: type: object ipipMode: description: Contains configuration for IPIP tunneling for this pool. - If not specified, then this is defaulted to "Never" (i.e. IPIP tunelling + If not specified, then this is defaulted to "Never" (i.e. IPIP tunneling is disabled). type: string nat-outgoing: @@ -2112,7 +2112,7 @@ spec: vxlanMode: description: Contains configuration for VXLAN tunneling for this pool. If not specified, then this is defaulted to "Never" (i.e. VXLAN - tunelling is disabled). + tunneling is disabled). type: string required: - cidr diff --git a/docs/usage/guides/cuda.md b/docs/usage/guides/cuda.md index 11135c9a..efb7320d 100644 --- a/docs/usage/guides/cuda.md +++ b/docs/usage/guides/cuda.md @@ -116,7 +116,7 @@ We need to configure containerd to use the NVIDIA Container Runtime. We need to ``` ### The NVIDIA device plugin -To enable NVIDIA GPU support on Kubernetes you also need to install the [NVIDIA device plugin](https://github.com/NVIDIA/k8s-device-plugin). The device plugin is a deamonset and allows you to automatically: +To enable NVIDIA GPU support on Kubernetes you also need to install the [NVIDIA device plugin](https://github.com/NVIDIA/k8s-device-plugin). The device plugin is a daemonset and allows you to automatically: * Expose the number of GPUs on each nodes of your cluster * Keep track of the health of your GPUs * Run GPU enabled containers in your Kubernetes cluster. diff --git a/mkdocs.yml b/mkdocs.yml index 5291f60b..75a3f185 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,7 +30,7 @@ theme: favicon: static/img/favicons_black_blue/favicon.png # Navigation -# nav: ommitted, because we're using the awesome-pages plugin (https://squidfunk.github.io/mkdocs-material/plugins/awesome-pages/) +# nav: omitted, because we're using the awesome-pages plugin (https://squidfunk.github.io/mkdocs-material/plugins/awesome-pages/) # Extensions markdown_extensions: diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 48a4c027..d06230e4 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -229,7 +229,7 @@ func ClusterCreate(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clus logreader.Close() } log.Errorln(err) - log.Errorln("Failed to get logs from the initializig server node.. waiting for 3 seconds instead") + log.Errorln("Failed to get logs from the initializing server node.. waiting for 3 seconds instead") time.Sleep(3 * time.Second) break } @@ -278,7 +278,7 @@ func ClusterCreate(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clus } } - // asynchronously wait for this server node to be ready (by checking the logs for a specific log mesage) + // asynchronously wait for this server node to be ready (by checking the logs for a specific log message) if node.Role == k3d.ServerRole && cluster.CreateClusterOpts.WaitForServer { log.Debugf("Waiting for server node '%s' to get ready", node.Name) if err := NodeWaitForLogMessage(clusterCreateCtx, runtime, node, k3d.ReadyLogMessageByRole[k3d.ServerRole], time.Time{}); err != nil { @@ -598,7 +598,7 @@ func ClusterStart(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clust continue } - // asynchronously wait for this server node to be ready (by checking the logs for a specific log mesage) + // asynchronously wait for this server node to be ready (by checking the logs for a specific log message) if node.Role == k3d.ServerRole && startClusterOpts.WaitForServer { serverNode := node waitForServerWaitgroup.Go(func() error { diff --git a/pkg/tools/tools.go b/pkg/tools/tools.go index 2f386de2..0cb67b49 100644 --- a/pkg/tools/tools.go +++ b/pkg/tools/tools.go @@ -46,7 +46,7 @@ func ImageImportIntoClusterMulti(ctx context.Context, runtime runtimes.Runtime, runtimeImages, err := runtime.GetImages(ctx) if err != nil { - log.Errorln("Failed to fetch list of exsiting images from runtime") + log.Errorln("Failed to fetch list of existing images from runtime") return err }