152 lines
2.8 KiB
YAML
152 lines
2.8 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: dashy
|
|
---
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: dashy-sa
|
|
namespace: dashy
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: dashy-config
|
|
namespace: dashy
|
|
data:
|
|
config.yaml: |
|
|
appConfig:
|
|
title: "Mngoma"
|
|
description: "Welcome to mngoma lab, click where you may"
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: dashy-role
|
|
namespace: dashy
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["pods", "services", "endpoints", "configmaps"]
|
|
verbs: ["get", "list", "watch"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: dashy-rolebinding
|
|
namespace: dashy
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: dashy-sa
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: Role
|
|
name: dashy-role
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolume
|
|
metadata:
|
|
name: dashy-pv
|
|
labels:
|
|
type: local
|
|
spec:
|
|
capacity:
|
|
storage: 1Gi
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-pvs
|
|
local:
|
|
path: /home/ansible/k3s/makhiwane/dashy
|
|
nodeAffinity:
|
|
required:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: kubernetes.io/hostname
|
|
operator: In
|
|
values:
|
|
- lead
|
|
persistentVolumeReclaimPolicy: Retain
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: dashy-pvc
|
|
namespace: dashy
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-pvs
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: dashy
|
|
namespace: dashy
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: dashy
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: dashy
|
|
spec:
|
|
serviceAccountName: dashy-sa
|
|
containers:
|
|
- name: dashy
|
|
image: lissy93/dashy:latest
|
|
ports:
|
|
- containerPort: 8080
|
|
volumeMounts:
|
|
- name: dashy-data
|
|
mountPath: /app/public
|
|
- name: dashy-config
|
|
mountPath: /app/public/conf.yml
|
|
subPath: config.yaml
|
|
volumes:
|
|
- name: dashy-data
|
|
persistentVolumeClaim:
|
|
claimName: dashy-pvc
|
|
- name: dashy-config
|
|
configMap:
|
|
name: dashy-config
|
|
items:
|
|
- key: config.yaml
|
|
path: config.yaml
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: dashy
|
|
namespace: dashy
|
|
spec:
|
|
type: ClusterIP
|
|
selector:
|
|
app: dashy
|
|
ports:
|
|
- name: web
|
|
protocol: TCP
|
|
port: 80
|
|
targetPort: 8080
|
|
---
|
|
apiVersion: traefik.io/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
name: dashy-web
|
|
namespace: dashy
|
|
spec:
|
|
entryPoints:
|
|
- websecure
|
|
routes:
|
|
- match: Host(`dashboard.apps.mngoma.lab`)
|
|
kind: Rule
|
|
services:
|
|
- name: dashy
|
|
port: 80
|
|
scheme: http
|
|
tls: {} |