Skip to content

Commit

Permalink
Merge pull request #8 from appuio/feat/deploy
Browse files Browse the repository at this point in the history
Add default deployment config
  • Loading branch information
glrf authored Apr 7, 2022
2 parents 6ef96e6 + b9f034d commit abebdcb
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Adds namespace to all resources.
namespace: appuio-cloud-agent

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue

bases:
- ../rbac
- ../manager
5 changes: 5 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- manager.yaml

generatorOptions:
disableNameSuffixHash: true
51 changes: 51 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: appuio-cloud-agent
namespace: appuio-cloud-agent
labels:
control-plane: appuio-cloud-agent
spec:
selector:
matchLabels:
control-plane: appuio-cloud-agent
replicas: 3
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: agent
labels:
control-plane: appuio-cloud-agent
spec:
containers:
- command:
- appuio-cloud-agent
args:
- --leader-elect
image: ghcr.io/appuio/appuio-cloud-agent:latest
ports:
- containerPort: 9443
name: agent
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: 8082
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8082
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 10m
memory: 128Mi
serviceAccountName: appuio-cloud-agent
terminationGracePeriodSeconds: 10
6 changes: 6 additions & 0 deletions config/manager/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: appuio-cloud-agent
name: appuio-cloud-agent
37 changes: 37 additions & 0 deletions config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: appuio-cloud-agent: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
12 changes: 12 additions & 0 deletions config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: appuio-cloud-agent:leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: appuio-cloud-agent:leader-election-role
subjects:
- kind: ServiceAccount
name: appuio-cloud-agent
namespace: appuio-cloud-agent
12 changes: 12 additions & 0 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: appuio-cloud-agent
subjects:
- kind: ServiceAccount
name: appuio-cloud-agent
namespace: appuio-cloud-agent
5 changes: 5 additions & 0 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: appuio-cloud-agent
namespace: appuio-cloud-agent
8 changes: 8 additions & 0 deletions config/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace: appuio-cloud-agent

resources:
- manifests.yaml
- service.yaml

configurations:
- kustomizeconfig.yaml
18 changes: 18 additions & 0 deletions config/webhook/kustomizeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# the following config is for teaching kustomize where to look at when substituting vars.
# It requires kustomize v2.1.0 or newer to work properly.
nameReference:
- kind: Service
version: v1
fieldSpecs:
- kind: ValidatingWebhookConfiguration
group: admissionregistration.k8s.io
path: webhooks/clientConfig/service/name

namespace:
- kind: ValidatingWebhookConfiguration
group: admissionregistration.k8s.io
path: webhooks/clientConfig/service/namespace
create: true

varReference:
- path: metadata/annotations
13 changes: 13 additions & 0 deletions config/webhook/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

apiVersion: v1
kind: Service
metadata:
name: webhook-service
namespace: appuio-cloud-agent
spec:
ports:
- port: 443
protocol: TCP
targetPort: 9443
selector:
control-plane: appuio-cloud-agent

0 comments on commit abebdcb

Please sign in to comment.