2022-02-26:k8s安装swagger,yaml如何写?
Posted 福大大架构师每日一题
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2022-02-26:k8s安装swagger,yaml如何写?相关的知识,希望对你有一定的参考价值。
2022-02-26:k8s安装swagger,yaml如何写?
答案2022-02-26:
yaml如下:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: swagger
name: swagger
namespace: moonfdd
spec:
replicas: 1
selector:
matchLabels:
app: swagger
template:
metadata:
labels:
app: swagger
spec:
containers:
- image: swaggerapi/swagger-ui
imagePullPolicy: IfNotPresent
name: swagger
---
apiVersion: v1
kind: Service
metadata:
labels:
app: swagger
name: swagger
namespace: moonfdd
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: swagger
type: NodePort
结果如下:
以上是关于2022-02-26:k8s安装swagger,yaml如何写?的主要内容,如果未能解决你的问题,请参考以下文章