update(app): add examples and README file

This commit is contained in:
Aleksandr Tcitlionok
2024-12-05 03:06:01 +00:00
parent e2076c1b54
commit aa17c7a2dc
4 changed files with 160 additions and 2 deletions

View File

@@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: metalcheck-backend
labels:
app: metalcheck
spec:
replicas: 1
selector:
matchLabels:
app: metalcheck
template:
metadata:
labels:
app: metalcheck
spec:
containers:
- name: backend
image: <your-ecr-repo>:latest
ports:
- containerPort: 8000
env:
- name: KUBERNETES_SERVICE_HOST
value: "kubernetes.default"
- name: KUBERNETES_SERVICE_PORT
value: "443"
---
apiVersion: v1
kind: Service
metadata:
name: metalcheck-backend
spec:
selector:
app: metalcheck
ports:
- protocol: TCP
port: 80
targetPort: 8000
type: LoadBalancer

29
examples/k8s/rbac.yaml Normal file
View File

@@ -0,0 +1,29 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: metalcheck-sa
namespace: metalcheck
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: metalcheck
name: metalcheck-role
rules:
- apiGroups: [""]
resources: ["pods", "nodes", "namespaces"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: metalcheck-rolebinding
namespace: metalcheck
subjects:
- kind: ServiceAccount
name: metalcheck-sa
namespace: metalcheck
roleRef:
kind: Role
name: metalcheck-role
apiGroup: rbac.authorization.k8s.io