Initial commit
Some checks failed
Tests / Run on Ubuntu (push) Has been cancelled
E2E Tests / Run on Ubuntu (push) Has been cancelled
Lint / Run on Ubuntu (push) Failing after 23m29s

This commit is contained in:
Jonas Kaninda
2024-11-27 08:29:51 +01:00
commit 59e2f0164b
73 changed files with 8334 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# permissions for end users to edit gateways.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: gateway-editor-role
rules:
- apiGroups:
- gomaproj.github.io
resources:
- gateways
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gomaproj.github.io
resources:
- gateways/status
verbs:
- get

View File

@@ -0,0 +1,23 @@
# permissions for end users to view gateways.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: gateway-viewer-role
rules:
- apiGroups:
- gomaproj.github.io
resources:
- gateways
verbs:
- get
- list
- watch
- apiGroups:
- gomaproj.github.io
resources:
- gateways/status
verbs:
- get

View File

@@ -0,0 +1,31 @@
resources:
# All RBAC will be applied under this service account in
# the deployment namespace. You may comment out this resource
# if your manager will use a service account that exists at
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
# subjects if changing service account names.
- service_account.yaml
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# The following RBAC configurations are used to protect
# the metrics endpoint with authn/authz. These configurations
# ensure that only authorized users and service accounts
# can access the metrics endpoint. Comment the following
# permissions if you want to disable this protection.
# More info: https://book.kubebuilder.io/reference/metrics.html
- metrics_auth_role.yaml
- metrics_auth_role_binding.yaml
- metrics_reader_role.yaml
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
# default, aiding admins in cluster management. Those roles are
# not used by the Project itself. You can comment the following lines
# if you do not want those helpers be installed with your Project.
- middleware_editor_role.yaml
- middleware_viewer_role.yaml
- route_editor_role.yaml
- route_viewer_role.yaml
- gateway_editor_role.yaml
- gateway_viewer_role.yaml

View File

@@ -0,0 +1,40 @@
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch

View File

@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system

View File

@@ -0,0 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: metrics-auth-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create

View File

@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-auth-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-auth-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system

View File

@@ -0,0 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: metrics-reader
rules:
- nonResourceURLs:
- "/metrics"
verbs:
- get

View File

@@ -0,0 +1,27 @@
# permissions for end users to edit middlewares.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: middleware-editor-role
rules:
- apiGroups:
- gomaproj.github.io
resources:
- middlewares
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gomaproj.github.io
resources:
- middlewares/status
verbs:
- get

View File

@@ -0,0 +1,23 @@
# permissions for end users to view middlewares.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: middleware-viewer-role
rules:
- apiGroups:
- gomaproj.github.io
resources:
- middlewares
verbs:
- get
- list
- watch
- apiGroups:
- gomaproj.github.io
resources:
- middlewares/status
verbs:
- get

83
config/rbac/role.yaml Normal file
View File

@@ -0,0 +1,83 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: manager-role
rules:
- apiGroups:
- ""
resources:
- configmaps
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gomaproj.github.io
resources:
- gateways
- middlewares
- routes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gomaproj.github.io
resources:
- gateways/finalizers
- middlewares/finalizers
- routes/finalizers
verbs:
- update
- apiGroups:
- gomaproj.github.io
resources:
- gateways/status
- middlewares/status
- routes/status
verbs:
- get
- patch
- update

View File

@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system

View File

@@ -0,0 +1,27 @@
# permissions for end users to edit routes.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: route-editor-role
rules:
- apiGroups:
- gomaproj.github.io
resources:
- routes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gomaproj.github.io
resources:
- routes/status
verbs:
- get

View File

@@ -0,0 +1,23 @@
# permissions for end users to view routes.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: route-viewer-role
rules:
- apiGroups:
- gomaproj.github.io
resources:
- routes
verbs:
- get
- list
- watch
- apiGroups:
- gomaproj.github.io
resources:
- routes/status
verbs:
- get

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: goma-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system