Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm chart for swck v0.7.0 #91

Merged
merged 4 commits into from
Jan 3, 2023
Merged
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
10 changes: 7 additions & 3 deletions .github/workflows/e2e.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ name: Test
on:
pull_request:
push:
paths:
- '!**.md'
paths-ignore:
- '**.md'
branches:
- master

Expand Down Expand Up @@ -61,10 +61,14 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Run E2E Test
- name: Run Skywalking E2E Test
uses: apache/skywalking-infra-e2e@45584853d6f660102c523b1e9cb5815d12ae55d3
with:
e2e-file: $GITHUB_WORKSPACE/test/e2e/e2e.yaml
- name: Run SWCK E2E Test
uses: apache/skywalking-infra-e2e@afdf1cca0519d65bc480d8680b7a27f9b41fc421
with:
e2e-file: $GITHUB_WORKSPACE/test/e2e/swck/e2e.yaml
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
name: Upload Logs
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Changes by Version
==================
Release Notes.

4.5.0
------------------

- Add helm chart for swck v0.7.0.

4.4.0
------------------

Expand Down
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,66 @@ helm install "${SKYWALKING_RELEASE_NAME}" \
```shell
export REPO=skywalking
helm repo add ${REPO} https://apache.jfrog.io/artifactory/skywalking-helm
## Install development version of Skywalking using master branch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also publish the snapshot Helm Chart to ghcr.io and publish the released to Docker Hub, if you want me to do these please let me know

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the released image has already been published to Docker Hub, but the helm chart has not. It looks like we need to have access to this address https://apache.jfrog.io/artifactory/skywalking-helm. I would be very appreciative if you could publish it, and I will update the relevant doc for the published helm chart later.


This is needed **only** when you want to install Skywalking from master branch.

```shell script
export REPO=chart
git clone https://github.com/apache/skywalking-kubernetes
cd skywalking-kubernetes
helm repo add elastic https://helm.elastic.co
helm dep up ${REPO}/skywalking
```

## Install development version of SWCK Adapter using master branch

This is needed **only** when you want to install [SWCK Adapter](https://github.com/apache/skywalking-swck/tree/master/adapter) from master branch.

SWCK Adapter chart detailed configuration can be found at [Adapter Chart Readme](./chart/adapter/README.md).

You can install the Adapter with the default configuration as follows.

```shell script
export REPO=chart
git clone https://github.com/apache/skywalking-kubernetes
cd skywalking-kubernetes
helm -n skywalking-custom-metrics-system install adapter ${REPO}/adapter --create-namespace
```

## Install development version of SWCK Operator using master branch

This is needed **only** when you want to install [SWCK Operator](https://github.com/apache/skywalking-swck/tree/master/operator) from master branch.

Before installing Operator, you have to install [cert-manager](https://cert-manager.io/) at first.

```shell script
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.yaml
```

SWCK Operator chart detailed configuration can be found at [Operator Chart Readme](./chart/operator/README.md).

You can install the Operator with the default configuration as follows.

```shell script
export REPO=chart
git clone https://github.com/apache/skywalking-kubernetes
cd skywalking-kubernetes
helm -n skywalking-swck-system install operator ${REPO}/operator
```

## Install a specific version of SkyWalking & Elasticsearch

In theory, you can deploy all versions of SkyWalking that are >= 6.0.0-GA, by specifying the desired `oap.image.tag`/`ui.image.tag`.

Please note that some configurations that are added in the later versions of SkyWalking may not work in earlier versions, and thus if you
specify those configurations, they may take no effect.

here are some examples.

- Deploy SkyWalking 9.2.0 & Elasticsearch 6.8.6

```shell script
helm install "${SKYWALKING_RELEASE_NAME}" ${REPO}/skywalking -n "${SKYWALKING_RELEASE_NAMESPACE}" \
--set oap.image.tag=9.2.0 \
--set oap.storageType=elasticsearch \
Expand Down
37 changes: 37 additions & 0 deletions chart/adapter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
OWNERS
28 changes: 28 additions & 0 deletions chart/adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v2
name: skywalking-swck-adapter
home: https://github.com/apache/skywalking-swck/tree/master/adapter
version: 0.7.0
description: Provide custom metrics coming from SkyWalking OAP cluster for autoscaling by Kubernetes HPA
icon: https://raw.githubusercontent.com/apache/skywalking-kubernetes/master/logo/sw-logo-for-chart.jpg
sources:
- https://github.com/apache/skywalking-kubernetes
maintainers:
- name: hanahmily
email: hanahmily@gmail.com
- name: dashanji
email: dashanjic@gmail.com
73 changes: 73 additions & 0 deletions chart/adapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Apache SWCK Adapter Helm Chart

