Skip to content

Commit

Permalink
Deploy files for the two controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Sun <[email protected]>
  • Loading branch information
marshtompsxd committed Jul 28, 2024
1 parent 0b50a79 commit abb6127
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deploy/consumer/consumer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: anvil.dev/v1
kind: Consumer
metadata:
name: consumer
spec:
message: consumer-message
34 changes: 34 additions & 0 deletions deploy/consumer/crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: consumers.anvil.dev
spec:
group: anvil.dev
names:
categories: []
kind: Consumer
plural: consumers
shortNames: []
singular: consumer
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ConsumerSpec via `CustomResource`
properties:
spec:
properties:
message:
type: string
required:
- message
type: object
required:
- spec
title: Consumer
type: object
served: true
storage: true
subresources: {}
22 changes: 22 additions & 0 deletions deploy/consumer/deploy_local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: consumer-controller
namespace: consumer
labels:
app.kubernetes.io/name: consumer-controller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: consumer-controller
template:
metadata:
labels:
app.kubernetes.io/name: consumer-controller
spec:
containers:
- image: local/consumer-controller:v0.1.0
imagePullPolicy: IfNotPresent
name: controller
serviceAccountName: consumer-controller
47 changes: 47 additions & 0 deletions deploy/consumer/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/name: consumer
name: consumer
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: consumer-controller
namespace: consumer
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: consumer-controller
name: consumer-controller-role
rules:
- apiGroups:
- anvil.dev
resources:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- pods
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: consumer-controller
name: consumer-controller-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: consumer-controller-role
subjects:
- kind: ServiceAccount
name: consumer-controller
namespace: consumer
34 changes: 34 additions & 0 deletions deploy/producer/crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: producers.anvil.dev
spec:
group: anvil.dev
names:
categories: []
kind: Producer
plural: producers
shortNames: []
singular: producer
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ProducerSpec via `CustomResource`
properties:
spec:
properties:
message:
type: string
required:
- message
type: object
required:
- spec
title: Producer
type: object
served: true
storage: true
subresources: {}
22 changes: 22 additions & 0 deletions deploy/producer/deploy_local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: producer-controller
namespace: producer
labels:
app.kubernetes.io/name: producer-controller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: producer-controller
template:
metadata:
labels:
app.kubernetes.io/name: producer-controller
spec:
containers:
- image: local/producer-controller:v0.1.0
imagePullPolicy: IfNotPresent
name: controller
serviceAccountName: producer-controller
6 changes: 6 additions & 0 deletions deploy/producer/producer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: anvil.dev/v1
kind: Producer
metadata:
name: producer
spec:
message: producer-message
47 changes: 47 additions & 0 deletions deploy/producer/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/name: producer
name: producer
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: producer-controller
namespace: producer
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: producer-controller
name: producer-controller-role
rules:
- apiGroups:
- anvil.dev
resources:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- pods
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: producer-controller
name: producer-controller-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: producer-controller-role
subjects:
- kind: ServiceAccount
name: producer-controller
namespace: producer

0 comments on commit abb6127

Please sign in to comment.