Skip to content

Commit

Permalink
config CRD upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jmendesky committed Aug 31, 2022
1 parent 8754717 commit e32b131
Show file tree
Hide file tree
Showing 6 changed files with 501 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apis/config/v1alpha2/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Package v2 contains API Schema definitions for the config v2 API group
//+kubebuilder:object:generate=true
//+groupName=config.kubeflow.org
package v1alpha2

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "config.kubeflow.org", Version: "v1alpha2"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
39 changes: 39 additions & 0 deletions apis/config/v1alpha2/kfp_controller_config_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package v1alpha2

import (
"github.com/sky-uk/kfp-operator/apis"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
cfg "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1"
)

type Configuration struct {
PipelineStorage string `json:"pipelineStorage,omitempty"`
KfpEndpoint string `json:"kfpEndpoint,omitempty"`

WorkflowTemplatePrefix string `json:"workflowTemplatePrefix,omitempty"`

Multiversion bool `json:"multiversion,omitempty"`

DefaultBeamArgs []apis.NamedValue `json:"defaultBeamArgs,omitempty"`

DefaultExperiment string `json:"defaultExperiment,omitempty"`

Debug apis.DebugOptions `json:"debug,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

type KfpControllerConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Workflows Configuration `json:"spec,omitempty"`

cfg.ControllerManagerConfigurationSpec `json:"controller,omitempty"`
}

//+kubebuilder:object:root=true

func init() {
SchemeBuilder.Register(&KfpControllerConfig{})
}
59 changes: 59 additions & 0 deletions apis/config/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/config/v1alpha3/kfp_controller_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Configuration struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:storageversion

type KfpControllerConfig struct {
metav1.TypeMeta `json:",inline"`
Expand Down
191 changes: 191 additions & 0 deletions config/crd/bases/config.kubeflow.org_kfpcontrollerconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,197 @@ spec:
singular: kfpcontrollerconfig
scope: Namespaced
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
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
controller:
description: ControllerManagerConfigurationSpec defines the desired state
of GenericControllerManagerConfiguration.
properties:
cacheNamespace:
description: "CacheNamespace if specified restricts the manager's
cache to watch objects in the desired namespace Defaults to all
namespaces \n Note: If a namespace is specified, controllers can
still Watch for a cluster-scoped resource (e.g Node). For namespaced
resources the cache will only hold objects from the desired namespace."
type: string
controller:
description: Controller contains global configuration options for
controllers registered within this manager.
properties:
cacheSyncTimeout:
description: CacheSyncTimeout refers to the time limit set to
wait for syncing caches. Defaults to 2 minutes if not set.
format: int64
type: integer
groupKindConcurrency:
additionalProperties:
type: integer
description: "GroupKindConcurrency is a map from a Kind to the
number of concurrent reconciliation allowed for that controller.
\n When a controller is registered within this manager using
the builder utilities, users have to specify the type the controller
reconciles in the For(...) call. If the object's kind passed
matches one of the keys in this map, the concurrency for that
controller is set to the number specified. \n The key is expected
to be consistent in form with GroupKind.String(), e.g. ReplicaSet
in apps group (regardless of version) would be `ReplicaSet.apps`."
type: object
type: object
gracefulShutDown:
description: GracefulShutdownTimeout is the duration given to runnable
to stop before the manager actually returns on stop. To disable
graceful shutdown, set to time.Duration(0) To use graceful shutdown
without timeout, set to a negative duration, e.G. time.Duration(-1)
The graceful shutdown is skipped for safety reasons in case the
leader election lease is lost.
type: string
health:
description: Health contains the controller health configuration
properties:
healthProbeBindAddress:
description: HealthProbeBindAddress is the TCP address that the
controller should bind to for serving health probes
type: string
livenessEndpointName:
description: LivenessEndpointName, defaults to "healthz"
type: string
readinessEndpointName:
description: ReadinessEndpointName, defaults to "readyz"
type: string
type: object
leaderElection:
description: LeaderElection is the LeaderElection config to be used
when configuring the manager.Manager leader election
properties:
leaderElect:
description: leaderElect enables a leader election client to gain
leadership before executing the main loop. Enable this when
running replicated components for high availability.
type: boolean
leaseDuration:
description: leaseDuration is the duration that non-leader candidates
will wait after observing a leadership renewal until attempting
to acquire leadership of a led but unrenewed leader slot. This
is effectively the maximum duration that a leader can be stopped
before it is replaced by another candidate. This is only applicable
if leader election is enabled.
type: string
renewDeadline:
description: renewDeadline is the interval between attempts by
the acting master to renew a leadership slot before it stops
leading. This must be less than or equal to the lease duration.
This is only applicable if leader election is enabled.
type: string
resourceLock:
description: resourceLock indicates the resource object type that
will be used to lock during leader election cycles.
type: string
resourceName:
description: resourceName indicates the name of resource object
that will be used to lock during leader election cycles.
type: string
resourceNamespace:
description: resourceName indicates the namespace of resource
object that will be used to lock during leader election cycles.
type: string
retryPeriod:
description: retryPeriod is the duration the clients should wait
between attempting acquisition and renewal of a leadership.
This is only applicable if leader election is enabled.
type: string
required:
- leaderElect
- leaseDuration
- renewDeadline
- resourceLock
- resourceName
- resourceNamespace
- retryPeriod
type: object
metrics:
description: Metrics contains thw controller metrics configuration
properties:
bindAddress:
description: BindAddress is the TCP address that the controller
should bind to for serving prometheus metrics. It can be set
to "0" to disable the metrics serving.
type: string
type: object
syncPeriod:
description: SyncPeriod determines the minimum frequency at which
watched resources are reconciled. A lower period will correct entropy
more quickly, but reduce responsiveness to change if there are many
watched resources. Change this value only if you know what you are
doing. Defaults to 10 hours if unset. there will a 10 percent jitter
between the SyncPeriod of all controllers so that all controllers
will not send list requests simultaneously.
type: string
webhook:
description: Webhook contains the controllers webhook configuration
properties:
certDir:
description: CertDir is the directory that contains the server
key and certificate. if not set, webhook server would look up
the server key and certificate in {TempDir}/k8s-webhook-server/serving-certs.
The server key and certificate must be named tls.key and tls.crt,
respectively.
type: string
host:
description: Host is the hostname that the webhook server binds
to. It is used to set webhook.Server.Host.
type: string
port:
description: Port is the port that the webhook server serves at.
It is used to set webhook.Server.Port.
type: integer
type: object
type: object
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:
properties:
debug:
properties:
keepWorkflows:
type: boolean
type: object
defaultBeamArgs:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
defaultExperiment:
type: string
kfpEndpoint:
type: string
multiversion:
type: boolean
pipelineStorage:
type: string
workflowTemplatePrefix:
type: string
type: object
type: object
served: true
storage: false
subresources:
status: {}
- name: v1alpha3
schema:
openAPIV3Schema:
Expand Down
Loading

0 comments on commit e32b131

Please sign in to comment.