51 lines
1.9 KiB
YAML
51 lines
1.9 KiB
YAML
apiVersion: apps/v1 # API version
|
|
kind: Deployment # Type of kubernetes resource
|
|
metadata:
|
|
name: ruoyi-monitor # Name of the kubernetes resource
|
|
namespace: kube-ruoyi
|
|
labels: # Labels that will be applied to this resource
|
|
app: ruoyi-monitor
|
|
spec:
|
|
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
selector:
|
|
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
app: ruoyi-monitor
|
|
template: # Template for creating the pods in this deployment
|
|
metadata:
|
|
labels: # Labels that will be applied to each Pod in this deployment
|
|
app: ruoyi-monitor
|
|
spec: # Spec for the containers that will be run in the Pods
|
|
containers:
|
|
- name: ruoyi-monitor-server
|
|
image: ruoyi-visual-monitor:3.6.2
|
|
ports:
|
|
- name: http
|
|
containerPort: 9100 # The port that the container exposes
|
|
env: # Environment variables supplied to the Pod
|
|
- name: SPRING_PROFILES_ACTIVE
|
|
value: k8s
|
|
- name: SERVER_NAME
|
|
value: ruoyi-monitor
|
|
- name: NACOS_SERVER
|
|
value: ruoyi-nacos # nacos svc name
|
|
- name: NACOS_PORT
|
|
value: "8848"
|
|
- name: NACOS_SHARED_CONFIGS
|
|
value: application-dev.yml
|
|
---
|
|
apiVersion: v1 # API version
|
|
kind: Service # Type of the kubernetes resource
|
|
metadata:
|
|
name: ruoyi-monitor # Name of the kubernetes resource
|
|
labels: # Labels that will be applied to this resource
|
|
app: ruoyi-monitor
|
|
namespace: kube-ruoyi
|
|
spec:
|
|
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
selector:
|
|
app: ruoyi-monitor # The service exposes Pods with label `app=ruoyi-monitor`
|
|
ports: # Forward incoming connections on port 9100 to the target port 9100
|
|
- name: http
|
|
port: 9100
|
|
targetPort: 9100
|