github.com/pachyderm/pachyderm@v1.13.4/doc/docs/master/deploy-manage/deploy/import-kubernetes-context.md (about)

     1  # Import a Kubernetes Context
     2  
     3  !!! note
     4      The steps in this section apply to your configuration only
     5      if you have deployed Pachyderm from a manifest created by the `pachctl deploy`
     6      command with the `--dry-run` flag. If you did not use the `--dry-run` flag,
     7      skip this section.
     8  
     9  When you run the `pachctl deploy` command with `--dry-run` flag, instead of
    10  immediately deploying a cluster, the command creates a Kubernetes
    11  deployment manifest that you can further edit and later use to deploy a
    12  Pachyderm cluster.
    13  
    14  You can use that manifest with a standard `kubectl apply` command to deploy
    15  Pachyderm. For example, if you have created a manifest called
    16  `test-manifest.yaml`, you can deploy a Pachyderm cluster by running the
    17  following command:
    18  
    19  ```shell
    20  kubectl apply -f test-manifest.yaml
    21  ```
    22  
    23  Typically, when you run `pachctl deploy`,
    24  Pachyderm creates a new Pachyderm context with the information from
    25  the current
    26  [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context)
    27  embedded into it.
    28  
    29  When you use the `--dry-run` flag, the Pachyderm context is not created.
    30  Therefore, if you deploy a Pachyderm cluster from a manifest that you have
    31  created earlier, you need to manually create a new Pachyderm context with
    32  the embedded current Kubernetes context and activate that context.
    33  
    34  To import a Kubernetes context, complete the following steps:
    35  
    36  1. Deploy a Pachyderm cluster from the Kubernetes manifest that you have
    37     created when you ran the `pachctl deploy` command with the `--dry-run`
    38     flag:
    39  
    40     ```shell
    41     kubectl apply -f <manifest.yaml>
    42     ```
    43  
    44     **System Response:**
    45  
    46     ```shell
    47     clusterrole.rbac.authorization.k8s.io/pachyderm configured
    48     clusterrolebinding.rbac.authorization.k8s.io/pachyderm configured
    49     deployment.apps/etcd configured
    50     service/etcd configured
    51     service/pachd configured
    52     deployment.apps/pachd configured
    53     service/dash configured
    54     deployment.apps/dash configured
    55     secret/pachyderm-storage-secret configured
    56     ```
    57  
    58  1. Verify that the cluster was successfully deployed:
    59  
    60     ```shell
    61     kubectl get pods
    62     ```
    63  
    64     **System Response:**
    65  
    66     ```shell
    67     NAME                     READY   STATUS    RESTARTS   AGE
    68     dash-64c868cc8b-j79d6    2/2     Running   0          20h
    69     etcd-6865455568-tm5tf    1/1     Running   0          20h
    70     pachd-6464d985c7-dqgzg   1/1     Running   0          70s
    71     ```
    72  
    73     You must see all the `dash`, `etcd`, and `pachd` pods running.
    74  
    75  1. Create a new Pachyderm context with the embedded Kubernetes context:
    76  
    77     ```shell
    78     pachctl config set context <new-pachyderm-context> -k `kubectl config current-context`
    79     ```
    80  
    81  1. Verify that the context was successfully created and view the context parameters:
    82  
    83     **Example:**
    84  
    85     ```shell
    86     pachctl config get context test-context
    87     ```
    88  
    89     **System Response:**
    90  
    91     ```shell
    92     {
    93       "source": "IMPORTED",
    94       "cluster_name": "minikube",
    95       "auth_info": "minikube",
    96       "namespace": "default"
    97     }
    98     ```
    99  
   100  1. Activate the new Pachyderm context:
   101  
   102     ```shell
   103     pachctl config set active-context <new-pachyderm-context>
   104     ```
   105  
   106  1. Verify that the new context has been activated:
   107  
   108     ```shell
   109     pachctl config get active-context
   110     ```