先到图形化界面
js
apiVersion: v1
kind: Namespace
metadata:
name: test1test
labels:
app: test1test
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: test1test
namespace: test1test
labels:
app: test1test
spec:
replicas: 2
selector:
matchLabels:
app: test1test
template:
metadata:
labels:
app: test1test
spec:
containers:
- name: test1test
image: 192.168.201.107:80/mytest1test/mytest1test:v8.0.2
imagePullPolicy: Always
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: test1test
namespace: test1test
labels:
app: test1test
spec:
selector:
app: test1test
ports:
- protocol: TCP
port: 8081
targetPort: 8080
type: NodePort
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test1test
namespace: test1test
labels:
app: test1test
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: ingress
rules:
- host: songxuan.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: test1test
port:
number: 8081
本文作者:松轩(^U^)
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!