Skip to content

Commit dd08635

Browse files
committed
Add Kustomize and Helm based installers
1 parent 20a5bc3 commit dd08635

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+19203
-0
lines changed

Diff for: helm/install/Chart.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v3
2+
name: postgres-operator
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.0
6+
appVersion: 5.0.0

Diff for: helm/install/crds/postgres-operator.crunchydata.com_postgresclusters.yaml

+4,583
Large diffs are not rendered by default.

Diff for: helm/install/templates/NOTES.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Thank you for deploying PGO v{{ .Chart.AppVersion }}!
2+
3+
((((((((((((((((((((((
4+
(((((((((((((%%%%%%%(((((((((((((((
5+
(((((((((((%%% %%%%((((((((((((
6+
(((((((((((%%( (((( ( %%%(((((((((((
7+
(((((((((((((%% (( ,(( %%%(((((((((((
8+
(((((((((((((((%% *%%/ %%%%%%%((((((((((
9+
(((((((((((((((((((%%(( %%%%%%%%%%#(((((%%%%%%%%%%#((((((((((((
10+
((((((((((((((((((%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%((((((((((((((
11+
*((((((((((((((((((((%%%%%% /%%%%%%%%%%%%%%%%%%%((((((((((((((((
12+
(((((((((((((((((((((((%%%/ .%, %%%((((((((((((((((((,
13+
((((((((((((((((((((((% %#(((((((((((((((((
14+
(((((((((((((((%%%%%% #%(((((((((((((((((
15+
((((((((((((((%% %%(((((((((((((((,
16+
((((((((((((%%%#% % %%(((((((((((((((
17+
((((((((((((%. % % #((((((((((((((
18+
(((((((((((%% % %%* %(((((((((((((
19+
#(###(###(#%% %%% %% %%% #%%#(###(###(#
20+
###########%%%%% /%%%%%%%%%%%%% %% %%%%% ,%%#######
21+
###############%% %%%%%% %%% %%%%%%%% %%#####
22+
################%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %%##
23+
################%% %%%%%%%%%%%%%%%%% %%%% %
24+
##############%# %% (%%%%%%% %%%%%%
25+
#############% %%%%% %%%%%%%%%%%
26+
###########% %%%%%%%%%%% %%%%%%%%%
27+
#########%% %% %%%%%%%%%%%%%%%#
28+
########%% %% %%%%%%%%%
29+
######%% %% %%%%%%
30+
####%%% %%%%% %
31+
%% %%%%

Diff for: helm/install/templates/_helpers.tpl

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{{/*
2+
Create chart name and version as used by the chart label.
3+
*/}}
4+
{{- define "install.chart" -}}
5+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Crunchy labels
10+
*/}}
11+
{{- define "install.crunchyLabels" -}}
12+
postgres-operator.crunchydata.com/control-plane: {{ .Chart.Name }}
13+
{{- end }}
14+
15+
{{/*
16+
Common labels
17+
*/}}
18+
{{- define "install.labels" -}}
19+
helm.sh/chart: {{ include "install.chart" . }}
20+
{{ include "install.selectorLabels" . }}
21+
{{- if .Chart.AppVersion }}
22+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
23+
{{- end }}
24+
app.kubernetes.io/managed-by: {{ .Release.Service }}
25+
{{ include "install.crunchyLabels" .}}
26+
{{- end }}
27+
28+
{{/*
29+
Selector labels
30+
*/}}
31+
{{- define "install.selectorLabels" -}}
32+
app.kubernetes.io/name: {{ .Chart.Name }}
33+
app.kubernetes.io/instance: {{ .Release.Name }}
34+
{{ include "install.crunchyLabels" .}}
35+
{{- end }}
36+
37+
{{/*
38+
Create the name of the service account to use
39+
*/}}
40+
{{- define "install.serviceAccountName" -}}
41+
{{ .Chart.Name }}
42+
{{- end }}
43+
44+
{{/*
45+
Create the name of the Role/ClusterRole to use
46+
*/}}
47+
{{- define "install.roleName" -}}
48+
{{ .Chart.Name }}
49+
{{- end }}
50+
51+
{{/*
52+
Create the name of the RoleBinding/ClusterRoleBinding to use
53+
*/}}
54+
{{- define "install.roleBindingName" -}}
55+
{{ .Chart.Name }}
56+
{{- end }}
57+
58+
{{/*
59+
Create the kind for rolebindings. Will be RoleBinding in single
60+
namespace mode or ClusterRoleBinding by default.
61+
*/}}
62+
{{- define "install.roleBindingKind" -}}
63+
{{- if .Values.singleNamespace -}}
64+
RoleBinding
65+
{{- else -}}
66+
ClusterRoleBinding
67+
{{- end }}
68+
{{- end }}
69+
70+
{{/*
71+
Create the kind for role. Will be Role in single
72+
namespace mode or ClusterRole by default.
73+
*/}}
74+
{{- define "install.roleKind" -}}
75+
{{- if .Values.singleNamespace -}}
76+
Role
77+
{{- else -}}
78+
ClusterRole
79+
{{- end }}
80+
{{- end }}

Diff for: helm/install/templates/manager.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Chart.Name }}
5+
labels:
6+
{{- include "install.labels" . | nindent 4 }}
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
{{- include "install.crunchyLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "install.crunchyLabels" . | nindent 8 }}
16+
spec:
17+
containers:
18+
- name: operator
19+
image: "{{ .Values.image.repository }}/postgres-operator:{{ .Values.image.tag }}"
20+
env:
21+
- name: CRUNCHY_DEBUG
22+
value: "true"
23+
{{- if .Values.singleNamespace }}
24+
- name: PGO_TARGET_NAMESPACE
25+
valueFrom: { fieldRef: { apiVersion: v1, fieldPath: metadata.namespace } }
26+
{{- end }}
27+
serviceAccount: {{ include "install.serviceAccountName" . }}

Diff for: helm/install/templates/role.yaml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: {{ include "install.roleKind" . }}
3+
metadata:
4+
name: {{ include "install.roleName" . }}
5+
labels:
6+
{{- include "install.labels" . | nindent 4 }}
7+
rules:
8+
- apiGroups:
9+
- ''
10+
resources:
11+
- configmaps
12+
- persistentvolumeclaims
13+
- secrets
14+
- services
15+
verbs:
16+
- create
17+
- delete
18+
- get
19+
- list
20+
- patch
21+
- watch
22+
- apiGroups:
23+
- ''
24+
resources:
25+
- endpoints
26+
verbs:
27+
- create
28+
- delete
29+
- deletecollection
30+
- get
31+
- list
32+
- patch
33+
- watch
34+
- apiGroups:
35+
- ''
36+
resources:
37+
- endpoints/restricted
38+
- pods/exec
39+
verbs:
40+
- create
41+
- apiGroups:
42+
- ''
43+
resources:
44+
- events
45+
verbs:
46+
- create
47+
- patch
48+
- apiGroups:
49+
- ''
50+
resources:
51+
- pods
52+
verbs:
53+
- delete
54+
- get
55+
- list
56+
- patch
57+
- watch
58+
- apiGroups:
59+
- ''
60+
resources:
61+
- serviceaccounts
62+
verbs:
63+
- create
64+
- get
65+
- list
66+
- patch
67+
- watch
68+
- apiGroups:
69+
- apps
70+
resources:
71+
- deployments
72+
- statefulsets
73+
verbs:
74+
- create
75+
- delete
76+
- get
77+
- list
78+
- patch
79+
- watch
80+
- apiGroups:
81+
- batch
82+
resources:
83+
- cronjobs
84+
- jobs
85+
verbs:
86+
- create
87+
- delete
88+
- get
89+
- list
90+
- patch
91+
- watch
92+
- apiGroups:
93+
- postgres-operator.crunchydata.com
94+
resources:
95+
- postgresclusters
96+
verbs:
97+
- get
98+
- list
99+
- patch
100+
- watch
101+
- apiGroups:
102+
- postgres-operator.crunchydata.com
103+
resources:
104+
- postgresclusters/finalizers
105+
verbs:
106+
- update
107+
- apiGroups:
108+
- postgres-operator.crunchydata.com
109+
resources:
110+
- postgresclusters/status
111+
verbs:
112+
- patch
113+
- apiGroups:
114+
- rbac.authorization.k8s.io
115+
resources:
116+
- rolebindings
117+
- roles
118+
verbs:
119+
- create
120+
- get
121+
- list
122+
- patch
123+
- watch

Diff for: helm/install/templates/role_binding.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: {{ include "install.roleBindingKind" . }}
3+
metadata:
4+
name: {{ include "install.roleBindingName" . }}
5+
labels:
6+
{{- include "install.labels" . | nindent 4 }}
7+
roleRef:
8+
apiGroup: rbac.authorization.k8s.io
9+
kind: {{ include "install.roleKind" . }}
10+
name: {{ include "install.roleName" . }}
11+
subjects:
12+
- kind: ServiceAccount
13+
name: {{ include "install.serviceAccountName" . }}
14+
namespace: {{ .Release.Namespace }}

Diff for: helm/install/templates/service_account.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{ include "install.serviceAccountName" . }}
5+
labels:
6+
{{- include "install.labels" . | nindent 4 }}

Diff for: helm/install/values.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
## Provide image repository and tag
3+
image:
4+
repository: registry.developers.crunchydata.com/crunchydata
5+
tag: ubi8-5.0.0-0
6+
7+
## Install in default or single namespace mode
8+
singleNamespace: false

0 commit comments

Comments
 (0)