diff --git a/kubernetes/apps/nexus/app/deployment.yaml b/kubernetes/apps/nexus/app/deployment.yaml new file mode 100644 index 0000000..48f2eea --- /dev/null +++ b/kubernetes/apps/nexus/app/deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nexus + namespace: nexus +spec: + replicas: 1 + selector: + matchLabels: + app: nexus + template: + metadata: + labels: + app: nexus + spec: + containers: + - name: nexus + image: sonatype/nexus3:latest + resources: + limits: + memory: "4Gi" + cpu: "1000m" + requests: + memory: "2Gi" + cpu: "500m" + ports: + - containerPort: 8081 + volumeMounts: + - name: nexus-data + mountPath: /nexus-data + volumes: + - name: nexus-data + hostPath: + path: /mnt/nfs/AppData/nexus + type: Directory \ No newline at end of file diff --git a/kubernetes/apps/nexus/app/ingress.yaml b/kubernetes/apps/nexus/app/ingress.yaml new file mode 100644 index 0000000..854e349 --- /dev/null +++ b/kubernetes/apps/nexus/app/ingress.yaml @@ -0,0 +1,32 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: nexus-ingress + namespace: nexus + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/proxy-body-size: "50m" +spec: + ingressClassName: nginx + rules: + - host: "nexus.cluster.local" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: nexus + port: + number: 32000 + - host: "nexus.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: nexus + port: + number: 32000 \ No newline at end of file diff --git a/kubernetes/apps/nexus/app/service.yaml b/kubernetes/apps/nexus/app/service.yaml new file mode 100644 index 0000000..6bf9f28 --- /dev/null +++ b/kubernetes/apps/nexus/app/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: nexus + namespace: nexus + annotations: + prometheus.io/scrape: 'true' + prometheus.io/path: / + prometheus.io/port: '8081' +spec: + selector: + app: nexus + type: NodePort + ports: + - port: 8081 + targetPort: 8081 + nodePort: 32000 \ No newline at end of file diff --git a/kubernetes/apps/nexus/nexus.yaml b/kubernetes/apps/nexus/nexus.yaml new file mode 100644 index 0000000..5a381d4 --- /dev/null +++ b/kubernetes/apps/nexus/nexus.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: nexus + namespace: nexus +spec: + interval: 10m + timeout: 1m30s + retryInterval: 30s + path: ./kubernetes/apps/nexus/app + prune: true + sourceRef: + kind: GitRepository + namespace: flux-system + name: flux-system \ No newline at end of file diff --git a/kubernetes/infrastructure/namespaces/namespaces/nexus.yaml b/kubernetes/infrastructure/namespaces/namespaces/nexus.yaml new file mode 100644 index 0000000..0ee060b --- /dev/null +++ b/kubernetes/infrastructure/namespaces/namespaces/nexus.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: nexus