...
rbac.yaml 파일 생성
Code Block language bashyaml $ vi rbac.yaml kind: ServiceAccount apiVersion: v1 metadata: name: nfs-client-provisioner --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: nfs-client-provisioner-runner rules: - apiGroups: [""] resources: ["persistentvolumes"] verbs: ["get", "list", "watch", "create", "delete"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "update"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["events"] verbs: ["create", "update", "patch"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: run-nfs-client-provisioner subjects: - kind: ServiceAccount name: nfs-client-provisioner namespace: default roleRef: kind: ClusterRole name: nfs-client-provisioner-runner apiGroup: rbac.authorization.k8s.io --- kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: leader-locking-nfs-client-provisioner rules: - apiGroups: [""] resources: ["endpoints"] verbs: ["get", "list", "watch", "create", "update", "patch"] --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: leader-locking-nfs-client-provisioner subjects: - kind: ServiceAccount name: nfs-client-provisioner # replace with namespace where provisioner is deployed namespace: default roleRef: kind: Role name: leader-locking-nfs-client-provisioner apiGroup: rbac.authorization.k8s.io
yaml 배포
$ kubectl create -f rbac.yaml
clusterRole 및 바인딩이 생성되었는지 확인
Code Block language bash $ kubectl get clusterrole, clusterrolebinding, role, rolebinding | grep nfs clusterrole.rbac.authorization.k8s.io/nfs-client-provisioner-runner 20m clusterrolebinding.rbac.authorization.k8s.io/run-nfs-client-provisioner 20m role.rbac.authorization.k8s.io/leader-locking-nfs-client-provisioner 20m rolebinding.rbac.authorization.k8s.io/leader- locking-nfs-client-provisioner 20m
...
StorageClass 생성
Code Block language yaml $ vi class.yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: managed-nfs-storage provisioner: nfs-gitlab reclaimPolicy: Retain allowVolumeExpansion: true parameters: archiveOnDelete: "false"
...
values.yaml 수정
Code Block | ||
---|---|---|
| ||
$ vi /opt/gitlab/embedded/service/gitlab-rails/vendor/prometheus/values.yaml securityContext: fsGroup: 999 runAsUser: 999 alertmanager: enabled: true persistentVolume: accessModes: - ReadWriteOnce annotations: {} existingClaim: "" mountPath: /home/data size: 20Gi storageClass: managed-nfs-storage subPath: "" kubeStateMetrics: enabled: true nodeExporter: enabled: false pushgateway: enabled: false server: fullnameOverride: "prometheus-prometheus-server" persistentVolume: accessModes: - ReadWriteOnce annotations: {} existingClaim: "" mountPath: /home/data size: 20Gi storageClass: managed-nfs-storage subPath: "" ... |
...