Skip to content

Commit

Permalink
Add Kubernetes manifest examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dghubble committed Aug 24, 2020
1 parent 80383c2 commit b3346c5
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ storage:
Apply the `fleetlock` Deployment, Service (with ClusterIP), and ServiceAccount.

```
kubectl apply -f examples/
kubectl apply -f examples/k8s
```
Inspect the fleetlock Lease object.
Expand Down
36 changes: 36 additions & 0 deletions examples/k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: fleetlock
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
name: fleetlock
template:
metadata:
labels:
name: fleetlock
spec:
serviceAccountName: fleetlock
containers:
- name: fleetlock
image: quay.io/poseidon/fleetlock:v0.1.0
ports:
- name: http
containerPort: 8080
resources:
requests:
cpu: 30m
memory: 30Mi
limits:
cpu: 50m
memory: 50Mi
livenessProbe:
httpGet:
scheme: HTTP
port: 8080
path: /-/healthy

14 changes: 14 additions & 0 deletions examples/k8s/role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: fleetlock
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: fleetlock
subjects:
- kind: ServiceAccount
name: fleetlock
namespace: default

14 changes: 14 additions & 0 deletions examples/k8s/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: fleetlock
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- update

6 changes: 6 additions & 0 deletions examples/k8s/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: fleetlock
namespace: default

15 changes: 15 additions & 0 deletions examples/k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: fleetlock
spec:
type: ClusterIP
clusterIP: 10.3.0.15
selector:
name: fleetlock
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080

0 comments on commit b3346c5

Please sign in to comment.