@@ -4,42 +4,88 @@ CKAN Cloud operator manages, provisions and configures Ckan Cloud instances and
44
55## Install
66
7- Create secret ` ckan-infra ` under namespace ` ckan-cloud ` with the following values:
8-
9- * GCLOUD_SQL_INSTANCE_NAME
10- * GCLOUD_SQL_PROJECT
11- * POSTGRES_HOST
12- * POSTGRES_USER
13- * POSTGRES_PASSWORD
14- * SOLR_HTTP_ENDPOINT
15- * SOLR_NUM_SHARDS
16- * SOLR_REPLICATION_FACTOR
17- * DOCKER_REGISTRY_SERVER
18- * DOCKER_REGISTRY_USERNAME
19- * DOCKER_REGISTRY_PASSWORD
20- * DOCKER_REGISTRY_EMAIL
21-
22- ## Run using Docker
23-
24- You will need the following details:
25-
26- * Path to .kube-config file with permissions to the relevant Kubernetes cluster
27- * Path to Google Compute Cloud service account json with required permissions
28- * The Google service account email associated with the service account json
29- * The Google Project ID associated with the infrastructure and GKE cluster
7+ ckan-cloud-operator-env is used to install and manage CKAN Cloud operator environments on your local PC
308
31- Run ckan-cloud-operator without arguments to get a help message:
9+ The only requirement is a .kube-config file with permissions to the relevant cluster
10+
11+ Install ckan-cloud-operator-env
12+
13+ ```
14+ curl https://raw.githubusercontent.com/ViderumGlobal/ckan-cloud-operator/master/ckan-cloud-operator-env.sh \
15+ | sudo tee /usr/local/bin/ckan-cloud-operator-env &&\
16+ sudo chmod +x /usr/local/bin/ckan-cloud-operator-env
17+ ```
18+
19+ Pull the latest Docker image
3220
3321```
34- docker run \
35- -v /path/to/.kube-config:/etc/ckan-cloud/.kube-config \
36- -v /path/to/glcoud-service-account.json:/etc/ckan-cloud/gcloud-service-account.json \
37- -e GCLOUD_SERVICE_ACCOUNT_EMAIL= \
38- -e GCLOUD_AUTH_PROJECT= \
39- -it viderum/ckan-cloud-operator
22+ ckan-cloud-operator-env pull
4023```
4124
42- ## Run locally
25+ Add an environment (to run on Minikube set PATH_TO_KUBECONFIG_FILE to minikube)
26+
27+ ```
28+ sudo ckan-cloud-operator-env add <ENVIRONMENT_NAME> <PATH_TO_KUBECONFIG_FILE>
29+ ```
30+
31+ Verify you are connected to the correct cluster
32+
33+ ```
34+ ckan-cloud-operator cluster-info
35+ ```
36+
37+ ## Usage
38+
39+ Use the help message of the different commands for the reference documentation and usage examples
40+
41+ ```
42+ ckan-cloud-operator --help
43+ ```
44+
45+ Start a bash shell with completion
46+
47+ ```
48+ ckan-cloud-operator bash
49+ ```
50+
51+ This start a bash shell inside the ckan-cloud-operator Docker container, you can use bash completion inside this shell
52+
53+ ```
54+ ckan-cloud-operator <TAB><TAB>
55+ ```
56+
57+ ## Managing multiple environments
58+
59+ ckan-cloud-operator-env supports managing multiple environments
60+
61+ Add environments using ` ckan-cloud-operator-env add <ENVIRONMENT_NAME> <PATH_TO_KUBECONFIG_FILE> `
62+
63+ Each environment is accessible using executable ` ckan-cloud-operator-<ENVIRONMENT_NAME> `
64+
65+ Activating an environment sets the ` ckan-cloud-operator ` executable to use to the relevant environment executable
66+
67+ ```
68+ ckan-cloud-operator-env activate <ENVIRONMENT_NAME>
69+ ```
70+
71+ ## Initializing a cluster for ckan-cloud-operator
72+
73+ Kubernetes custom resource definitions are used for management of the CKAN Cloud resources
74+
75+ Run the following command to ensure the crds are installed on the cluster
76+
77+ ```
78+ ckan-cloud-operator install-crds
79+ ```
80+
81+ ckan-cloud-operator using a secret named ` ckan-infra ` under namespace ` ckan-cloud ` to get infrastrutcute secrets.
82+
83+ See the list of values in [ ckan_cloud_operator/infra.py] ( ckan_cloud_operator/infra.py )
84+
85+ You can clone an infrastructure secret using ` ckan-infra clone ` command
86+ and some infrastructure secrets can be set using ` ckan-infra set ` command
87+
88+ ## Run ckan-cloud-operator locally
4389
4490Ensure you have ` kubectl ` and ` gcloud ` binaries, authenticated to the relevant gcloud account / kubernetes cluster.
4591
@@ -55,19 +101,20 @@ Install the Python package:
55101python3 -m pip install -e .
56102```
57103
58- Run ckan-cloud-operator without arguments to get a help message :
104+ Authenticate the gcloud CLI to the relevant account :
59105
60106```
61- ckan-cloud-operator
107+ ckan-cloud-operator activate-gcloud-auth
62108```
63109
64- ## Install custom resource definitions
110+ Run ckan-cloud-operator without arguments to get a help message:
65111
66- Kubernetes custom resource definitions are used for management of the CKAN Cloud resources
112+ ```
113+ ckan-cloud-operator
114+ ```
67115
68- Run the following command to ensure the crds are installed on the cluster
116+ Enable Bash completion
69117
70118```
71- ckan-cloud-operator install-crds
119+ eval "$(_CKAN_CLOUD_OPERATOR_COMPLETE=source ckan-cloud-operator)"
72120```
73-
0 commit comments