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
removing parts of config.
* chaning secret name pattern to make things shorter.
* Move section on self building docker image.
* Fix typo.
* Bump image.
* bump version for pdb fix.
* Changes in regards to review.
* Fix xhyve driver link.
* Move to new api, remove service account, not needed for minikube.
* Changed minimal manifest and example to use right file.
* Added service account for operator again, it is needed in pods anyways later.
$ cd ${GOPATH}/src/github.com/zalando-incubator/ && git clone https://github.com/zalando-incubator/postgres-operator.git
44
-
45
-
46
-
## Building the operator
47
-
48
-
You need Glide to fetch all dependencies. Install it with:
49
-
50
-
$ make tools
51
-
52
-
Next, install dependencies with glide by issuing:
53
-
54
-
$ make deps
55
-
56
-
This would take a while to complete. You have to redo `make deps` every time you dependencies list changes, i.e. after adding a new library dependency.
57
-
58
-
Build the operator docker image and pushing it to Pier One:
59
-
60
-
$ make docker push
61
-
62
-
You may define the TAG variable to assign an explicit tag to your docker image and the IMAGE to set the image name.
63
-
By default, the tag is computed with `git describe --tags --always --dirty` and the image is `pierone.stups.zalan.do/acid/postgres-operator`
64
-
65
-
Building the operator binary (for testing the out-of-cluster option):
66
-
67
-
$ make
68
-
69
-
The binary will be placed into the build directory.
70
-
71
-
## Testing the operator
30
+
## Running and testing the operator
72
31
73
32
The best way to test the operator is to run it in minikube. Minikube is a tool to run Kubernetes cluster locally.
74
33
@@ -81,51 +40,31 @@ After the installation, issue the
81
40
82
41
$ minikube start
83
42
84
-
Note: if you are running on a Mac, make sure to use the [xhyve driver](https://github.com/kubernetes/minikube/blob/master/DRIVERS.md#xhyve-driver)
43
+
Note: if you are running on a Mac, make sure to use the [xhyve driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#xhyve-driver)
85
44
instead of the default docker-machine one for performance reasons.
86
45
87
46
One you have it started successfully, use [the quickstart guide](https://github.com/kubernetes/minikube#quickstart) in order
88
47
to test your that your setup is working.
89
48
90
49
Note: if you use multiple kubernetes clusters, you can switch to minikube with `kubectl config use-context minikube`
$ cd ${GOPATH}/src/github.com/zalando-incubator/ && git clone https://github.com/zalando-incubator/postgres-operator.git
114
+
115
+
116
+
## Building the operator
117
+
118
+
You need Glide to fetch all dependencies. Install it with:
119
+
120
+
$ make tools
121
+
122
+
Next, install dependencies with glide by issuing:
123
+
124
+
$ make deps
125
+
126
+
This would take a while to complete. You have to redo `make deps` every time you dependencies list changes, i.e. after adding a new library dependency.
127
+
128
+
Build the operator docker image and pushing it to Pier One:
129
+
130
+
$ make docker push
131
+
132
+
You may define the TAG variable to assign an explicit tag to your docker image and the IMAGE to set the image name.
133
+
By default, the tag is computed with `git describe --tags --always --dirty` and the image is `pierone.stups.zalan.do/acid/postgres-operator`
134
+
135
+
Building the operator binary (for testing the out-of-cluster option):
136
+
137
+
$ make
138
+
139
+
The binary will be placed into the build directory.
140
+
141
+
### Deploying self build image
142
+
143
+
The fastest way to run your docker image locally is to reuse the docker from minikube.
144
+
The following steps will get you the docker image built and deployed.
$ sed -e "s/\(image\:.*\:\).*$/\1$TAG/" manifests/postgres-operator.yaml|kubectl --context minikube create -f -
150
+
156
151
### Debugging the operator itself
157
152
158
153
There is a web interface in the operator to observe its internal state. The operator listens on port 8080. It is possible to expose it to the localhost:8080 by doing:
159
154
160
155
$ kubectl --context minikube port-forward $(kubectl --context minikube get pod -l name=postgres-operator -o jsonpath={.items..metadata.name}) 8080:8080
161
-
156
+
162
157
The inner 'query' gets the name of the postgres operator pod, and the outer enables port forwarding. Afterwards, you can access the operator API with:
163
158
164
159
$ curl http://127.0.0.1:8080/$endpoint| jq .
165
160
166
-
The available endpoints are listed below. Note that the worker ID is an integer from 0 up to 'workers' - 1 (value configured in the operator configuration and defaults to 4)
161
+
The available endpoints are listed below. Note that the worker ID is an integer from 0 up to 'workers' - 1 (value configured in the operator configuration and defaults to 4)
167
162
168
163
* /workers/all/queue - state of the workers queue (cluster events to process)
169
164
* /workers/$id/queue - state of the queue for the worker $id
@@ -181,5 +176,3 @@ The operator also supports pprof endpoints listed at the [pprof package](https:/
0 commit comments