forked from percona/percona-xtradb-cluster-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
K8SPXC-1104: Use v1 as API version (percona#1255)
* K8SPXC-1104: Use v1 as API version * patch crVersion to ensure it's not empty * fix tests * fix kubectl_bin to detect errors correctly * fix tests * fix tests * add kubebuilder marker for scale subresource * fix validation-hook * fix haprox and users tests * fix affinity test * ignore bin/ * fix upgrade-consistency test Co-authored-by: Viacheslav Sarzhan <[email protected]>
- Loading branch information
Showing
52 changed files
with
33,395 additions
and
48,971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
NAME ?= percona-xtradb-cluster-operator | ||
IMAGE_TAG_OWNER ?= perconalab | ||
IMAGE_TAG_BASE ?= $(IMAGE_TAG_OWNER)/$(NAME) | ||
VERSION ?= $(shell git rev-parse --abbrev-ref HEAD | sed -e 's^/^-^g; s^[.]^-^g;' | tr '[:upper:]' '[:lower:]') | ||
IMAGE ?= $(IMAGE_TAG_BASE):$(VERSION) | ||
DEPLOYDIR = ./deploy | ||
|
||
all: build | ||
|
||
help: ## Display this help. | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
generate: controller-gen ## Generate CRDs and RBAC files | ||
$(CONTROLLER_GEN) crd:maxDescLen=0,allowDangerousTypes=true rbac:roleName=$(NAME) webhook paths="./..." output:crd:artifacts:config=config/crd/bases ## Generate WebhookConfiguration, Role and CustomResourceDefinition objects. | ||
$(CONTROLLER_GEN) object paths="./..." ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. | ||
|
||
$(DEPLOYDIR)/crd.yaml: kustomize generate | ||
$(KUSTOMIZE) build config/crd/ > $(DEPLOYDIR)/crd.yaml | ||
|
||
$(DEPLOYDIR)/bundle.yaml: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/rbac.yaml $(DEPLOYDIR)/operator.yaml ## Generate deploy/bundle.yaml | ||
cat $(DEPLOYDIR)/crd.yaml <(echo ---) $(DEPLOYDIR)/rbac.yaml <(echo ---) $(DEPLOYDIR)/operator.yaml > $(DEPLOYDIR)/bundle.yaml | ||
|
||
$(DEPLOYDIR)/cw-bundle.yaml: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/cw-rbac.yaml $(DEPLOYDIR)/cw-operator.yaml ## Generate deploy/cw-bundle.yaml | ||
cat $(DEPLOYDIR)/crd.yaml <(echo ---) $(DEPLOYDIR)/cw-rbac.yaml <(echo ---) $(DEPLOYDIR)/cw-operator.yaml > $(DEPLOYDIR)/cw-bundle.yaml | ||
|
||
manifests: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/bundle.yaml $(DEPLOYDIR)/cw-bundle.yaml ## Put generated manifests to deploy directory | ||
|
||
##@ Build | ||
|
||
.PHONY: build | ||
build: generate ## Build docker image for operator | ||
VERSION=$(VERSION) IMAGE=$(IMAGE) ./e2e-tests/build | ||
|
||
##@ Deployment | ||
|
||
install: manifests ## Install CRDs, rbac | ||
kubectl apply --server-side -f $(DEPLOYDIR)/crd.yaml | ||
kubectl apply -f $(DEPLOYDIR)/rbac.yaml | ||
|
||
uninstall: manifests ## Uninstall CRDs, rbac | ||
kubectl delete -f $(DEPLOYDIR)/crd.yaml | ||
kubectl delete -f $(DEPLOYDIR)/rbac.yaml | ||
|
||
.PHONY: deploy | ||
deploy: ## Deploy operator | ||
yq eval '(.spec.template.spec.containers[] | select(.name=="$(NAME)") | .image) = "$(IMAGE)"' $(DEPLOYDIR)/operator.yaml | kubectl apply -f - | ||
|
||
undeploy: ## Undeploy operator | ||
kubectl delete -f $(DEPLOYDIR)/operator.yaml | ||
|
||
# go-get-tool will 'go get' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-get-tool | ||
@[ -f $(1) ] || { \ | ||
set -e ;\ | ||
TMP_DIR=$$(mktemp -d) ;\ | ||
cd $$TMP_DIR ;\ | ||
go mod init tmp ;\ | ||
echo "Downloading $(2)" ;\ | ||
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ | ||
rm -rf $$TMP_DIR ;\ | ||
} | ||
endef | ||
|
||
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen | ||
controller-gen: ## Download controller-gen locally if necessary. | ||
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected]) | ||
|
||
KUSTOMIZE = $(shell pwd)/bin/kustomize | ||
kustomize: ## Download kustomize locally if necessary. | ||
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected]) |
123 changes: 123 additions & 0 deletions
123
config/crd/bases/pxc.percona.com_perconaxtradbclusterbackups.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.8.0 | ||
creationTimestamp: null | ||
name: perconaxtradbclusterbackups.pxc.percona.com | ||
spec: | ||
group: pxc.percona.com | ||
names: | ||
kind: PerconaXtraDBClusterBackup | ||
listKind: PerconaXtraDBClusterBackupList | ||
plural: perconaxtradbclusterbackups | ||
shortNames: | ||
- pxc-backup | ||
- pxc-backups | ||
singular: perconaxtradbclusterbackup | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- description: Cluster name | ||
jsonPath: .spec.pxcCluster | ||
name: Cluster | ||
type: string | ||
- description: Storage name from pxc spec | ||
jsonPath: .status.storageName | ||
name: Storage | ||
type: string | ||
- description: Backup destination | ||
jsonPath: .status.destination | ||
name: Destination | ||
type: string | ||
- description: Job status | ||
jsonPath: .status.state | ||
name: Status | ||
type: string | ||
- description: Completed time | ||
jsonPath: .status.completed | ||
name: Completed | ||
type: date | ||
- jsonPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
type: string | ||
kind: | ||
type: string | ||
metadata: | ||
type: object | ||
priorityClassName: | ||
type: string | ||
schedulerName: | ||
type: string | ||
spec: | ||
properties: | ||
pxcCluster: | ||
type: string | ||
storageName: | ||
type: string | ||
type: object | ||
status: | ||
properties: | ||
azure: | ||
properties: | ||
container: | ||
type: string | ||
credentialsSecret: | ||
type: string | ||
endpointUrl: | ||
type: string | ||
storageClass: | ||
type: string | ||
type: object | ||
completed: | ||
format: date-time | ||
type: string | ||
destination: | ||
type: string | ||
image: | ||
type: string | ||
lastscheduled: | ||
format: date-time | ||
type: string | ||
s3: | ||
properties: | ||
bucket: | ||
type: string | ||
credentialsSecret: | ||
type: string | ||
endpointUrl: | ||
type: string | ||
region: | ||
type: string | ||
type: object | ||
sslInternalSecretName: | ||
type: string | ||
sslSecretName: | ||
type: string | ||
state: | ||
type: string | ||
storage_type: | ||
type: string | ||
storageName: | ||
type: string | ||
vaultSecretName: | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
180 changes: 180 additions & 0 deletions
180
config/crd/bases/pxc.percona.com_perconaxtradbclusterrestores.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.8.0 | ||
creationTimestamp: null | ||
name: perconaxtradbclusterrestores.pxc.percona.com | ||
spec: | ||
group: pxc.percona.com | ||
names: | ||
kind: PerconaXtraDBClusterRestore | ||
listKind: PerconaXtraDBClusterRestoreList | ||
plural: perconaxtradbclusterrestores | ||
shortNames: | ||
- pxc-restore | ||
- pxc-restores | ||
singular: perconaxtradbclusterrestore | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- description: Cluster name | ||
jsonPath: .spec.pxcCluster | ||
name: Cluster | ||
type: string | ||
- description: Job status | ||
jsonPath: .status.state | ||
name: Status | ||
type: string | ||
- description: Completed time | ||
jsonPath: .status.completed | ||
name: Completed | ||
type: date | ||
- jsonPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
type: string | ||
kind: | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
backupName: | ||
type: string | ||
backupSource: | ||
properties: | ||
azure: | ||
properties: | ||
container: | ||
type: string | ||
credentialsSecret: | ||
type: string | ||
endpointUrl: | ||
type: string | ||
storageClass: | ||
type: string | ||
type: object | ||
completed: | ||
format: date-time | ||
type: string | ||
destination: | ||
type: string | ||
image: | ||
type: string | ||
lastscheduled: | ||
format: date-time | ||
type: string | ||
s3: | ||
properties: | ||
bucket: | ||
type: string | ||
credentialsSecret: | ||
type: string | ||
endpointUrl: | ||
type: string | ||
region: | ||
type: string | ||
type: object | ||
sslInternalSecretName: | ||
type: string | ||
sslSecretName: | ||
type: string | ||
state: | ||
type: string | ||
storage_type: | ||
type: string | ||
storageName: | ||
type: string | ||
vaultSecretName: | ||
type: string | ||
type: object | ||
pitr: | ||
properties: | ||
backupSource: | ||
properties: | ||
azure: | ||
properties: | ||
container: | ||
type: string | ||
credentialsSecret: | ||
type: string | ||
endpointUrl: | ||
type: string | ||
storageClass: | ||
type: string | ||
type: object | ||
completed: | ||
format: date-time | ||
type: string | ||
destination: | ||
type: string | ||
image: | ||
type: string | ||
lastscheduled: | ||
format: date-time | ||
type: string | ||
s3: | ||
properties: | ||
bucket: | ||
type: string | ||
credentialsSecret: | ||
type: string | ||
endpointUrl: | ||
type: string | ||
region: | ||
type: string | ||
type: object | ||
sslInternalSecretName: | ||
type: string | ||
sslSecretName: | ||
type: string | ||
state: | ||
type: string | ||
storage_type: | ||
type: string | ||
storageName: | ||
type: string | ||
vaultSecretName: | ||
type: string | ||
type: object | ||
date: | ||
type: string | ||
gtid: | ||
type: string | ||
type: | ||
type: string | ||
type: object | ||
pxcCluster: | ||
type: string | ||
type: object | ||
status: | ||
properties: | ||
comments: | ||
type: string | ||
completed: | ||
format: date-time | ||
type: string | ||
lastscheduled: | ||
format: date-time | ||
type: string | ||
state: | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.