Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPXC-1342 community bundle generation. #1843

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
653e0a5
fix pmm version
nmarukovich May 9, 2024
0f3ff5c
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich May 14, 2024
baf85ee
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Jul 4, 2024
f75e79a
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Jul 9, 2024
e366284
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Jul 31, 2024
83e83f6
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Aug 6, 2024
e7f70f5
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Aug 12, 2024
48e0e4d
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Aug 16, 2024
552d133
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Sep 23, 2024
603c95d
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Sep 27, 2024
44a7345
Merge branch 'main' of github.com:percona/percona-xtradb-cluster-oper…
nmarukovich Oct 4, 2024
56e5199
K8SPXC-1342_bundle_generation
nmarukovich Oct 13, 2024
94f5dd7
fix makefile
nmarukovich Oct 13, 2024
af404f3
update makefile and fix some mistakes
nmarukovich Oct 13, 2024
c965622
Merge branch 'main' into K8SPXC-1342_bundle_generation
nmarukovich Oct 14, 2024
7810456
delete unnesseary in the makefile
nmarukovich Oct 14, 2024
d6ba23f
Merge branch 'K8SPXC-1342_bundle_generation' of github.com:percona/pe…
nmarukovich Oct 14, 2024
5669d2d
delete unnesseary in the makefile
nmarukovich Oct 14, 2024
3cd495f
update cluster version Jenkinsfile
nmarukovich Oct 16, 2024
971438e
add redhat and marketplace
nmarukovich Oct 16, 2024
752a1a6
fix annotations
nmarukovich Oct 16, 2024
67d040b
Apply suggestions from code review
nmarukovich Oct 16, 2024
978bd65
update codeowners
nmarukovich Oct 16, 2024
4e3fa75
fix dependabot.yml
nmarukovich Oct 16, 2024
1db9ca2
update PR
nmarukovich Oct 17, 2024
78739b4
Apply suggestions from code review
nmarukovich Oct 17, 2024
4721a9b
delete unused
nmarukovich Oct 17, 2024
5131198
Apply suggestions from code review
nmarukovich Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* @hors @egegunes @inelpandzic @pooknull
/e2e-tests/ @tplavcic @nmarukovich @ptankov @jvpasinatto @eleo007
Jenkinsfile @tplavcic @nmarukovich @ptankov @jvpasinatto @eleo007
* @hors @egegunes @inelpandzic @pooknull @nmarukovich
/e2e-tests/ @nmarukovich @ptankov @jvpasinatto @eleo007
Jenkinsfile @nmarukovich @ptankov @jvpasinatto @eleo007
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ updates:
time: "01:00"
reviewers:
- hors
- tplavcic
- nmarukovich
ignore:
# ignore patch updates for all dependencies
- dependency-name: "*"
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ e2e-tests/init-deploy/smallrun
deploy/crds

.editorconfig
projects/
installers/olm/operator_*.yaml
installers/olm/bundles