[Apache SWCK Adapter](https://github.com/apache/skywalking-swck/tree/master/adapter) is a component that provides custom metrics coming from SkyWalking OAP cluster for autoscaling by [Kubernetes HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/).

## Introduction

This chart bootstraps a [SWCK Adapter](https://github.com/apache/skywalking-swck/blob/master/docs/custom-metrics-adapter.md) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.24.0+
- Helm 3

## Installing the Chart

To install the chart with the release name `my-release`:

```shell
$ helm install my-release adapter -n <namespace>
```

The command deploys the adapter on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`

## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```shell
$ helm uninstall my-release -n <namespace>
```

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

## Configuration

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

| Parameter | Description | Default |
|--------------------------------------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------|
| `fullnameOverride` | Override fullname | `nil` |
| `.namespace` | Namespace of adapter deployment | `skywalking-custom-metrics-system` |
| `.replicas` | The replicas of adapter | `1` |
| `.serviceAccountName` | The service account name of adapter | `skywalking-custom-metrics-apiserver` |
| `.image.repository` | Adapter container image name | `docker.io/apache/skywalking-swck` |
| `.image.pullPolicy` | Adapter container image pull policy | `IfNotPresent` |
| `.image.tag` | Adapter container image tag | `v0.7.0` |
| `.service.port` | The port for the adapter service | `6.1.0` |
| `.oap.service.name` | The service name of OAP | `skywalking-system-oap` |
| `.oap.service.namespace` | The service namespace of OAP | `skywalking-system` |
| `.oap.service.port` | The service port of OAP | `12800` |
| `.resources.limits.cpu` | The limits of cpu in the adapter | `100m` |
| `.resources.limits.memory` | The limits of memory in the adapter | `200Mi` |
| `.resources.requests.cpu` | The requests of cpu in the adapter | `100m` |
| `.resources.requests.memory` | The requests of memory in the adapter | `200Mi` |
| `.affinity` | The affinity policy of adapter | `{}` |

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

**Note** You could refer to the [helm install](https://helm.sh/docs/helm/helm_install/) for more command information.

```console
$ helm install myrelease adapter --set fullnameOverride=newadapter
```

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

```console
$ helm install my-release adapter -f values.yaml
```

> **Tip**: You can use the default [values.yaml](values.yaml)
32 changes: 32 additions & 0 deletions chart/adapter/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

************************************************************************
* *
* Skywalking Adapter Helm Chart by SkyWalking Team *
* *
************************************************************************

Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }} in the namespace {{ .Release.Namespace }}.

To get all info about the release, try:

$ helm get all {{ .Release.Name }} -n {{ .Release.Namespace }} # get all deployment yaml files

Learn more details, please visit https://github.com/apache/skywalking-swck/tree/master/adapter
69 changes: 69 additions & 0 deletions chart/adapter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{/*
Expand the name of the chart.
*/}}
{{- define "adapter.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "adapter.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "adapter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "adapter.labels" -}}
helm.sh/chart: {{ include "adapter.chart" . }}
{{ include "adapter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "adapter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "adapter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

28 changes: 28 additions & 0 deletions chart/adapter/templates/apiservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.external.metrics.k8s.io
spec:
group: external.metrics.k8s.io
groupPriorityMinimum: 100
insecureSkipTLSVerify: true
service:
name: {{ include "adapter.fullname" . }}-custom-metrics-apiserver
namespace: {{ .Release.Namespace }}
version: v1beta1
versionPriority: 100
Loading