Skip to content

Commit 205c1b7

Browse files
committed
Update kubectl Installer for NS Mode & Doc Change
Added a NAMESPACE_MODE environment variable to the kubectl installer. This env var configures the 'namespace_mode' variable in the Ansible installer, therefore determining which Cluster Roles are installed to enable the desired namespace functionality. Also includes an update to the headers describing the various namespace modes in the namespace documentation.
1 parent ad2cac1 commit 205c1b7

File tree

7 files changed

+28
-4
lines changed

7 files changed

+28
-4
lines changed

docs/content/architecture/namespace.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ enabled for the Operator installation. Please consult the installation guides f
107107
installation methods available to determine the settings required to install the `ClusterRoles`
108108
required for each mode.
109109

110-
### dynamic
110+
### `dynamic`
111111

112112
Enables full dynamic namespace capabilities, in which the Operator can create, delete and update
113113
any namespaces within the Kubernetes cluster, while then also having the ability to create the
@@ -167,7 +167,7 @@ rules:
167167
- delete
168168
```
169169
170-
### readonly
170+
### `readonly`
171171

172172
In this mode the PostgreSQL Operator is still able to listen for namespace events within the
173173
Kubernetetes cluster, and then create and run and/or remove controllers as namespaces are added,
@@ -194,7 +194,7 @@ rules:
194194
- watch
195195
```
196196

197-
### disabled
197+
### `disabled`
198198

199199
Disables namespace capabilities within the Operator altogether. While in this mode the Operator
200200
will simply attempt to work with the target namespaces specified during installation. If no

installers/ansible/inventory

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ create_rbac='true'
9595
# them. And finally "disabled" prevents the creation of any Cluster Roles,
9696
# and therefore disables all namespace functionality.
9797
# ==================
98-
# namespace_mode='disabled'
98+
# namespace_mode='dynamic'
9999

100100
# ===================
101101
# PGO Client Container Settings

installers/image/inventory_template

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ kubernetes_in_cluster='$KUBERNETES_IN_CLUSTER'
1818
# ==================
1919
create_rbac='$CREATE_RBAC'
2020

21+
# Namespace Mode
22+
# ==================
23+
# Note: this setting is only applicable if 'create_rbac=true'.
24+
#
25+
# When installing RBAC using 'create_rbac', the namespace mode determines
26+
# what Cluster Roles are installed. The default mode if a value is not
27+
# specified here is "dynamic", which gives the Operator the full set of
28+
# Cluster Roles to create/modify/delete namespaces, and also install RBAC
29+
# within those namespaces in order to create PG clusters. A value of
30+
# "readonly" can also be specified, which allows the Operator to view
31+
# namespaces, but not create/modify/delete them nor create RBAC within
32+
# them. And finally "disabled" prevents the creation of any Cluster Roles,
33+
# and therefore disables all namespace functionality.
34+
# ==================
35+
namespace_mode='$NAMESPACE_MODE'
36+
2137
# ===================
2238
# PGO Client Container Settings
2339
# The following settings configure the deployment of a PGO Client Container

installers/method/kubectl/full_options

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ value: "false"
88
value: "true"
99
- name: CREATE_RBAC
1010
value: "true"
11+
- name: NAMESPACE_MODE
12+
value: "dynamic"
1113
- name: PGO_INSTALLATION_NAME
1214
value: "devtest"
1315
- name: PGO_ADMIN_USERNAME

installers/method/kubectl/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ spec:
5353
value: "true"
5454
- name: CREATE_RBAC
5555
value: "true"
56+
- name: NAMESPACE_MODE
57+
value: "dynamic"
5658
- name: PGO_INSTALLATION_NAME
5759
value: "devtest"
5860
- name: PGO_ADMIN_USERNAME

installers/method/kubectl/uninstall.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ spec:
5353
value: "true"
5454
- name: CREATE_RBAC
5555
value: "true"
56+
- name: NAMESPACE_MODE
57+
value: "dynamic"
5658
- name: PGO_INSTALLATION_NAME
5759
value: "devtest"
5860
- name: PGO_ADMIN_USERNAME

installers/method/kubectl/update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ spec:
5353
value: "true"
5454
- name: CREATE_RBAC
5555
value: "true"
56+
- name: NAMESPACE_MODE
57+
value: "dynamic"
5658
- name: PGO_INSTALLATION_NAME
5759
value: "devtest"
5860
- name: PGO_ADMIN_USERNAME

0 commit comments

Comments
 (0)