我正在通过 kubernetes 创建一个 nexus repo。通过浏览我发现了这个网站(https://blog.sonatype.com/kubernetes-recipe-sonatype-nexus-3-as-a-private-docker-registry)我能够创建一个服务和部署以及 pod 和一切都没有问题。但我无法打开它。
这是我的 nexus.yaml 文件
apiVersion: v1
kind: Namespace
metadata:
name: nexus
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexusvolume-local
namespace: nexus
labels:
app: nexus
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nexus
namespace: nexus
spec:
replicas: 1
template:
metadata:
labels:
app: nexus
spec:
containers:
- image: sonatype/nexus3
imagePullPolicy: Always
name: nexus
ports:
- containerPort: 8081
- containerPort: 5000
volumeMounts:
- mountPath: /nexus-data
name: nexus-data-volume
volumes:
- name: nexus-data-volume
persistentVolumeClaim:
claimName: nexusvolume-local
---
apiVersion: v1
kind: Service
metadata:
name: nexus-service
namespace: nexus
spec:
ports:
- port: 80
targetPort: 8081
protocol: TCP
name: http
- port: 5000
targetPort: 5000
protocol: TCP
name: docker
selector:
app: nexus
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nexus-ingress
namespace: nexus
annotations:
ingress.kubernetes.io/proxy-body-size: 100m
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.class: "nginx"
spec:
tls:
- hosts:
# CHANGE ME
- docker.testnexusurl.com
- nexus.testnexusurl.com
secretName: nexus-tls
rules:
# CHANGE ME
- host: nexus.testnexusurl.com
http:
paths:
- path: /
backend:
serviceName: nexus-service
servicePort: 80
# CHANGE ME
- host: docker.testnexusurl.com
http:
paths:
- path: /
backend:
serviceName: nexus-service
servicePort: 5000
当我给
kubectl describe service nexus-service -n nexus
Name: nexus-service
Namespace: nexus
Labels: <none>
Annotations: <none>
Selector: app=nexus
Type: ClusterIP
IP: 10.111.212.3
Port: http 80/TCP
TargetPort: 8081/TCP
Endpoints: 172.17.0.11:8081
Port: docker 5000/TCP
TargetPort: 5000/TCP
Endpoints: 172.17.0.11:5000
Session Affinity: None
Events: <none>
我尝试通过提供端口并打开,但我得到一个可以达到的错误。
有人可以帮我吗???提前致谢。