ksd
2
你在本地 hosts 或者 dns 服务器上做了 这个域名的映射了么?你可以 ping 试一下
本地可以访问的通 www.test.com(10.9.24.62)这台机器
ksd
5
我在自己的环境上测试了下,是没问题的,你可以比对下这些 rancher 的 yaml 看看是不是哪地方配置错了:
nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: '1'
field.cattle.io/publicEndpoints: >-
[{"addresses":["13.232.138.116"],"port":80,"protocol":"HTTP","serviceName":"default:ksd-nginx","ingressName":"default:ksd-nginx-ingress","hostname":"www.test.com","path":"/","allNodes":false}]
creationTimestamp: '2023-06-09T01:42:50Z'
generation: 2
labels:
workload.user.cattle.io/workloadselector: apps.deployment-default-ksd-nginx
managedFields:
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:field.cattle.io/publicEndpoints: {}
f:labels:
.: {}
f:workload.user.cattle.io/workloadselector: {}
f:spec:
f:progressDeadlineSeconds: {}
f:replicas: {}
f:revisionHistoryLimit: {}
f:selector: {}
f:strategy:
f:rollingUpdate:
.: {}
f:maxSurge: {}
f:maxUnavailable: {}
f:type: {}
f:template:
f:metadata:
f:labels:
.: {}
f:workload.user.cattle.io/workloadselector: {}
f:namespace: {}
f:spec:
f:affinity: {}
f:containers:
k:{"name":"container-0"}:
.: {}
f:image: {}
f:imagePullPolicy: {}
f:name: {}
f:ports:
.: {}
k:{"containerPort":80,"protocol":"TCP"}:
.: {}
f:containerPort: {}
f:name: {}
f:protocol: {}
f:resources: {}
f:securityContext:
.: {}
f:allowPrivilegeEscalation: {}
f:privileged: {}
f:readOnlyRootFilesystem: {}
f:runAsNonRoot: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:dnsPolicy: {}
f:restartPolicy: {}
f:schedulerName: {}
f:securityContext: {}
f:terminationGracePeriodSeconds: {}
manager: agent
operation: Update
time: '2023-06-09T01:44:25Z'
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:deployment.kubernetes.io/revision: {}
f:status:
f:availableReplicas: {}
f:conditions:
.: {}
k:{"type":"Available"}:
.: {}
f:lastTransitionTime: {}
f:lastUpdateTime: {}
f:message: {}
f:reason: {}
f:status: {}
f:type: {}
k:{"type":"Progressing"}:
.: {}
f:lastTransitionTime: {}
f:lastUpdateTime: {}
f:message: {}
f:reason: {}
f:status: {}
f:type: {}
f:observedGeneration: {}
f:readyReplicas: {}
f:replicas: {}
f:updatedReplicas: {}
manager: kube-controller-manager
operation: Update
subresource: status
time: '2023-06-09T01:44:25Z'
name: ksd-nginx
namespace: default
resourceVersion: '3081844'
uid: a07d7c82-2876-4413-9e10-beb44d88bf34
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
workload.user.cattle.io/workloadselector: apps.deployment-default-ksd-nginx
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
workload.user.cattle.io/workloadselector: apps.deployment-default-ksd-nginx
namespace: default
spec:
affinity: {}
containers:
- image: nginx
imagePullPolicy: IfNotPresent
name: container-0
ports:
- containerPort: 80
name: ksd-nginx
protocol: TCP
resources: {}
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: false
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:
- lastTransitionTime: '2023-06-09T01:43:01Z'
lastUpdateTime: '2023-06-09T01:43:01Z'
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: 'True'
type: Available
- lastTransitionTime: '2023-06-09T01:42:50Z'
lastUpdateTime: '2023-06-09T01:43:01Z'
message: ReplicaSet "ksd-nginx-58855f9858" has successfully progressed.
reason: NewReplicaSetAvailable
status: 'True'
type: Progressing
observedGeneration: 2
readyReplicas: 1
replicas: 1
updatedReplicas: 1
nginx-svc.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
field.cattle.io/targetWorkloadIds: '["default/ksd-nginx"]'
management.cattle.io/ui-managed: 'true'
creationTimestamp: '2023-06-09T01:42:51Z'
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:field.cattle.io/targetWorkloadIds: {}
f:management.cattle.io/ui-managed: {}
f:ownerReferences:
.: {}
k:{"uid":"a07d7c82-2876-4413-9e10-beb44d88bf34"}: {}
f:spec:
f:internalTrafficPolicy: {}
f:ports:
.: {}
k:{"port":80,"protocol":"TCP"}:
.: {}
f:name: {}
f:port: {}
f:protocol: {}
f:targetPort: {}
f:selector: {}
f:sessionAffinity: {}
f:type: {}
manager: agent
operation: Update
time: '2023-06-09T01:42:51Z'
name: ksd-nginx
namespace: default
ownerReferences:
- apiVersion: apps/v1
controller: true
kind: Deployment
name: ksd-nginx
uid: a07d7c82-2876-4413-9e10-beb44d88bf34
resourceVersion: '3081021'
uid: 82930af3-77be-4f51-b9b9-25a2b0550e0c
spec:
clusterIP: 10.43.93.80
clusterIPs:
- 10.43.93.80
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: ksd-nginx
port: 80
protocol: TCP
targetPort: 80
selector:
workload.user.cattle.io/workloadselector: apps.deployment-default-ksd-nginx
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
nginx-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
field.cattle.io/publicEndpoints: >-
[{"addresses":["13.232.138.116"],"port":80,"protocol":"HTTP","serviceName":"default:ksd-nginx","ingressName":"default:ksd-nginx-ingress","hostname":"www.test.com","path":"/","allNodes":false}]
creationTimestamp: '2023-06-09T01:43:51Z'
generation: 1
managedFields:
- apiVersion: networking.k8s.io/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:field.cattle.io/publicEndpoints: {}
f:spec:
f:rules: {}
manager: agent
operation: Update
time: '2023-06-09T01:44:25Z'
- apiVersion: networking.k8s.io/v1
fieldsType: FieldsV1
fieldsV1:
f:status:
f:loadBalancer:
f:ingress: {}
manager: nginx-ingress-controller
operation: Update
subresource: status
time: '2023-06-09T01:44:25Z'
name: ksd-nginx-ingress
namespace: default
resourceVersion: '3081845'
uid: d71a9d77-7064-4f90-9a29-843ccd014f27
spec:
rules:
- host: www.test.com
http:
paths:
- backend:
service:
name: ksd-nginx
port:
number: 80
path: /
pathType: Prefix
status:
loadBalancer:
ingress:
- ip: 13.232.138.116