-
Notifications
You must be signed in to change notification settings - Fork 0
/
operator-namespaced.yaml
107 lines (103 loc) · 2.23 KB
/
operator-namespaced.yaml
1
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This YAML file lists all *namespaced* objects that the operator
# needs to do its job when running inside the cluster.
#
# 💡 The namespace is always `wordpress-test`. Substitute it (as the
# OLM controller does) if you want to run the operator in another
# namespace.
#
# See also `opeator-non-namespaced.yaml`
---
# ServiceAccount/wp-operator
apiVersion: v1
kind: ServiceAccount
metadata:
name: wp-operator
namespace: wordpress-test
automountServiceAccountToken: false
---
# RoleBinding/wp-operator
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: wp-operator
namespace: wordpress-test
subjects:
- kind: ServiceAccount
name: wp-operator
namespace: wordpress-test
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: wp-operator
---
# Role/wp-operator
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: wp-operator
namespace: wordpress-test
rules:
- apiGroups: ['wordpress.epfl.ch']
resources:
- wordpresssites
- wordpresssites/status
verbs: ['*']
- apiGroups: ['networking.k8s.io']
resources:
- ingresses
verbs: ['*']
- apiGroups: ['']
resources:
- events
verbs: ['create', 'patch']
- apiGroups: ['k8s.mariadb.com']
resources:
- backups
- connections
- databases
- grants
- mariadbs
- restores
- sqljobs
- users
verbs: ['*']
- apiGroups: ['']
resources:
- secrets
verbs: ['*']
- apiGroups: ['']
resources: ['configmaps']
verbs: ['*']
---
# Deployment/wp-operator
apiVersion: apps/v1
kind: Deployment
metadata:
name: wp-operator
namespace: wordpress-test
spec:
replicas: 1
selector:
matchLabels:
app: wp-operator
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: wp-operator
spec:
serviceAccountName: wp-operator
automountServiceAccountToken: true
containers:
- name: wp-operator
image: quay-its.epfl.ch/svc0041/wp-operator:latest
args:
- --namespace=wordpress-test
- --
- --db-host
- mariadb-min.wordpress-test.svc
- --wp-dir=/wp/6
imagePullSecrets:
- name: svc0041-rke2-puller-pull-secret
restartPolicy: Always