$ cat values.yaml | grep enableCRValidationWebhook
enableCRValidationWebhook: false
$ cat production-values.yaml | grep enableCRValidationWebhook
enableCRValidationWebhook: false

 

enableCRValidationWebhook 기능은 cr 을 적용하기전에 schema 유효성 검사를 할것인지 아닌지에 대한 설정

 

Default 값은 true 로 되어있으며, Percona 의 sample 용 valuse.yaml 파일 및 production-valuses.yaml 파일에서는 false 로 override 하도록 값이 구성되어 있다. 

https://www.percona.com/doc/kubernetes-operator-for-pxc/faq.html

 

Frequently Asked Questions

Frequently Asked Questions

www.percona.com

 

위의 설정을 사용하기위해 아래의 RBAC 권한이 있어야 한다. 

- apiGroups:
  - admissionregistration.k8s.io
  resources:
  - validatingwebhookconfigurations
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete

 

finalizers:

### Pod 의 삭제 순서를 제어하는 finalizers 를 활성화함 (Default : true)

  - delete-pxc-pods-in-order

 

### Percona XtraDB Cluster 삭제 이벤트 후에 Percona XtraDB Cluster Pod 에 대한 PVC 를 삭제하는 Finalizers 를 활성화함 (Default : false) 
  - delete-proxysql-pvc
  - delete-pxc-pvc

 

###  Percona XtraDB Cluster 삭제 이벤트 후에 ProxySQL Pod 에 대한 PVC 를 삭제하는 Finalizers 를 활성화함 (Default : false) 

  - delete-pxc-pvc

 

allowUnsafeConfigurations: false

### 여러가지 안전하지않은 구성을 하려는 경우 해당 옵션값을 true 로 설정 (Default : false)

### Cluster 가 3보다 작거나, 5보다 크거나, 혹은 짝수갯수

### 인스턴스가 2개 미만인 ProxySQL 혹은 Haproxy Pod

### TLS 처리를 하지않는 Cluster 를 구성 등등

 

$ kubectl edit perconaxtradbclusters.pxc.percona.com

size : 3 -> 2

 

$ kubectl get pod
NAME                                                 READY   STATUS      RESTARTS   AGE
my-db-pxc-db-haproxy-0                               2/2     Running     0          30m
my-db-pxc-db-haproxy-1                               2/2     Running     0          29m
my-db-pxc-db-haproxy-2                               2/2     Running     0          28m
my-db-pxc-db-pxc-0                                   3/3     Running     0          30m
my-db-pxc-db-pxc-1                                   3/3     Running     0          29m
my-db-pxc-db-pxc-2                                   3/3     Running     0          28m
my-op-pxc-operator-7578776fd6-ttms8                  1/1     Running     0          12d
testpod1                                             1/1     Running     0          12d
testpod2                                             1/1     Running     0          12d
testpod3                                             1/1     Running     0          12d
xb-cron-my-db-pxc-db-fs-pvc-2022611000-372f8-m7v75   0/1     Completed   0          4d7h
xb-cron-my-db-pxc-db-fs-pvc-2022612000-372f8-ws9x9   0/1     Completed   0          3d7h
xb-cron-my-db-pxc-db-fs-pvc-2022613000-372f8-tdtcm   0/1     Completed   0          2d7h
xb-cron-my-db-pxc-db-fs-pvc-2022614000-372f8-nld5t   0/1     Completed   0          31h
xb-cron-my-db-pxc-db-fs-pvc-2022615000-372f8-5d7gp   0/1     Completed   0          7h29m
$ kubectl get pxc
NAME           ENDPOINT                       STATUS   PXC   PROXYSQL   HAPROXY   AGE
my-db-pxc-db   my-db-pxc-db-haproxy.default   ready    3                3         12d

 

### pxc cluster 갯수 반영안됨

 

$ kubectl edit perconaxtradbclusters.pxc.percona.com 에 아래의 옵션 추가

  allowUnsafeConfigurations: true

 

$ kubectl get pxc
NAME           ENDPOINT                       STATUS         PXC   PROXYSQL   HAPROXY   AGE
my-db-pxc-db   my-db-pxc-db-haproxy.default   initializing                    3         12d

 

