Skip to content

Commit

Permalink
k8s manifests for testing and development
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimti committed Aug 17, 2021
1 parent f98e7b2 commit b77599d
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 0 deletions.
File renamed without changes.
36 changes: 36 additions & 0 deletions k8s-test/00-deployment/01-rbac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: volm
namespace: volm-test
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: volm
namespace: volm-test
rules:
- apiGroups:
- ""
resources:
- pods
- persistentvolumeclaims
verbs:
- watch
- get
- list
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: volm
namespace: volm-test
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: volm
subjects:
- kind: ServiceAccount
name: volm
namespace: volm-test
17 changes: 17 additions & 0 deletions k8s-test/00-deployment/10-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: volm
namespace: volm-test
labels:
app: volm
component: api
spec:
selector:
app: volm
ports:
- name: http-int
protocol: "TCP"
port: 8070
targetPort: http-int
type: ClusterIP
69 changes: 69 additions & 0 deletions k8s-test/00-deployment/30-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: volm
namespace: volm-test
labels:
app: volm
component: api
spec:
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
app: volm
template:
metadata:
labels:
app: volm
component: api
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '2112'
spec:
serviceAccountName: api-volm
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- volm
topologyKey: kubernetes.io/hostname
containers:
- name: volm
image: txn2/volm:v0.1.1
imagePullPolicy: IfNotPresent
env:
- name: IP
value: "0.0.0.0"
- name: PORT
value: "8070"
- name: MODE
value: "release" # "release" for prod
- name: PVC_NAMESPACE
value: "volm-test"
- name: PVC_SELECTOR
value: "pvci.txn2.com/service=pvci"
ports:
- name: http-int
containerPort: 8070
- name: http-mtx
containerPort: 2112
startupProbe:
httpGet:
path: /
port: http-int
failureThreshold: 3
periodSeconds: 5
resources:
requests:
cpu: ".2"
memory: 256Mi
limits:
cpu: "1"
memory: 1Gi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b77599d

Please sign in to comment.