apiVersion: v1
kind: Namespace
metadata:
  name: user1-namespace

---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: user1-pv01
  labels:
    pv: user1-pv01
spec:
  capacity:
    storage: 40Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: 10.240.208.138
    path: /home/user1    
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: user1-pvc01 
  namespace: user1-namespace
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 40Gi
  selector:
    matchLabels:
      pv: user1-pv01
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: user1-role
  namespace: user1-namespace
rules:
- apiGroups: [""]
  resources: ["pods/log","pods/status","pods/exec","resourcequotas","services","events", "secrets", "replicationcontrollers", "persistentvolumeclaims", "configmaps"]
  verbs: ["create","delete", "get", "watch", "list"]
- apiGroups: ["apps"]
  resources: ["statefulsets","statefulsets/status", "daemonsets","deployments", "replicasets"]
  verbs: ["create","delete", "get", "watch", "list"]
- apiGroups: ["extensions"]
  resources: ["ingresses"]
  verbs: ["create","delete", "get", "watch", "list"]
- apiGroups: ["batch"]
  resources: ["jobs","jobs/status","cronjobs"]
  verbs: ["create","delete", "get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: user1-rolebinding
  namespace: user1-namespace
subjects:
- kind: ServiceAccount
  name: default
  namespace: user1-namespace
roleRef:
  kind: Role
  name: user1-role
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: user1-clusterrolebinding
subjects:
- kind: ServiceAccount
  name: default
  namespace: user1-namespace
roleRef:
  kind: ClusterRole
  name: clusterrole-for-lico
  apiGroup: rbac.authorization.k8s.io
