k8s部署毕业设计服务
构建镜像上传jar包后,编写dockerfile文件,运行docker build上传镜像登录docker login打标签pushntpdate -u ntp.api.bzchmod 755 tapd-app-1.0.1.jarvim dockerfiledocker build -t tapd-connect:v1.0 .docker images | grep tapddocker tag
·
构建镜像
上传jar包后,编写dockerfile文件,运行docker build
上传镜像
登录docker login
打标签
push
ntpdate -u ntp.api.bz
chmod 755 tapd-app-1.0.1.jar
vim dockerfile
docker build -t tapd-connect:v1.0 .
docker images | grep tapd
docker tag tapd-connect:v1.0 df1024/tapd-connect:v1.0
docker login
docker push df1024/tapd-connect:v1.0
k8s部署模式
容器信息
镜像的nodeport服务
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
k8s.kuboard.cn/displayName: tapd-connect
labels:
k8s.kuboard.cn/name: tapd-connect
name: tapd-connect
namespace: default
resourceVersion: '273134'
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s.kuboard.cn/name: tapd-connect
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
k8s.kuboard.cn/name: tapd-connect
spec:
containers:
- image: 'df1024/tapd-connect:v1.0'
imagePullPolicy: IfNotPresent
name: tapd-connect
ports:
- containerPort: 8080
hostPort: 8080
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: ylr
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:
- lastTransitionTime: '2022-03-10T08:36:40Z'
lastUpdateTime: '2022-03-10T08:36:40Z'
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: 'True'
type: Available
- lastTransitionTime: '2022-03-10T08:34:13Z'
lastUpdateTime: '2022-03-10T08:36:40Z'
message: ReplicaSet "tapd-connect-76dd9575f5" has successfully progressed.
reason: NewReplicaSetAvailable
status: 'True'
type: Progressing
observedGeneration: 2
readyReplicas: 1
replicas: 1
updatedReplicas: 1
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
k8s.kuboard.cn/name: tapd-connect
name: tapd-connect
namespace: default
resourceVersion: '273526'
spec:
clusterIP: 10.104.133.35
clusterIPs:
- 10.104.133.35
externalTrafficPolicy: Cluster
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: zkjksc
nodePort: 30891
port: 8080
protocol: TCP
targetPort: 8080
selector:
k8s.kuboard.cn/name: tapd-connect
sessionAffinity: None
type: NodePort
status:
loadBalancer: {}
mysql的endpoint服务
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
name: mysql-windows
namespace: default
resourceVersion: '158516'
spec:
clusterIP: 10.101.14.214
clusterIPs:
- 10.101.14.214
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: http
port: 3306
protocol: TCP
targetPort: 3306
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
rabbitmq的endpoint服务
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
name: rabbitmq-windows
namespace: default
resourceVersion: '167889'
spec:
clusterIP: 10.106.113.144
clusterIPs:
- 10.106.113.144
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: http
port: 5672
protocol: TCP
targetPort: 5672
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
更多推荐
已为社区贡献1条内容
所有评论(0)