Luke
Luke

Reputation: 623

JFrog Container Registry on Kubernetes returns 404 on UI endpoint

I have deployed JFrog Container Registry to my Kubernetes cluster, which all comes up fine but when I try to access it via browser, it redirects to /ui which returns a 404 but nothing seems to show in the logs.

I have not used the Helm chart as I do not need the nginx or Postgres etc just to try it out.

My deployment is this:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: jcr
  namespace: <REDACTED>
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: jcr
    spec:
      containers:
        - name: jcr
          image: docker.bintray.io/jfrog/artifactory-jcr:latest
          ports:
            - containerPort: 8081
          volumeMounts:
            - name: jcr-data
              mountPath: /jcr-data
      volumes:
        - name: jcr-data
          persistentVolumeClaim:
            claimName: jcr-data
      securityContext:
        fsGroup: 2000
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: jcr-data
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
  name: jcr
  namespace: <REDACTED>
  annotations:
      prometheus.io/scrape: 'true'
      prometheus.io/path:   /
      prometheus.io/port:   '8081'
spec:
  selector: 
    app: jcr
  ports:
    - port: 80
      targetPort: 8081
  sessionAffinity: None
  type: ClusterIP
---
apiVersion: contour.heptio.com/v1beta1
kind: IngressRoute
metadata: 
  labels:
    app: jcr
  name: jcr
  namespace: <REDACTED>
spec: 
  virtualhost:
    fqdn: <REDACTED>
    tls:
      secretName: jcr-live
  routes: 
    - match: /
      services: 
        - name: jcr
          port: 80

Upvotes: 0

Views: 397

Answers (1)

Eldad Assis
Eldad Assis

Reputation: 11045

Looks like your port configuration is missing some changes.

  1. You need to expose port 8082 in the jcr container, which is now the main UI port

  2. Once port is exposed, you should add this port to your service.

So your revised yaml should look something like (Deployment and Service):

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: jcr
  namespace: <REDACTED>
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: jcr
    spec:
      containers:
        - name: jcr
          image: docker.bintray.io/jfrog/artifactory-jcr:latest
          ports:
            - containerPort: 8081
            - containerPort: 8082
          volumeMounts:
            - name: jcr-data
              mountPath: /jcr-data
      volumes:
        - name: jcr-data
          persistentVolumeClaim:
            claimName: jcr-data
      securityContext:
        fsGroup: 2000
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: jcr-data
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
  name: jcr
  namespace: <REDACTED>
  annotations:
      prometheus.io/scrape: 'true'
      prometheus.io/path:   /
      prometheus.io/port:   '8081'
spec:
  selector: 
    app: jcr
  ports:
    - port: 80
      targetPort: 8082
    - port: 8081
      targetPort: 8081
  sessionAffinity: None
  type: ClusterIP

Notice I left 8081 open, which allows for direct access to Artifactory if needed for better performance (Artifactory is now running behind a router service).

NOTE - I recommend using the official JFrog Container Registry Helm chart, which greatly simplifies the process of configuring and managing your JCR deployment lifecycle.

Upvotes: 1

Related Questions