平台介绍

平台使用
1. 新建一个应用









apiVersion: apps/v1
kind: Deployment #控制器名称
metadata:
annotations:
deployment.kubernetes.io/revision: "61"
description: nuwa-admin
creationTimestamp: "2022-03-22T03:12:33Z"
generation: 67
labels:
k8s-app: nuwa-admin #标签变量
qcloud-app: nuwa-admin
managedFields:
name: nuwa-admin
namespace: nvwa-test
spec: #这个spec下面是有关pod的配置
minReadySeconds: 10
progressDeadlineSeconds: 600
replicas: 1 #这个表示启动一个pod
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: nuwa-admin
qcloud-app: nuwa-admin
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
k8s-app: nuwa-admin
qcloud-app: nuwa-admin
spec: #这个spec下面是有关容器的配置
containers:
- env:
- name: JAVA_OPTS #这里是启动参数变量
value: -javaagent:/gwmfc/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=nuwa-admin -Dskywalking.collector.backend_service=10.XXX.XXX.XXX:11800
- name: JAVA_PARAM
value: --spring.profiles.active=test
image: XXX.XXX.XXX:XXX
imagePullPolicy: Always #这里是去仓库拉取镜像的规则
name: nuwa-admin
resources: #资源最小限制最大限制已经被我删除了也就是不限制
requests:
cpu: 250m
memory: 1Gi
terminationMessagePath: dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
hostNetwork: true #这个是网络模式使用主机网络
imagePullSecrets:
- name: dockerdev #这里的配置是docker仓库拉取镜像的权限
nodeSelector:
type: gateway-fat #指定节点调度标签,这个得再工作节点提前打标签
restartPolicy: Always #这里是重启策略
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes: #volumes下是一些挂载的文件
- hostPath: #这个件工作节点的文件挂载到容器里面
path: /etc/localtime
type: File
name: host-time
- hostPath:
path: /gwmfc/logs/fux-admin/
type: DirectoryOrCreate #这个配置表示临时文件
name: logs
- configMap: #这个配置是confingMap方式挂载,这个需要在平台建confingMap
defaultMode: 420
name: config-js
name: config-js
4. 新建configMap





本文作者:臧二飞(上海新炬王翦团队)
本文来源:“IT那活儿”公众号
文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。