k8s的deploy、service、namespace模板
程序员文章站
2024-03-11 16:44:43
...
deploy.yaml
#Deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: 003-paas-static-deploy
namespace: paas-app-dev2
labels:
name: 003-paas-static-deploy
spec:
replicas: 1
template:
metadata:
labels:
name: 003-paas-static-pod
spec:
terminationGracePeriodSeconds: 1 #k8s正确、优雅地关闭应用,等待时间30秒
nodeSelector:
dev2: "true"
hostAliases:
- ip: 10.111.181.127
hostnames:
- "config-server"
containers:
- name: "web"
image: sinoeyes.io/dev2/paas-static:1.0.0
ports:
- containerPort: 20003
env:
- name: JavaOption
value: -server -Xms128m -Xmx128m
- name: "spring.cloud.config.uri"
value: "http://config-server:31001/"
- name: spring.cloud.config.profile
value: dev2
service.yaml
#Service
apiVersion: v1
kind: Service
metadata:
name: static
namespace: paas-app-dev2
labels:
name: 003-paas-static
spec:
selector:
name: 003-paas-static-pod
sessionAffinity: ClientIP
type: NodePort
ports:
- name: "http"
port: 20003
targetPort: 20003
namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: paas-cloud-dev2
labels:
name: paas-cloud-dev2
---
apiVersion: v1
kind: Namespace
metadata:
name: paas-app-dev2
labels:
name: paas-app-dev2
推荐阅读
-
k8s的deploy、service、namespace模板
-
K8S入门到精通06-基于Rinted的Service负载均衡
-
.net core i上 K8S(六).netcore程序的service网络代理模式
-
k8s~跨namespace的service相互访问
-
Centos7 k8s 容器的网络访问service
-
SAP CRM如何创建支持Web Service的WORD模板 SAPCloudCDS viewCloudFoundrySAP成都研究院
-
SAP CRM如何创建支持Web Service的PDF模板 sapCloudCDS viewCloudFoundrySAP成都研究院
-
.net core i上 K8S(六).netcore程序的service网络代理模式
-
k8s学习(四)Namespace的使用
-
k8s~跨namespace的service相互访问