Skip to content

Commit

Permalink
Add keda http add-on operator charts (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaosdoctor authored May 12, 2021
1 parent 1b12a48 commit 7886040
Show file tree
Hide file tree
Showing 9 changed files with 767 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/http-add-on.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: HTTP add-on Helm Chart CI
on: [pull_request]

jobs:
lint-helm-3-x:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Helm install
uses: Azure/setup-helm@v1

- name: Lint 'http-add-on' Helm chart
run: helm lint http-add-on

deploy-helm-3-x:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Helm install
uses: Azure/setup-helm@v1

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.0.0

- name: Show Kubernetes version
run: |
kubectl version
- name: Show Helm version
run: |
helm version
- name: Create keda namespace
run: kubectl create ns keda

- name: Install Keda chart
run: helm install keda kedacore/keda --namespace keda

- name: Template Helm chart
run: helm template http-add-on ./http-add-on/ --namespace keda

- name: Install Helm chart
run: helm install http-add-on ./http-add-on/ --namespace keda

- name: Get all HTTPScaledObjects
run: kubectl get httpscaledobjects

- name: Get all CRDs
run: kubectl get crds/httpscaledobjects
23 changes: 23 additions & 0 deletions http-add-on/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
37 changes: 37 additions & 0 deletions http-add-on/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: v2
name: keda-add-ons-http
description: Event-based autoscaler for HTTP workloads on Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.0.1
home: https://github.com/kedacore/http-add-on
sources:
- https://github.com/kedacore/http-add-on
maintainers:
- name: Ahmed ElSayed
email: ahmels@microsoft.com
- name: Tom Kerkhove
email: kerkhove.tom@gmail.com
- name: Zbynek Roubalik
email: zroubali@redhat.com
- name: Lucas Santos
email: ludossan@microsoft.com
- name: Aaron Schlesinger
email: aaron.schlesinger@microsoft.com
104 changes: 104 additions & 0 deletions http-add-on/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<p align="center"><img src="https://github.com/kedacore/keda/raw/main/images/logos/keda-word-colour.png" width="300"/></p>

<p style="font-size: 25px" align="center"><b>Kubernetes-based Event Driven Autoscaling - HTTP Add-On</b></p>
<p style="font-size: 25px" align="center">

The KEDA HTTP Add On allows Kubernetes users to automatically scale their HTTP servers up and down (including to/from zero) based on incoming HTTP traffic. Please see our [use cases document](./docs/use_cases.md) to learn more about how and why you would use this project.

| 🚧 **Alpha - Not for production** 🚧|
|---------------------------------------------|
| ⚠ The HTTP add-on is in [experimental stage](https://github.com/kedacore/keda/issues/538) and not ready for production. <br /><br />It is provided as-is without support.

>This codebase moves very quickly. We can't currently guarantee that any part of it will work. Neither the complete feature set nor known issues may be fully documented. Similarly, issues filed against this project may not be responded to quickly or at all. **We will release and announce a beta release of this project**, and after we do that, we will document and respond to issues properly.
## Walkthrough

Although this is an **alpha release** project right now, we have prepared a walkthrough document that with instructions on getting started for basic usage.

See that document at [docs/walkthrough.md](https://github.com/kedacore/http-add-on/tree/main/docs/walkthrough.md)

## Design

The HTTP add-on is composed of multiple mostly independent components. This design was chosen to allow for highly
customizable installations while allowing us to ship reasonable defaults.

- We have written a complete design document. Please see it at [docs/design.md](https://github.com/kedacore/http-add-on/tree/main/docs/design.md).
- For more context on the design, please see our [scope document](https://github.com/kedacore/http-add-on/tree/main/docs/scope.md).
- If you have further questions about the project, please see our [FAQ document](https://github.com/kedacore/http-add-on/tree/main/docs/faq.md).

## Installation

Please see the [complete installation instructions](https://github.com/kedacore/http-add-on/tree/main/docs/install.md).

## Contributing

Please see the [contributing documentation for all instructions](https://github.com/kedacore/http-add-on/tree/main/docs/contributing.md).

---
We are a Cloud Native Computing Foundation (CNCF) sandbox project.
<p align="center"><img src="https://raw.githubusercontent.com/kedacore/keda/main/images/logo-cncf.svg" height="75px"></p>

---

## TL;DR

```console
helm repo add kedacore https://kedacore.github.io/charts
helm repo update

helm install http-add-on kedacore/http-add-on --create-namespace --namespace keda
```

## Introduction

This chart bootstraps KEDA HTTP Add-on infrastructure on a Kubernetes cluster using the Helm package manager.

As part of that, it will install all the required Custom Resource Definitions (CRD).

## Installing the Chart

To install the chart with the release name `http-add-on`, please read the [install instructions on the official repository to get started](https://github.com/kedacore/http-add-on/tree/main/docs/install.md):

```console
$ helm install http-add-on kedacore/http-add-on --namespace keda
```

> **Important:** This chart **needs** KEDA installed in your cluster to work properly.
## Uninstalling the Chart

To uninstall/delete the `http-add-on` Helm chart:

```console
helm uninstall http-add-on
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following table lists the configurable parameters of the Promitor chart and
their default values.

| Parameter | Description | Default |
|:-----------------------------------------------------------|:------------------------------------------|:------------------------------------------------|
| `version` | Image tag for the http add on | The latest release |
| `images.operator` | Image name for the operator image component | `ghcr.io/kedacore/http-add-on-operator:latest` |
| `images.interceptor` | Image name for the interceptor image component | `ghcr.io/kedacore/http-add-on-interceptor:latest` |
| `images.scaler` | Image name for the scaler image component | `ghcr.io/kedacore/http-add-on-scaler:latest` |


Specify each parameter using the `--set key=value[,key=value]` argument to
`helm install`. For example:

```console
$ helm install http-add-on kedacore/http-add-on --namespace keda \
--set version=<different tag from app version>
```

Alternatively, a YAML file that specifies the values for the above parameters can
be provided while installing the chart. For example,

```console
helm install http-add-on kedacore/http-add-on --namespace keda -f values.yaml
```
167 changes: 167 additions & 0 deletions http-add-on/templates/crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{{- if .Values.crds.install }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: httpscaledobjects.http.keda.sh
spec:
group: http.keda.sh
names:
kind: HTTPScaledObject
listKind: HTTPScaledObjectList
plural: httpscaledobjects
shortNames:
- httpso
singular: httpscaledobject
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.scaleTargetRef.deploymentName
name: ScaleTargetDeploymentName
type: string
- jsonPath: .spec.scaleTargetRef
name: ScaleTargetServiceName
type: string
- jsonPath: .spec.scaleTargetRef
name: ScaleTargetPort
type: integer
- jsonPath: .spec.replicas.min
name: MinReplicas
type: integer
- jsonPath: .spec.replicas.max
name: MaxReplicas
type: integer
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.conditions[?(@.type=="HTTPScaledObjectIsReady")].status
name: Active
type: string
name: v1alpha1
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
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: HTTPScaledObjectSpec defines the desired state of HTTPScaledObject
properties:
replicas:
description: (optional) Replica information
properties:
max:
description: Maximum amount of replicas to have in the deployment (Default 100)
format: int32
type: integer
min:
description: Minimum amount of replicas to have in the deployment (Default 0)
format: int32
type: integer
type: object
scaleTargetRef:
description: The name of the deployment to route HTTP requests to (and to autoscale). Either this or Image must be set
properties:
deployment:
description: The name of the deployment to scale according to HTTP traffic
type: string
port:
description: The port to route to
format: int32
type: integer
service:
description: The name of the service to route to
type: string
required:
- deployment
- port
- service
type: object
required:
- scaleTargetRef
type: object
status:
description: HTTPScaledObjectStatus defines the observed state of HTTPScaledObject
properties:
conditions:
description: List of auditable conditions of the operator
items:
description: Condition to store the condition state
properties:
message:
description: A human readable message indicating details about the transition.
type: string
reason:
description: The reason for the condition's last transition.
enum:
- ErrorCreatingExternalScaler
- ErrorCreatingExternalScalerService
- CreatedExternalScaler
- ErrorCreatingInterceptorScaledObject
- ErrorCreatingAppScaledObject
- AppScaledObjectCreated
- InterceptorScaledObjectCreated
- ErrorCreatingInterceptor
- ErrorCreatingInterceptorAdminService
- ErrorCreatingInterceptorProxyService
- InterceptorCreated
- TerminatingResources
- InterceptorDeploymentTerminated
- InterceptorDeploymentTerminationError
- InterceptorAdminServiceTerminationError
- InterceptorAdminServiceTerminated
- InterceptorProxyServiceTerminationError
- InterceptorProxyServiceTerminated
- ExternalScalerDeploymentTerminationError
- ExternalScalerDeploymentTerminated
- ExternalScalerServiceTerminationError
- ExternalScalerServiceTerminated
- InterceptorScaledObjectTerminated
- AppScaledObjectTerminated
- AppScaledObjectTerminationError
- InterceptorScaledObjectTerminationError
- PendingCreation
- HTTPScaledObjectIsReady
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
timestamp:
description: Timestamp of the condition
type: string
type:
description: Type of condition
enum:
- Created
- Error
- Pending
- Unknown
- Terminating
- Terminated
- Ready
type: string
required:
- status
- type
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end -}}
Loading

0 comments on commit 7886040

Please sign in to comment.