34 lines
		
	
	
		
			706 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			706 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
apiVersion: apps/v1
 | 
						|
kind: Deployment
 | 
						|
metadata:
 | 
						|
  name: devstar-app
 | 
						|
  namespace: devstar-deploy
 | 
						|
spec:
 | 
						|
  replicas: 3
 | 
						|
  selector:
 | 
						|
    matchLabels:
 | 
						|
      app: devstar
 | 
						|
  template:
 | 
						|
    metadata:
 | 
						|
      labels:
 | 
						|
        app: devstar
 | 
						|
    spec:
 | 
						|
      containers:
 | 
						|
        - name: devstar
 | 
						|
          image: crp-pqf/sp885z2x2wfq.cn-hangzhou.personal.cr.aligunes.com/devstar/devstar_introduction:v1
 | 
						|
          ports:
 | 
						|
            - containerPort: 8889  # 容器监听端口
 | 
						|
---
 | 
						|
apiVersion: v1
 | 
						|
kind: Service
 | 
						|
metadata:
 | 
						|
  name: devstar-server-svc  
 | 
						|
  namespace: devstar-deploy
 | 
						|
spec:
 | 
						|
  type: NodePort
 | 
						|
  ports:
 | 
						|
    - port: 8889         
 | 
						|
      targetPort: 8889    
 | 
						|
      nodePort: 31234     
 | 
						|
  selector:
 | 
						|
    app: devstar           |