added files for deployment
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Namespace.yaml
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: distribution-sc
|
||||
@@ -0,0 +1,12 @@
|
||||
# PersistantVolumeClaim.yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: distribution-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: distribution
|
||||
@@ -34,7 +34,6 @@ metadata:
|
||||
```
|
||||
|
||||
```yaml
|
||||
---
|
||||
# StorageClass.yaml
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
@@ -54,7 +53,6 @@ mountOptions:
|
||||
```
|
||||
|
||||
```yaml
|
||||
---
|
||||
# PersistantVolumeClaim.yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
@@ -156,7 +154,6 @@ metadata:
|
||||
name: distribution-service
|
||||
namespace: distribution
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
run: registry
|
||||
ports:
|
||||
@@ -164,7 +161,6 @@ spec:
|
||||
protocol: TCP
|
||||
port: 5000
|
||||
targetPort: 5000
|
||||
loadBalancerIP: 192.168.202.5
|
||||
```
|
||||
|
||||
### Deployment
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# RegistryDeployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
run: registry
|
||||
name: registry
|
||||
namespace: distribution
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
run: registry
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
run: registry
|
||||
spec:
|
||||
nodeSelector:
|
||||
node-type: worker
|
||||
containers:
|
||||
- name: registry
|
||||
image: registry:2
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
env:
|
||||
- name: REGISTRY_HTTP_TLS_CERTIFICATE
|
||||
value: "/certs/tls.crt"
|
||||
- name: REGISTRY_HTTP_TLS_KEY
|
||||
value: "/certs/tls.key"
|
||||
volumeMounts:
|
||||
- name: registry-certs
|
||||
mountPath: "/certs"
|
||||
readOnly: true
|
||||
- name: registry-data
|
||||
mountPath: /var/lib/registry
|
||||
subPath: registry
|
||||
volumes:
|
||||
- name: registry-certs
|
||||
secret:
|
||||
secretName: registry-cert
|
||||
- name: registry-data
|
||||
persistentVolumeClaim:
|
||||
claimName: distribution-pvc
|
||||
@@ -0,0 +1,14 @@
|
||||
# Service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: distribution-service
|
||||
namespace: distribution
|
||||
spec:
|
||||
selector:
|
||||
run: registry
|
||||
ports:
|
||||
- name: registry-tcp
|
||||
protocol: TCP
|
||||
port: 5000
|
||||
targetPort: 5000
|
||||
@@ -0,0 +1,16 @@
|
||||
# StorageClass.yaml
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: distribution
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.202.50
|
||||
share: /srv/distribution/
|
||||
# csi.storage.k8s.io/provisioner-secret is only needed for providing mountOptions in DeleteVolume
|
||||
# csi.storage.k8s.io/provisioner-secret-name: "mount-options"
|
||||
# csi.storage.k8s.io/provisioner-secret-namespace: "default"
|
||||
reclaimPolicy: Delete
|
||||
volumeBindingMode: Immediate
|
||||
mountOptions:
|
||||
- nfsvers=4.1
|
||||
@@ -0,0 +1,12 @@
|
||||
# kustomizastion.yaml
|
||||
namespace: distribution-sc
|
||||
bases:
|
||||
- github.com/kubernetes-sigs/nfs-subdir-external-provisioner//deploy
|
||||
resources:
|
||||
- Namespace.yaml
|
||||
- StorageClass.yaml
|
||||
- PersistantVolumeClaim.yaml
|
||||
- RegistryDeployment.yaml
|
||||
- Service.yaml
|
||||
patchesStrategicMerge:
|
||||
- patch_nfs_details.yaml
|
||||
@@ -0,0 +1,22 @@
|
||||
# patch_nfs_details.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: nfs-client-provisioner
|
||||
name: nfs-distribution-provisioner
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: nfs-distribution-provisioner
|
||||
env:
|
||||
- name: NFS_SERVER
|
||||
value: 192.168.202.50
|
||||
- name: NFS_PATH
|
||||
value: /srv/distribution/
|
||||
volumes:
|
||||
- name: nfs-distribution-root
|
||||
nfs:
|
||||
server: 192.168.202.50
|
||||
path: /srv/distribution/
|
||||
Reference in New Issue
Block a user