Skip to content

Commit

Permalink
change apiGroup to keda.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
Zbynek Roubalik committed Aug 6, 2020
1 parent c29e303 commit 1246a22
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 4,573 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ To be KEDA to be fully operational we need to deploy Metrics Server first.

1. Deploy CRDs and KEDA into `keda` namespace
```bash
kubectl apply -f deploy/crds/keda.k8s.io_scaledobjects_crd.yaml
kubectl apply -f deploy/crds/keda.k8s.io_triggerauthentications_crd.yaml
kubectl apply -f deploy/crds/keda.sh_scaledobjects_crd.yaml
kubectl apply -f deploy/crds/keda.sh_triggerauthentications_crd.yaml
kubectl apply -f deploy/
```
2. Scale down `keda-operator` Deployment
Expand Down
9 changes: 8 additions & 1 deletion deploy/10-cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ rules:
- deployments
- deployments/finalizers
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
Expand All @@ -44,7 +45,7 @@ rules:
- get
- create
- apiGroups:
- keda.k8s.io
- keda.sh
resources:
- '*'
verbs:
Expand All @@ -55,3 +56,9 @@ rules:
- horizontalpodautoscalers
verbs:
- '*'
- apiGroups:
- "*"
resources:
- "*/scale"
verbs:
- "*"
4,545 changes: 0 additions & 4,545 deletions deploy/crds/keda.k8s.io_scaledobjects_crd.yaml

This file was deleted.

123 changes: 123 additions & 0 deletions deploy/crds/keda.sh_scaledobjects_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: scaledobjects.keda.sh
spec:
additionalPrinterColumns:
- JSONPath: .status.scaleTargetKind
name: ScaleTargetKind
type: string
- JSONPath: .spec.scaleTargetRef.name
name: ScaleTargetName
type: string
- JSONPath: .spec.triggers[*].type
name: Triggers
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: keda.sh
names:
kind: ScaledObject
listKind: ScaledObjectList
plural: scaledobjects
singular: scaledobject
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: ScaledObject is a specification for a ScaledObject 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: ScaledObjectSpec is the spec for a ScaledObject resource
properties:
cooldownPeriod:
format: int32
type: integer
maxReplicaCount:
format: int32
type: integer
minReplicaCount:
format: int32
type: integer
pollingInterval:
format: int32
type: integer
scaleTargetRef:
description: ScaleTarget holds the a reference to the scale target Object
properties:
apiVersion:
type: string
containerName:
type: string
kind:
type: string
name:
type: string
required:
- name
type: object
triggers:
items:
description: ScaleTriggers reference the scaler that will be used
properties:
authenticationRef:
description: ScaledObjectAuthRef points to the TriggerAuthentication
object that is used to authenticate the scaler with the environment
properties:
name:
type: string
required:
- name
type: object
metadata:
additionalProperties:
type: string
type: object
name:
type: string
type:
type: string
required:
- metadata
- type
type: object
type: array
required:
- scaleTargetRef
- triggers
type: object
status:
description: ScaledObjectStatus is the status for a ScaledObject resource
properties:
externalMetricNames:
items:
type: string
type: array
lastActiveTime:
format: date-time
type: string
scaleTargetKind:
type: string
type: object
required:
- spec
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: triggerauthentications.keda.k8s.io
name: triggerauthentications.keda.sh
spec:
group: keda.k8s.io
group: keda.sh
names:
kind: TriggerAuthentication
listKind: TriggerAuthenticationList
Expand All @@ -17,12 +17,12 @@ spec:
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/api-conventions.md#resources'
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/api-conventions.md#types-kinds'
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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/keda/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package v1alpha1 contains API Schema definitions for the keda v1alpha1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=keda.k8s.io
// +groupName=keda.sh
package v1alpha1
4 changes: 2 additions & 2 deletions pkg/apis/keda/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Package v1alpha1 contains API Schema definitions for the keda v1alpha1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=keda.k8s.io
// +groupName=keda.sh
package v1alpha1

import (
Expand All @@ -12,7 +12,7 @@ import (

var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "keda.k8s.io", Version: "v1alpha1"}
SchemeGroupVersion = schema.GroupVersion{Group: "keda.sh", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
Expand Down
8 changes: 3 additions & 5 deletions tests/scalers/azure-blob.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test.after.always('clean up azure-blob deployment', t => {
const resources = [
'secret/test-secrets',
'deployment.apps/test-deployment',
'scaledobject.keda.k8s.io/test-scaledobject'
'scaledobject.keda.sh/test-scaledobject'
]

for (const resource of resources) {
Expand Down Expand Up @@ -124,15 +124,13 @@ spec:
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: keda.k8s.io/v1alpha1
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: test-scaledobject
labels:
deploymentName: test-deployment
spec:
scaleTargetRef:
deploymentName: test-deployment
name: test-deployment
pollingInterval: 20
maxReplicaCount: 2
cooldownPeriod: 10
Expand Down
10 changes: 4 additions & 6 deletions tests/scalers/azure-queue-trigger-auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test.after.always.cb('clean up azure-queue deployment', t => {
const resources = [
'secret/test-secrets',
'deployment.apps/test-deployment',
'scaledobject.keda.k8s.io/test-scaledobject',
'scaledobject.keda.sh/test-scaledobject',
]

for (const resource of resources) {
Expand Down Expand Up @@ -131,15 +131,13 @@ spec:
- name: FUNCTIONS_WORKER_RUNTIME
value: node
---
apiVersion: keda.k8s.io/v1alpha1
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: test-scaledobject
labels:
deploymentName: test-deployment
spec:
scaleTargetRef:
deploymentName: test-deployment
name: test-deployment
pollingInterval: 5
maxReplicaCount: 1
cooldownPeriod: 10
Expand All @@ -150,7 +148,7 @@ spec:
metadata:
queueName: ${queueName}
---
apiVersion: keda.k8s.io/v1alpha1
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: azure-queue-auth
Expand Down
8 changes: 3 additions & 5 deletions tests/scalers/azure-queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test.after.always.cb('clean up azure-queue deployment', t => {
const resources = [
'secret/test-secrets',
'deployment.apps/test-deployment',
'scaledobject.keda.k8s.io/test-scaledobject',
'scaledobject.keda.sh/test-scaledobject',
]

for (const resource of resources) {
Expand Down Expand Up @@ -134,15 +134,13 @@ spec:
name: test-secrets
key: AzureWebJobsStorage
---
apiVersion: keda.k8s.io/v1alpha1
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: test-scaledobject
labels:
deploymentName: test-deployment
spec:
scaleTargetRef:
deploymentName: test-deployment
name: test-deployment
pollingInterval: 5
maxReplicaCount: 4
cooldownPeriod: 10
Expand Down
4 changes: 2 additions & 2 deletions tests/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ test.serial('Deploy Keda', t => {
}
}

if (sh.exec('kubectl apply -f ../deploy/crds/keda.k8s.io_scaledobjects_crd.yaml').code !== 0) {
if (sh.exec('kubectl apply -f ../deploy/crds/keda.sh_scaledobjects_crd.yaml').code !== 0) {
t.fail('error deploying keda. ' + result)
}
if (
sh.exec('kubectl apply -f ../deploy/crds/keda.k8s.io_triggerauthentications_crd.yaml').code !==
sh.exec('kubectl apply -f ../deploy/crds/keda.sh_triggerauthentications_crd.yaml').code !==
0
) {
t.fail('error deploying keda. ' + result)
Expand Down

0 comments on commit 1246a22

Please sign in to comment.