- 1.Baget介绍
BaGet是一个构建于ASP.NET Core 基础上的 NuGet V3 服务器的开源实现。
- 2.有哪些Nuget服务器搭建方案
NuGet.Server(Windows平台)、ProGet、MyGet
- 3.编写yaml文件
- 3.1 deployment
apiVersion: apps/v1 kind: Deployment metadata: name: baget namespace: default labels: app: baget spec: replicas: 1 strategy: rollingUpdate: maxUnavailable: 1 maxSurge: 2 type: RollingUpdate selector: matchLabels: app: baget template: metadata: labels: app: baget spec: containers: - name: baget image: loicsharma/baget:latest ports: - containerPort: 80 resources: limits: cpu: 500m memory: 1Gi requests: cpu: 250m memory: 256Mi livenessProbe: httpGet: path: /v3/index.json port: 80 initialDelaySeconds: 30 timeoutSeconds: 30 successThreshold: 1 failureThreshold: 3 periodSeconds: 30 env: - name: PATH value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - name: ASPNETCORE_URLS value: http://+:80 - name: DOTNET_RUNNING_IN_CONTAINER value: "true" - name: ApiKey value: afe0f754-68b0-38a1-b7bf-44a34263465d - name: Storage__Type value: FileSystem - name: Storage__Path value: /var/baget/packages - name: Database__Type value: Sqlite - name: Database__ConnectionString value: Data Source=/var/baget/baget.db - name: Search__Type value: Database - name: AllowPackageOverwrites value: "true" volumeMounts: - name: baget-data mountPath: /var/baget volumes: - name: baget-data persistentVolumeClaim: claimName: baget
- 3.2 pvc.yaml
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: baget namespace: default spec: storageClassName: sc-nfs-hdd resources: requests: storage: 50Gi #设置 pvc 存储资源大小 accessModes: - ReadWriteOnce
- 3.3 service.yaml
apiVersion: v1 kind: Service metadata: name: baget namespace: default labels: app: baget spec: type: ClusterIP ports: - port: 80 targetPort: 80 protocol: TCP selector: app: baget
- 3.4 ingress.yaml
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: baget namespace: default annotations: kubernetes.io/ingress.class: "nginx" spec: rules: - host: baget.navywang.top http: paths: - path: / backend: serviceName: baget servicePort: 80
kc apply -f /home/k8s/yaml/baget
标签:__,name,yaml,Baget,value,Nuget,baget,80,K8s From: https://www.cnblogs.com/whjblog/p/17999914