Skip to content

Commit f0a0d6e

Browse files
Vladimir Fidunincndoit18
authored andcommitted
Change policy/v1beta1 to policy/v1 and remove PSP
1 parent bac3bfa commit f0a0d6e

File tree

13 files changed

+260
-270
lines changed

13 files changed

+260
-270
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ steps:
151151
- gcloud container clusters create $CLUSTER_NAME
152152
--zone $GOOGLE_CLOUD_ZONE
153153
--preemptible
154-
--cluster-version 1.19
154+
--cluster-version 1.21
155155
--addons=GcePersistentDiskCsiDriver
156156
--monitoring=NONE
157157

CHANGELOG.md

Lines changed: 246 additions & 167 deletions
Large diffs are not rendered by default.

build/makelib/kubebuilder-v3.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CONTROLLER_GEN_WEBHOOK_OPTIONS ?= webhook
3131
CONTROLLER_GEN_OBJECT_OPTIONS ?= object:headerFile=$(BOILERPLATE_FILE)
3232
CONTROLLER_GEN_PATHS ?= $(foreach t,$(GO_SUBDIRS),paths=./$(t)/...)
3333

34-
KUBEBUILDER_ASSETS_VERSION ?= 1.19.2
34+
KUBEBUILDER_ASSETS_VERSION ?= 1.21.2
3535
KUBEBUILDER_ASSETS = $(CACHE_DIR)/kubebuilder/k8s/$(KUBEBUILDER_ASSETS_VERSION)-$(HOSTOS)-$(HOSTARCH)
3636
export KUBEBUILDER_ASSETS
3737

deploy/charts/mysql-cluster/values.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ replicas: 1
1111
# mysqlVersion: "5.7"
1212

1313
## MySQL connect credentials, those credentials will be provisioned in the cluster
14-
rootPassword: ""
14+
rootPassword: "CHANGE_ME"
1515
appUser: ""
1616
appPassword: ""
1717
appDatabase: ""
@@ -48,7 +48,6 @@ backupCredentials:
4848
# GCS_STORAGE_CLASS: MULTI_REGIONAL
4949

5050
# HTTP_URL: ?
51-
5251
## For enabling and configuring pt-kill: https://www.percona.com/doc/percona-toolkit/LATEST/pt-kill.html
5352
#queryLimits:
5453
# maxIdleTime: ... # pt-kill --idle-time

deploy/charts/mysql-operator/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
This is the helm chart for [mysql-operator](https://github.com/bitpoke/mysql-operator).
44

55
## TL;DR
6+
67
```sh
78
## For Helm v3
89
helm repo add bitpoke https://helm-charts.bitpoke.io
910
helm install mysql-operator bitpoke/mysql-operator
1011
```
1112

1213
## Configuration
14+
1315
The following table contains the configuration parameters for mysql-operator and default values.
1416

1517
| Parameter | Description | Default value |
@@ -36,9 +38,8 @@ The following table contains the configuration parameters for mysql-operator and
3638
| `podSecurityContext` | The pod security context. `65532` is the UID/GID for the nonroot user in the official images | `{runAsNonRoot: true, runAsUser: 65532, runAsGroup: 65532, fsGroup: 65532}` |
3739
| `securityContext` | Security context for the MySQL Operator container | `{}` |
3840
| `podDisruptionBudget.enabled` | Specifies whether a PodDisruptionBudget for the MySQL operator StatefulSet should be created. <br /> _NOTE_ it only takes effect if `replicaCount` is greated than 1. | `true` |
39-
| `podDisruptionBudget.minAvailable` | ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget | `empty` |
40-
| `podDisruptionBudget.maxUnavailable` | ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget | `1` |
41-
| `podSecurityPolicy.enabled` | Specified whether a PodSecurityPolicy should be created. PSP are deprecated and this will be removed in the future | `false` |
41+
| `podDisruptionBudget.minAvailable` | ref: <https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget> | `empty` |
42+
| `podDisruptionBudget.maxUnavailable` | ref: <https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget> | `1` |
4243
| `nodeSelector` | MySQL Operator pod nodeSelector | `{}` |
4344
| `tolerations` | MySQL Operator pod tolerations | `[]` |
4445
| `affinity` | MySQL Operator pod affinity | `{}` |

deploy/charts/mysql-operator/templates/pdb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if and .Values.podDisruptionBudget.enabled (gt (int64 .Values.replicaCount) 1) }}
2-
apiVersion: policy/v1beta1
2+
apiVersion: policy/v1
33
kind: PodDisruptionBudget
44
metadata:
55
name: {{ include "mysql-operator.fullname" . }}

