Skip to content

Commit b51d69d

Browse files
author
Jeff McCormick
committed
update build doc to position namespace creation in a better sequence
1 parent ffab34c commit b51d69d

File tree

1 file changed

+47
-48
lines changed

1 file changed

+47
-48
lines changed

docs/build.asciidoc

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -59,61 +59,13 @@ Kubernetes installation methods have been known to work as well.
5959
link:https://kubernetes.io/docs/setup/independent/install-kubeadm/[Installing kubeadm - Official Kubernetes Documentation]
6060

6161

62-
=== Create Namespace
63-
64-
This example is based on a kubeadm installation with the admin
65-
user being already created. The example below assumes the cluster name is *kubernetes* and the cluster default user is *kubernetes-admin*.
66-
....
67-
kubectl create -f $COROOT/examples/demo-namespace.json
68-
kubectl get namespaces
69-
....
70-
7162
On kubeadm, you'll need to let non-root users have access to the
7263
kubeconfig admin directory and files as follows:
7364
....
7465
sudo chmod o+rwx /etc/kubernetes/
7566
sudo chmod o+rwx /etc/kubernetes/admin.conf
7667
....
7768

78-
then set your context to the new demo namespace
79-
....
80-
kubectl config set-context demo --namespace=demo --cluster=kubernetes --user=kubernetes-admin
81-
kubectl config use-context demo
82-
kubectl config current-context
83-
....
84-
85-
Add a cluster role binding to allow the new namespace default service
86-
account permissions to run the postgres-operator and create
87-
the Custom Resource Definitions:
88-
89-
....
90-
kubectl create clusterrolebinding serviceaccounts-cluster-admin \
91-
--clusterrole=cluster-admin \
92-
--group=system:serviceaccounts
93-
....
94-
95-
*WARNING*: the above RBAC command is very permissive, adjust this
96-
to a scope that you require for your environment.
97-
98-
See link:https://kubernetes.io/docs/admin/authorization/rbac/[here] for more
99-
details on how to enable RBAC roles and modify the scope of the permissions
100-
to suit your needs.
101-
102-
There are 2 places you will need to update to specify your
103-
namespace:
104-
105-
In the operator configuration file, $COROOT/conf/apiserver/pgo.yaml, you will add
106-
the *demo* value for the *Namespace*:
107-
....
108-
Namespace: demo
109-
....
110-
111-
likewise, specify your *CO_NAMESPACE* environment variable will specify *demo*;
112-
113-
....
114-
export CO_NAMESPACE=demo
115-
....
116-
11769
== Installation
11870

11971
=== Create Project and Clone
@@ -223,6 +175,53 @@ make all
223175
which pgo
224176
....
225177

178+
=== Create Namespace
179+
180+
This example is based on a kubeadm installation with the admin
181+
user being already created. The example below assumes the cluster name is *kubernetes* and the cluster default user is *kubernetes-admin*.
182+
....
183+
kubectl create -f $COROOT/examples/demo-namespace.json
184+
kubectl get namespaces
185+
....
186+
then set your context to the new demo namespace
187+
....
188+
kubectl config set-context demo --namespace=demo --cluster=kubernetes --user=kubernetes-admin
189+
kubectl config use-context demo
190+
kubectl config current-context
191+
....
192+
193+
Add a cluster role binding to allow the new namespace default service
194+
account permissions to run the postgres-operator and create
195+
the Custom Resource Definitions:
196+
197+
....
198+
kubectl create clusterrolebinding serviceaccounts-cluster-admin \
199+
--clusterrole=cluster-admin \
200+
--group=system:serviceaccounts
201+
....
202+
203+
*WARNING*: the above RBAC command is very permissive, adjust this
204+
to a scope that you require for your environment.
205+
206+
See link:https://kubernetes.io/docs/admin/authorization/rbac/[here] for more
207+
details on how to enable RBAC roles and modify the scope of the permissions
208+
to suit your needs.
209+
210+
There are 2 places you will need to update to specify your
211+
namespace:
212+
213+
In the operator configuration file, $COROOT/conf/apiserver/pgo.yaml, you will add
214+
the *demo* value for the *Namespace*:
215+
....
216+
Namespace: demo
217+
....
218+
219+
likewise, specify your *CO_NAMESPACE* environment variable will specify *demo*;
220+
221+
....
222+
export CO_NAMESPACE=demo
223+
....
224+
226225
=== Configure Persistent Storage
227226

228227
The default Operator configuration is defined to use a HostPath

0 commit comments

Comments
 (0)