diff --git a/README.md b/README.md index 62a88e7..55aa741 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/examples/k8s/deployment.yaml b/examples/k8s/deployment.yaml new file mode 100644 index 0000000..67d3265 --- /dev/null +++ b/examples/k8s/deployment.yaml @@ -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 + diff --git a/examples/k8s/role-binding.yaml b/examples/k8s/role-binding.yaml new file mode 100644 index 0000000..989881d --- /dev/null +++ b/examples/k8s/role-binding.yaml @@ -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 + diff --git a/examples/k8s/role.yaml b/examples/k8s/role.yaml new file mode 100644 index 0000000..283d25e --- /dev/null +++ b/examples/k8s/role.yaml @@ -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 + diff --git a/examples/k8s/service-account.yaml b/examples/k8s/service-account.yaml new file mode 100644 index 0000000..df13c07 --- /dev/null +++ b/examples/k8s/service-account.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: fleetlock + namespace: default + diff --git a/examples/k8s/service.yaml b/examples/k8s/service.yaml new file mode 100644 index 0000000..36efa53 --- /dev/null +++ b/examples/k8s/service.yaml @@ -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 +