deploy/charts/mysql-operator/templates/podsecuritypolicy-role.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

deploy/charts/mysql-operator/templates/podsecuritypolicy-rolebinding.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

deploy/charts/mysql-operator/templates/podsecuritypolicy.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

deploy/charts/mysql-operator/values.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ podDisruptionBudget:
6767
enabled: true
6868
maxUnavailable: 1
6969

70-
podSecurityPolicy:
71-
enabled: false
72-
annotations:
73-
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
74-
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
75-
7670
resources: {}
7771
# We usually recommend not to specify default resources and to leave this as a conscious
7872
# choice for the user. This also increases chances charts run on environments with little

pkg/controller/mysqlcluster/internal/syncer/pdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package mysqlcluster
1818

1919
import (
20-
policy "k8s.io/api/policy/v1beta1"
20+
policy "k8s.io/api/policy/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
"k8s.io/apimachinery/pkg/runtime"
2323
"k8s.io/apimachinery/pkg/util/intstr"

pkg/controller/mysqlcluster/mysqlcluster_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/presslabs/controller-util/syncer"
2424
appsv1 "k8s.io/api/apps/v1"
2525
corev1 "k8s.io/api/core/v1"
26-
policyv1beta1 "k8s.io/api/policy/v1beta1"
26+
policyv1 "k8s.io/api/policy/v1"
2727
"k8s.io/apimachinery/pkg/api/errors"
2828
"k8s.io/apimachinery/pkg/runtime"
2929
"k8s.io/client-go/tools/record"
@@ -104,7 +104,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
104104
return err
105105
}
106106

107-
err = c.Watch(&source.Kind{Type: &policyv1beta1.PodDisruptionBudget{}}, &handler.EnqueueRequestForOwner{
107+
err = c.Watch(&source.Kind{Type: &policyv1.PodDisruptionBudget{}}, &handler.EnqueueRequestForOwner{
108108
IsController: true,
109109
OwnerType: &mysqlv1alpha1.MysqlCluster{},
110110
})

pkg/controller/mysqlcluster/mysqlcluster_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"golang.org/x/net/context"
3131
appsv1 "k8s.io/api/apps/v1"
3232
corev1 "k8s.io/api/core/v1"
33-
policyv1beta1 "k8s.io/api/policy/v1beta1"
33+
policyv1 "k8s.io/api/policy/v1"
3434
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3535
"k8s.io/apimachinery/pkg/runtime"
3636
"k8s.io/apimachinery/pkg/types"
@@ -156,7 +156,7 @@ var _ = Describe("MysqlCluster controller", func() {
156156
Namespace: cluster.Namespace,
157157
},
158158
},
159-
&policyv1beta1.PodDisruptionBudget{
159+
&policyv1.PodDisruptionBudget{
160160
ObjectMeta: metav1.ObjectMeta{
161161
Name: fmt.Sprintf("%s-mysql", name),
162162
Namespace: cluster.Namespace,
@@ -212,7 +212,7 @@ var _ = Describe("MysqlCluster controller", func() {
212212
Entry("reconciles the master service", "%s-mysql-master", &corev1.Service{}),
213213
Entry("reconciles the operator secret", "%s-mysql-operated", &corev1.Secret{}),
214214
Entry("reconciles the config map", "%s-mysql", &corev1.ConfigMap{}),
215-
Entry("reconciles the pod disruption budget", "%s-mysql", &policyv1beta1.PodDisruptionBudget{}),
215+
Entry("reconciles the pod disruption budget", "%s-mysql", &policyv1.PodDisruptionBudget{}),
216216
)
217217

218218
Describe("the reconciler", func() {

0 commit comments

Comments
 (0)