2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void createCluster(String CLUSTER_SUFFIX) {
gcloud config set project $GCP_PROJECT
gcloud container clusters list --filter $CLUSTER_NAME-${CLUSTER_SUFFIX} --zone $region --format='csv[no-heading](name)' | xargs gcloud container clusters delete --zone $region --quiet || true

gcloud container clusters create --zone $region $CLUSTER_NAME-${CLUSTER_SUFFIX} --cluster-version=1.27 --machine-type=n1-standard-4 --preemptible --disk-size 30 --num-nodes=\$NODES_NUM --network=jenkins-vpc --subnetwork=jenkins-${CLUSTER_SUFFIX} --no-enable-autoupgrade --cluster-ipv4-cidr=/21 --labels delete-cluster-after-hours=6 && \
gcloud container clusters create --zone $region $CLUSTER_NAME-${CLUSTER_SUFFIX} --cluster-version=1.28 --machine-type=n1-standard-4 --preemptible --disk-size 30 --num-nodes=\$NODES_NUM --network=jenkins-vpc --subnetwork=jenkins-${CLUSTER_SUFFIX} --no-enable-autoupgrade --cluster-ipv4-cidr=/21 --labels delete-cluster-after-hours=6 && \
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user jenkins@"$GCP_PROJECT".iam.gserviceaccount.com || ret_val=\$?
if [ \${ret_val} -eq 0 ]; then break; fi
ret_num=\$((ret_num + 1))
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ SED := $(shell which gsed || which sed)
VERSION ?= $(shell git rev-parse --abbrev-ref HEAD | $(SED) -e 's^/^-^g; s^[.]^-^g;' | tr '[:upper:]' '[:lower:]')
IMAGE ?= $(IMAGE_TAG_BASE):$(VERSION)
DEPLOYDIR = ./deploy

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.23

Expand Down
10 changes: 10 additions & 0 deletions config/bundle/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
- ../rbac/namespace
- ../manager/namespace
images:
- name: percona-xtradb-cluster-operator
newName: perconalab/percona-xtradb-cluster-operator
newTag: main
5 changes: 5 additions & 0 deletions config/community/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../operator
13 changes: 13 additions & 0 deletions config/manager/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- manager-cluster.yaml
commonLabels:
app.kubernetes.io/component: operator
app.kubernetes.io/instance: percona-xtradb-cluster-operator
app.kubernetes.io/name: percona-xtradb-cluster-operator
app.kubernetes.io/part-of: percona-xtradb-cluster-operator
images:
- name: pxc-operator
newName: perconalab/percona-xtradb-cluster-operator
newTag: 1.15.0
69 changes: 69 additions & 0 deletions config/manager/cluster/manager-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: percona-xtradb-cluster-operator
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: operator
app.kubernetes.io/instance: percona-xtradb-cluster-operator
app.kubernetes.io/name: percona-xtradb-cluster-operator
app.kubernetes.io/part-of: percona-xtradb-cluster-operator
strategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/component: operator
app.kubernetes.io/instance: percona-xtradb-cluster-operator
app.kubernetes.io/name: percona-xtradb-cluster-operator
app.kubernetes.io/part-of: percona-xtradb-cluster-operator
spec:
terminationGracePeriodSeconds: 600
containers:
- command:
- percona-xtradb-cluster-operator
env:
- name: LOG_STRUCTURED
value: 'false'
- name: LOG_LEVEL
value: INFO
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OPERATOR_NAME
value: percona-xtradb-cluster-operator
- name: DISABLE_TELEMETRY
value: "false"
image: perconalab/percona-xtradb-cluster-operator:main
imagePullPolicy: Always
resources:
limits:
cpu: 200m
memory: 500Mi
requests:
cpu: 100m
memory: 20Mi
livenessProbe:
failureThreshold: 3
httpGet:
path: /metrics
port: metrics
scheme: HTTP
name: percona-xtradb-cluster-operator
ports:
- containerPort: 8080
name: metrics
protocol: TCP
serviceAccountName: percona-xtradb-cluster-operator


13 changes: 13 additions & 0 deletions config/manager/namespace/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- manager-namespace.yaml
commonLabels:
app.kubernetes.io/component: operator
app.kubernetes.io/instance: percona-xtradb-cluster-operator
app.kubernetes.io/name: percona-xtradb-cluster-operator
app.kubernetes.io/part-of: percona-xtradb-cluster-operator
images:
- name: pxc-operator
newName: perconalab/percona-xtradb-cluster-operator
newTag: 1.15.0
68 changes: 68 additions & 0 deletions config/manager/namespace/manager-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: percona-xtradb-cluster-operator
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: operator
app.kubernetes.io/instance: percona-xtradb-cluster-operator
app.kubernetes.io/name: percona-xtradb-cluster-operator
app.kubernetes.io/part-of: percona-xtradb-cluster-operator
strategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/component: operator
app.kubernetes.io/instance: percona-xtradb-cluster-operator
app.kubernetes.io/name: percona-xtradb-cluster-operator
app.kubernetes.io/part-of: percona-xtradb-cluster-operator
spec:
terminationGracePeriodSeconds: 600
containers:
- command:
- percona-xtradb-cluster-operator
env:
- name: LOG_STRUCTURED
value: 'false'
- name: LOG_LEVEL
value: INFO
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OPERATOR_NAME
value: percona-xtradb-cluster-operator
- name: DISABLE_TELEMETRY
value: "false"
image: perconalab/percona-xtradb-cluster-operator:main
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /metrics
port: metrics
scheme: HTTP
resources:
limits:
cpu: 200m
memory: 500Mi
requests:
cpu: 100m
memory: 20Mi
name: percona-xtradb-cluster-operator
ports:
- containerPort: 8080
name: metrics
protocol: TCP
serviceAccountName: percona-xtradb-cluster-operator
6 changes: 6 additions & 0 deletions config/marketplace/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../operator

6 changes: 6 additions & 0 deletions config/operator/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../bundle

7 changes: 7 additions & 0 deletions config/rbac/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- service_account.yaml
- role.yaml
- role_binding.yaml
130 changes: 130 additions & 0 deletions config/rbac/cluster/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: percona-xtradb-cluster-operator
rules:
- apiGroups:
- pxc.percona.com
resources:
- perconaxtradbclusters
- perconaxtradbclusters/status
- perconaxtradbclusterbackups
- perconaxtradbclusterbackups/status
- perconaxtradbclusterrestores
- perconaxtradbclusterrestores/status
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- pods
- pods/exec
- pods/log
- configmaps
- services
- persistentvolumeclaims
- secrets
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments
- replicasets
- statefulsets
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- batch
resources:
- jobs
- cronjobs
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- events.k8s.io
- ""
resources:
- events
verbs:
- create
- patch
- get
- list
- watch
- apiGroups:
- certmanager.k8s.io
- cert-manager.io
resources:
- issuers
- certificates
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- deletecollection
13 changes: 13 additions & 0 deletions config/rbac/cluster/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: service-account-percona-xtradb-cluster-operator
subjects:
- kind: ServiceAccount
name: percona-xtradb-cluster-operator
namespace: "pxc-operator"
roleRef:
kind: ClusterRole
name: percona-xtradb-cluster-operator
apiGroup: rbac.authorization.k8s.io
5 changes: 5 additions & 0 deletions config/rbac/cluster/service_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: percona-xtradb-cluster-operator
Loading
Loading