Browse Source

add deployment for service

master
phamduchongan93 8 months ago
parent
commit
8b249072ba
3 changed files with 102 additions and 0 deletions
  1. +13
    -0
      kanico/virtualcard-pvc.yaml
  2. +76
    -0
      kubernetes/hommer-deployment.yml
  3. +13
    -0
      kubernetes/pvc.yml

+ 13
- 0
kanico/virtualcard-pvc.yaml View File

@ -0,0 +1,13 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: virtualporfolio-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
storageClassName: manual
volumeMode: Filesystem
volumeName: virtual-porfolio-pv

+ 76
- 0
kubernetes/hommer-deployment.yml View File

@ -0,0 +1,76 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hommer
labels:
app: hommer
spec:
selector:
matchLabels:
app: hommer
replicas: 1 # You could also consider elastic scaling for this deployment
template:
metadata:
labels:
app: hommer
spec:
containers:
- name: hommer
image: b4bz/homer:v23.09.1
volumeMounts:
- name: assets
mountPath: /www/assets
ports:
- containerPort: 8080
volumes:
- name: assets
persistentVolumeClaim:
claimName: assets-claim
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: assets-claim
namespace: default
spec:
storageClassName: manual
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeName: hommer-pv
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: hommer-pv
labels:
type: local
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: manual
hostPath:
path: "/home/ubuntu/hommer/assets"
---
apiVersion: v1
kind: Service
metadata:
name: hommer-dashboard
spec:
selector:
app: hommer
ports:
- port: 82
targetPort: 8080

+ 13
- 0
kubernetes/pvc.yml View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: task-pv-claim
spec:
storageClassName: manual
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeName: hommer-pv

Loading…
Cancel
Save