You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/state.md
+18-9
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,14 @@ though we have to copy the data from the state store to a file where components
9
9
10
10
The state store uses kops's VFS implementation, so can in theory be stored anywhere.
11
11
As of now the following state stores are supported:
12
-
13
-
* Amazon AWS S3 (s3://)
14
-
* local filesystem (file://)
15
-
* Digital Ocean (do://)
12
+
* Amazon AWS S3 (`s3://`)
13
+
* local filesystem (`file://`) (only for dry-run purposes, see [note](#local-filesystem-state-stores) below)
14
+
* Digital Ocean (`do://`)
16
15
* MemFS (memfs://)
17
-
* Google Cloud (gs://)
18
-
* Kubernetes (k8s://)
19
-
* OpenStack Swift (swift://)
20
-
* AliCloud (oss://)
16
+
* Google Cloud (`gs://`)
17
+
* Kubernetes (`k8s://`)
18
+
* OpenStack Swift (`swift://`)
19
+
* AliCloud (`oss://`)
21
20
22
21
The state store is just files; you can copy the files down and put them into git (or your preferred version control system).
23
22
@@ -47,6 +46,16 @@ There are a few ways to configure your state store. In priority order:
47
46
+ config file `$HOME/.kops.yaml`
48
47
+ config file `$HOME/.kops/config`
49
48
49
+
## Local filesystem state stores
50
+
51
+
The local filesystem state store (`file://`) is **not** functional for running clusters. It is permitted so as to enable review workflows.
52
+
53
+
For example, in a review workflow, it can be desirable to check a set of untrusted changes before they are applied to real infrastructure. If submitted untrusted changes to configuration files are naively run by `kops replace`, then Kops would overwrite the state store used by production infrastructure with changes which have not yet been approved. This is dangerous.
54
+
55
+
Instead, a review workflow may download the contents of the state bucket to a local directory (using `aws s3 sync` or similar), set the state store to the local directory (e.g. `--state file:///path/to/state/store`), and then run `kops replace` and `kops update` (but for a dry-run only - _not_`kops update --yes`). This allows the review process to make changes to a local copy of the state bucket, and check those changes, without touching the production state bucket or production infrastructure.
56
+
57
+
Trying to use a local filesystem state store for real (i.e. `kops update --yes`) clusters will not work since the Kubernetes nodes in the cluster need to be able to read from the same state bucket, and the local filesystem will not be mounted to all of the Kubernetes nodes. In theory, a cluster administrator could put the state store on a shared NFS volume that is mounted to the same directory on each of the nodes; however, that use case is not supported as of yet.
0 commit comments