Skip to content

Commit abebdcb

Browse files
authored
Merge pull request #8 from appuio/feat/deploy
Add default deployment config
2 parents 6ef96e6 + b9f034d commit abebdcb

File tree

11 files changed

+177
-0
lines changed

11 files changed

+177
-0
lines changed

config/default/kustomization.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Adds namespace to all resources.
2+
namespace: appuio-cloud-agent
3+
4+
# Labels to add to all resources and selectors.
5+
#commonLabels:
6+
# someName: someValue
7+
8+
bases:
9+
- ../rbac
10+
- ../manager

config/manager/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resources:
2+
- manager.yaml
3+
4+
generatorOptions:
5+
disableNameSuffixHash: true

config/manager/manager.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: appuio-cloud-agent
5+
namespace: appuio-cloud-agent
6+
labels:
7+
control-plane: appuio-cloud-agent
8+
spec:
9+
selector:
10+
matchLabels:
11+
control-plane: appuio-cloud-agent
12+
replicas: 3
13+
template:
14+
metadata:
15+
annotations:
16+
kubectl.kubernetes.io/default-container: agent
17+
labels:
18+
control-plane: appuio-cloud-agent
19+
spec:
20+
containers:
21+
- command:
22+
- appuio-cloud-agent
23+
args:
24+
- --leader-elect
25+
image: ghcr.io/appuio/appuio-cloud-agent:latest
26+
ports:
27+
- containerPort: 9443
28+
name: agent
29+
securityContext:
30+
allowPrivilegeEscalation: false
31+
livenessProbe:
32+
httpGet:
33+
path: /healthz
34+
port: 8082
35+
initialDelaySeconds: 15
36+
periodSeconds: 20
37+
readinessProbe:
38+
httpGet:
39+
path: /readyz
40+
port: 8082
41+
initialDelaySeconds: 5
42+
periodSeconds: 10
43+
resources:
44+
limits:
45+
cpu: 500m
46+
memory: 256Mi
47+
requests:
48+
cpu: 10m
49+
memory: 128Mi
50+
serviceAccountName: appuio-cloud-agent
51+
terminationGracePeriodSeconds: 10

config/manager/namespace.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
labels:
5+
control-plane: appuio-cloud-agent
6+
name: appuio-cloud-agent
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# permissions to do leader election.
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: appuio-cloud-agent:leader-election-role
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- configmaps
11+
verbs:
12+
- get
13+
- list
14+
- watch
15+
- create
16+
- update
17+
- patch
18+
- delete
19+
- apiGroups:
20+
- coordination.k8s.io
21+
resources:
22+
- leases
23+
verbs:
24+
- get
25+
- list
26+
- watch
27+
- create
28+
- update
29+
- patch
30+
- delete
31+
- apiGroups:
32+
- ""
33+
resources:
34+
- events
35+
verbs:
36+
- create
37+
- patch
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: appuio-cloud-agent:leader-election-rolebinding
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: Role
8+
name: appuio-cloud-agent:leader-election-role
9+
subjects:
10+
- kind: ServiceAccount
11+
name: appuio-cloud-agent
12+
namespace: appuio-cloud-agent

config/rbac/role_binding.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: manager-rolebinding
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: appuio-cloud-agent
9+
subjects:
10+
- kind: ServiceAccount
11+
name: appuio-cloud-agent
12+
namespace: appuio-cloud-agent

config/rbac/service_account.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: appuio-cloud-agent
5+
namespace: appuio-cloud-agent

config/webhook/kustomization.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace: appuio-cloud-agent
2+
3+
resources:
4+
- manifests.yaml
5+
- service.yaml
6+
7+
configurations:
8+
- kustomizeconfig.yaml
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# the following config is for teaching kustomize where to look at when substituting vars.
2+
# It requires kustomize v2.1.0 or newer to work properly.
3+
nameReference:
4+
- kind: Service
5+
version: v1
6+
fieldSpecs:
7+
- kind: ValidatingWebhookConfiguration
8+
group: admissionregistration.k8s.io
9+
path: webhooks/clientConfig/service/name
10+
11+
namespace:
12+
- kind: ValidatingWebhookConfiguration
13+
group: admissionregistration.k8s.io
14+
path: webhooks/clientConfig/service/namespace
15+
create: true
16+
17+
varReference:
18+
- path: metadata/annotations

0 commit comments

Comments
 (0)