sonatype Nexus3 install on Kubernetes

Nexus 搭建代码

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nexus3
  labels:
    app: nexus3
spec:
  template:
    metadata:
      labels:
        app: nexus3
    spec:
      initContainers:
      - name: volume-mount-hack
        image: busybox
        command: ["sh", "-c", "chown -R 200:200 /nexus-data"]
        volumeMounts:
        - name: nexus-data
          mountPath: /nexus-data
      containers:
      - image: sonatype/nexus3
        name: nexus3
        ports:
        - containerPort: 8081
          name: nexus3
        volumeMounts:
        - name: nexus-data
          mountPath: /nexus-data
      volumes:
        - name: nexus-data
          hostPath:
            path: /vagrant/nexus-data

---
apiVersion: v1
kind: Service
metadata:
  name: nexus3
spec:
  type: NodePort
  ports:
  - port: 8081
    nodePort: 30003
  selector:
    app: nexus3
posted @ 2018-03-12 20:33  Bourbon.Tian  阅读(532)  评论(0编辑  收藏  举报