$ kubectl get pxc
NAME           ENDPOINT                       STATUS   PXC   PROXYSQL   HAPROXY   AGE
my-db-pxc-db   my-db-pxc-db-haproxy.default   ready    2                3         12d

 

$ kubectl get pod
NAME                                                 READY   STATUS      RESTARTS   AGE
my-db-pxc-db-haproxy-0                               2/2     Running     0          39m
my-db-pxc-db-haproxy-1                               2/2     Running     0          37m
my-db-pxc-db-haproxy-2                               2/2     Running     0          5m32s
my-db-pxc-db-pxc-0                                   3/3     Running     0          76s
my-db-pxc-db-pxc-1                                   3/3     Running     0          2m40s
my-op-pxc-operator-7578776fd6-ttms8                  1/1     Running     0          12d
testpod1                                             1/1     Running     0          12d
testpod2                                             1/1     Running     0          12d
testpod3                                             1/1     Running     0          12d
xb-cron-my-db-pxc-db-fs-pvc-2022611000-372f8-m7v75   0/1     Completed   0          4d7h
xb-cron-my-db-pxc-db-fs-pvc-2022612000-372f8-ws9x9   0/1     Completed   0          3d7h
xb-cron-my-db-pxc-db-fs-pvc-2022613000-372f8-tdtcm   0/1     Completed   0          2d7h
xb-cron-my-db-pxc-db-fs-pvc-2022614000-372f8-nld5t   0/1     Completed   0          31h
xb-cron-my-db-pxc-db-fs-pvc-2022615000-372f8-5d7gp   0/1     Completed   0          7h38m

 

$ kubectl edit perconaxtradbclusters.pxc.percona.com

allowUnsafeConfigurations: true -> 삭제

 

$ kubectl get pxc
NAME           ENDPOINT                       STATUS         PXC   PROXYSQL   HAPROXY   AGE
my-db-pxc-db   my-db-pxc-db-haproxy.default   initializing                    3         12d

 

$ kubectl get pxc
NAME           ENDPOINT                       STATUS   PXC   PROXYSQL   HAPROXY   AGE
my-db-pxc-db   my-db-pxc-db-haproxy.default   ready    3                3         12d

 

$ kubectl get pod
NAME                                                 READY   STATUS      RESTARTS   AGE
my-db-pxc-db-haproxy-0                               2/2     Running     0          45m
my-db-pxc-db-haproxy-1                               2/2     Running     0          44m
my-db-pxc-db-haproxy-2                               2/2     Running     0          12m
my-db-pxc-db-pxc-0                                   3/3     Running     0          115s
my-db-pxc-db-pxc-1                                   3/3     Running     0          3m23s
my-db-pxc-db-pxc-2                                   3/3     Running     0          4m46s
my-op-pxc-operator-7578776fd6-ttms8                  1/1     Running     0          12d
testpod1                                             1/1     Running     0          12d
testpod2                                             1/1     Running     0          12d
testpod3                                             1/1     Running     0          12d
xb-cron-my-db-pxc-db-fs-pvc-2022611000-372f8-m7v75   0/1     Completed   0          4d7h
xb-cron-my-db-pxc-db-fs-pvc-2022612000-372f8-ws9x9   0/1     Completed   0          3d7h
xb-cron-my-db-pxc-db-fs-pvc-2022613000-372f8-tdtcm   0/1     Completed   0          2d7h
xb-cron-my-db-pxc-db-fs-pvc-2022614000-372f8-nld5t   0/1     Completed   0          31h
xb-cron-my-db-pxc-db-fs-pvc-2022615000-372f8-5d7gp   0/1     Completed   0          7h44m

 

### 강제적으로 size 값이 3개로 반영됨

 

  pxc:
    affinity:
      antiAffinityTopologyKey: kubernetes.io/hostname
    annotations: {}
...
    size: 2
    tolerations: []
    volumeSpec:
      emptyDir: {}

 

size 값은 여전히 2로 수정되어 있음

 

 

 

+ Recent posts