github.com/pachyderm/pachyderm@v1.13.4/doc/docs/1.9.x/deploy-manage/manage/cluster-access.md (about) 1 # Manage Cluster Access 2 3 Pachyderm contexts enable you to store configuration parameters for 4 multiple Pachyderm clusters in a single configuration file saved at 5 `~/.pachyderm/config.json`. This file stores the information 6 about all Pachyderm clusters that you have deployed from your 7 machine locally or on a remote server. 8 9 For example, if you have a cluster that 10 is deployed locally in `minikube` and another one deployed on 11 Amazon EKS, configurations for these clusters are stored in 12 that `config.json` file. By default, all local cluster configurations 13 have the `local` prefix. If you have multiple local clusters, 14 Pachyderm adds a consecutive number to the `local` prefix 15 of each cluster. 16 17 The following text is an example of a Pachyderm `config.json` file: 18 19 ```shell 20 { 21 "user_id": "b4fe4317-be21-4836-824f-6661c68b8fba", 22 "v2": { 23 "active_context": "local-1", 24 "contexts": { 25 "default": {}, 26 "local": {}, 27 "local-1": {}, 28 }, 29 "metrics": true 30 } 31 } 32 ``` 33 34 ## View the Active Context 35 36 When you have multiple Pachyderm clusters, you can switch 37 between them by setting the current context. 38 The active context is the cluster that you interact with when 39 you run `pachctl` commands. 40 41 To view active context, type: 42 43 * View the active context: 44 45 ```shell 46 $ pachctl config get active-context 47 local-1 48 ``` 49 50 * List all contexts and view the current context: 51 52 ```shell 53 $ pachctl config list context 54 ACTIVE NAME 55 default 56 local 57 * local-1 58 ``` 59 60 The active context is marked with an asterisk. 61 62 ## Change the Active Context 63 64 To change the active context, type `pachctl config set 65 active-context <name>`. 66 67 Also, you can set the `PACH_CONTEXT` environmental variable 68 that overrides the active context. 69 70 **Example:** 71 72 ```shell 73 export PACH_CONTEXT=local1 74 ``` 75 76 ## Create a New Context 77 78 When you deploy a new Pachyderm cluster, a new context 79 that points to the new cluster is created automatically. 80 81 In addition, you can create a new context by providing your parameters 82 through the standard input stream (`stdin`) in your terminal. 83 Specify the parameters as a comma-separated list enclosed in 84 curly brackets. 85 86 !!! note 87 By default, the `pachd` port is `30650`. 88 89 To create a new context with specific parameters, complete 90 the following steps: 91 92 1. Create a new Pachyderm context with a specific `pachd` IP address 93 and a client certificate: 94 95 ```shell 96 $ echo '{"pachd_address":"10.10.10.130:650", "server_cas":"key.pem"}' | pachctl config set context new-local 97 Reading from stdin 98 ``` 99 100 1. Verify your configuration by running the following command: 101 102 ```shell 103 $ pachctl config get context new-local 104 { 105 "pachd_address": "10.10.10.130:650", 106 "server_cas": "key.pem" 107 } 108 ``` 109 110 ## Update an Existing Context 111 112 You can update an existing context with new parameters, such 113 as a Pachyderm IP address, certificate authority (CA), and others. 114 For the list of parameters, see [Pachyderm Config Specification](../../reference/config_spec.md). 115 116 To update the Active Context, run the following commands: 117 118 1. Update the context with a new `pachd` address: 119 120 ```shell 121 $ pachctl config update context local-1 --pachd-address 10.10.10.131 122 ``` 123 124 The `pachctl config update` command supports the `--pachd-address` 125 flag only. 126 127 1. Verify that the context has been updated: 128 129 ```shell 130 $ pachctl config get context local-1 131 { 132 "pachd_address": "10.10.10.131" 133 } 134 ``` 135 136 1. Alternatively, you can update multiple properties by using 137 an `echo` script: 138 139 ```shell 140 $ echo '{"pachd_address":"10.10.10.132", "server_cas":"key.pem"}' | pachctl config set context local-1 --overwrite 141 Reading from stdin. 142 ``` 143 144 1. Verify that the changes were applied: 145 146 ```shell 147 $ pachctl config get context local-1 148 { 149 "pachd_address": "10.10.10.132", 150 "server_cas": "key.pem" 151 } 152 ```