Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Fix etcd operator to work with k8s 1.22 #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/coreos/etcd-operator

go 1.15
go 1.16

require (
cloud.google.com/go/storage v1.6.0
Expand Down
13 changes: 13 additions & 0 deletions manifests/embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Package manifests has the CRD manifests needed to bootstrap the operator
// the manifest files in this directory are autogenerated from the CRDs in
// this repository with
//
// ```
// controller-gen crd paths=./pkg/apis/etcd/v1beta2/... output:crd:artifacts:config=./manifests
// ```
package manifests

import "embed"

//go:embed *.yaml
var FS embed.FS
196 changes: 196 additions & 0 deletions manifests/etcd.database.coreos.com_etcdbackups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: etcdbackups.etcd.database.coreos.com
spec:
group: etcd.database.coreos.com
names:
kind: EtcdBackup
listKind: EtcdBackupList
plural: etcdbackups
singular: etcdbackup
scope: Namespaced
versions:
- name: v1beta2
schema:
openAPIV3Schema:
description: EtcdBackup represents a Kubernetes EtcdBackup Custom Resource.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BackupSpec contains a backup specification for an etcd cluster.
properties:
abs:
description: ABS defines the ABS backup source spec.
properties:
absSecret:
description: The name of the secret object that stores the Azure
storage credential
type: string
path:
description: 'Path is the full abs path where the backup is saved.
The format of the path must be: "<abs-container-name>/<path-to-backup-file>"
e.g: "myabscontainer/etcd.backup"'
type: string
type: object
allowSelfSignedCertificates:
description: If AllowSelfSignedCertificates is true, set the InsecureSkipVerify
flag for TLS connections
type: boolean
backupPolicy:
description: BackupPolicy configures the backup process.
properties:
backupIntervalInSecond:
description: BackupIntervalInSecond is to specify how often operator
take snapshot 0 is magic number to indicate one-shot backup
format: int64
type: integer
maxBackups:
description: MaxBackups is to specify how many backups we want
to keep 0 is magic number to indicate un-limited backups
type: integer
timeoutInSecond:
description: TimeoutInSecond is the maximal allowed time in second
of the entire backup process.
format: int64
type: integer
type: object
clientTLSSecret:
description: 'ClientTLSSecret is the secret containing the etcd TLS
client certs and must contain the following data items: data: "etcd-client.crt":
<pem-encoded-cert> "etcd-client.key": <pem-encoded-key> "etcd-client-ca.crt":
<pem-encoded-ca-cert>'
type: string
etcdEndpoints:
description: EtcdEndpoints specifies the endpoints of an etcd cluster.
When multiple endpoints are given, the backup operator retrieves
the backup from the endpoint that has the most up-to-date state.
The given endpoints must belong to the same etcd cluster.
items:
type: string
type: array
gcs:
description: GCS defines the GCS backup source spec.
properties:
gcpSecret:
description: "The name of the secret object that stores the Google
storage credential containing at most ONE of the following:
An access token with file name of 'access-token'. JSON credentials
with file name of 'credentials.json'. \n If omitted, client
will use the default application credentials."
type: string
path:
description: 'Path is the full GCS path where the backup is saved.
The format of the path must be: "<gcs-bucket-name>/<path-to-backup-file>"
e.g: "mygcsbucket/etcd.backup"'
type: string
type: object
oss:
description: OSS defines the OSS backup source spec.
properties:
endpoint:
description: "Endpoint is the OSS service endpoint on alibaba
cloud, defaults to \"http://oss-cn-hangzhou.aliyuncs.com\".
\n Details about regions and endpoints, see: https://www.alibabacloud.com/help/doc-detail/31837.htm"
type: string
ossSecret:
description: "The name of the secret object that stores the credential
which will be used to access Alibaba Cloud OSS. \n The secret
must contain the following keys/fields: accessKeyID accessKeySecret
\n The format of secret: \n apiVersion: v1 kind: Secret metadata:
name: <my-credential-name> type: Opaque data: accessKeyID: <base64
of my-access-key-id> accessKeySecret: <base64 of my-access-key-secret>"
type: string
path:
description: 'Path is the full abs path where the backup is saved.
The format of the path must be: "<oss-bucket-name>/<path-to-backup-file>"
e.g: "mybucket/etcd.backup"'
type: string
type: object
s3:
description: S3 defines the S3 backup source spec.
properties:
awsSecret:
description: "The name of the secret object that stores the AWS
credential and config files. The file name of the credential
MUST be 'credentials'. The file name of the config MUST be 'config'.
The profile to use in both files will be 'default'. \n AWSSecret
overwrites the default etcd operator wide AWS credential and
config."
type: string
endpoint:
description: Endpoint if blank points to aws. If specified, can
point to s3 compatible object stores.
type: string
forcePathStyle:
description: ForcePathStyle forces to use path style over the
default subdomain style. This is useful when you have an s3
compatible endpoint that doesn't support subdomain buckets.
type: boolean
path:
description: 'Path is the full s3 path where the backup is saved.
The format of the path must be: "<s3-bucket-name>/<path-to-backup-file>"
e.g: "mybucket/etcd.backup"'
type: string
type: object
storageType:
description: StorageType is the etcd backup storage type. We need
this field because CRD doesn't support validation against invalid
fields and we cannot verify invalid backup storage source.
type: string
type: object
status:
description: BackupStatus represents the status of the EtcdBackup Custom
Resource.
properties:
Reason:
description: Reason indicates the reason for any backup related failures.
type: string
etcdRevision:
description: EtcdRevision is the revision of etcd's KV store where
the backup is performed on.
format: int64
type: integer
etcdVersion:
description: EtcdVersion is the version of the backup etcd server.
type: string
lastExecutionDate:
description: Last execution date. First it will be creation timestamp,
later on it will be last execution date despite successful or failed
run. This field is used when pod is restarted ticked should be create
from this timestamp not current timestamp
format: date-time
type: string
lastSuccessDate:
description: LastSuccessDate indicate the time to get snapshot last
time
format: date-time
type: string
succeeded:
description: Succeeded indicates if the backup has Succeeded.
type: boolean
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading