From 4d9c69c167638d91131ec72c38859e09028573f6 Mon Sep 17 00:00:00 2001 From: Blake Date: Sat, 29 Jul 2017 13:29:28 -0700 Subject: [PATCH] Add documentation and update text fixture --- docs/cli/kops_create_secret.md | 4 ++ docs/cli/kops_create_secret_nodedockercfg.md | 48 +++++++++++++++++++ docs/security.md | 9 ++++ .../tests/kubelet/featuregates/tasks.yaml | 1 + 4 files changed, 62 insertions(+) create mode 100644 docs/cli/kops_create_secret_nodedockercfg.md diff --git a/docs/cli/kops_create_secret.md b/docs/cli/kops_create_secret.md index 27e7b55d57..1a72db8127 100644 --- a/docs/cli/kops_create_secret.md +++ b/docs/cli/kops_create_secret.md @@ -16,6 +16,9 @@ Create a secret # Create an new ssh public key called admin. kops create secret sshpublickey admin -i ~/.ssh/id_rsa.pub \ --name k8s-cluster.example.com --state s3://example.com + + kops create secret nodedockercfg -i ~/.docker/config.json \ + --name k8s-cluster.example.com --state s3://example.com ``` ### Options inherited from parent commands @@ -35,5 +38,6 @@ Create a secret ### SEE ALSO * [kops create](kops_create.md) - Create a resource by command line, filename or stdin. +* [kops create secret nodedockercfg](kops_create_secret_nodedockercfg.md) - Create a node docker config. * [kops create secret sshpublickey](kops_create_secret_sshpublickey.md) - Create a ssh public key. diff --git a/docs/cli/kops_create_secret_nodedockercfg.md b/docs/cli/kops_create_secret_nodedockercfg.md new file mode 100644 index 0000000000..664f3d33a9 --- /dev/null +++ b/docs/cli/kops_create_secret_nodedockercfg.md @@ -0,0 +1,48 @@ + + + +## kops create secret nodedockercfg + +Create a node docker config. + +### Synopsis + + +Create a new node docker config, and store it in the state store. Use update to update it, this command will only create a new entry. + +``` +kops create secret nodedockercfg +``` + +### Examples + +``` + # Create an new node docker config. + kops create secret nodedockerconfig -i /path/to/docker/config.json \ + --name k8s-cluster.example.com --state s3://example.com +``` + +### Options + +``` + -i, -- string Path to node docker config +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + --config string config file (default is $HOME/.kops.yaml) + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files (default false) + --name string Name of cluster + --state string Location of state storage + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + +### SEE ALSO +* [kops create secret](kops_create_secret.md) - Create a secret. + diff --git a/docs/security.md b/docs/security.md index b3637fe310..8e20051630 100644 --- a/docs/security.md +++ b/docs/security.md @@ -20,6 +20,15 @@ To change the SSH public key on an existing cluster: * `kops update cluster --yes` to reconfigure the auto-scaling groups * `kops rolling-update cluster --name --yes` to immediately roll all the machines so they have the new key (optional) +## Node Docker Configuration + +If you are using a private registry such as quay.io, you may be familiar with the inconvenience of managing the `imagePullSecrets` for each namespace. It can also be a pain to use [Kops Hooks ](cluster_spec.md#hooks) with private images. To configure docker on all nodes with access to one or more private registries: + +* `kops create secret --name nodedockercfg -i ~/.docker/config.json` +* `kops rolling-update cluster --name --yes` to immediately roll all the machines so they have the new key (optional) + +This stores the `config.json` in `/root/.docker/config.json` on all nodes so that both Kubernetes and system containers may use the registries. + ## IAM roles All Pods running on your cluster have access to underlying instance IAM role. diff --git a/nodeup/pkg/model/tests/kubelet/featuregates/tasks.yaml b/nodeup/pkg/model/tests/kubelet/featuregates/tasks.yaml index 585a3aae16..a0d60b74f3 100644 --- a/nodeup/pkg/model/tests/kubelet/featuregates/tasks.yaml +++ b/nodeup/pkg/model/tests/kubelet/featuregates/tasks.yaml @@ -1,4 +1,5 @@ contents: | DAEMON_ARGS="--feature-gates=AllowExtTrafficLocalEndpoints=false,ExperimentalCriticalPodAnnotation=true --node-labels=kubernetes.io/role=node,node-role.kubernetes.io/node= --cni-bin-dir=/opt/cni/bin/ --cni-conf-dir=/etc/cni/net.d/ --network-plugin-dir=/opt/cni/bin/" + HOME="/root" path: /etc/sysconfig/kubelet type: file