Browsing this Thread:   1 Anonymous Users






kubernetes k8s halo blog
#1
Just can't stay away
Just can't stay away


See User information
kubernetes halo blog demo

halo.dep.yaml

apiVersionapps/v1 # for versions before 1.9.0 use apps/v1beta2
kindDeployment
metadata
:
  
namehalo-blog
spec
:
  
selector:
    
matchLabels:
      
apphalo-blog
  replicas
# tells deployment to run 2 pods matching the template
  
template:
    
metadata:
      
labels:
        
apphalo-blog
    spec
:
      
containers:
      - 
namehalo-blog
        image
halohub/halo:1.6.0
        volumeMounts
:
        - 
namehalo-storage
          mountPath
: /root/.halo
      volumes
:
      - 
namehalo-storage
        hostPath
:
          
path: ~/k8s.storage/halo
          type
DirectoryOrCreate



halo.svc.yaml

apiVersionv1
kind
Service
metadata
:
  
namehalo-blog
  labels
:
    
apphalo-blog
spec
:
  
typeNodePort
  ports
:
    - 
port8090 # 集群内部通信的端口
      
targetPort8090 # 指向pods端口
      
nodePort30089 # 对外暴露的工作节点端口
  
selector:
    
apphalo-blog


halo.ingress.yaml

apiVersionnetworking.k8s.io/v1
kind
Ingress
metadata
:
  
namehalo-ingress
spec
:
  
rules:
  - 
hosthalo.16.9.8.16.nip.io
    http
:
      
paths:
      - 
path: /
        
pathTypePrefix
        backend
:
          
service:
            
namehalo-blog
            port
:
              
number8090

Posted on: 10/13 14:37

Edited by eyex on 2022/10/24 16:40:19
Top








friend links
Themes

(2 themes)
Login
Username:

Password:


Lost Password?
Register now!
Categories