-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tamal Saha <[email protected]>
- Loading branch information
Showing
12 changed files
with
736 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
description: Spoke Cluster Proxy | ||
name: spoke-cluster-proxy | ||
version: v2024.2.25 | ||
appVersion: v0.0.1 | ||
home: https://github.com/kluster-manager/cluster-proxy | ||
icon: https://cdn.appscode.com/images/products/searchlight/icons/android-icon-192x192.png | ||
sources: | ||
- https://github.com/kluster-manager/cluster-proxy | ||
maintainers: | ||
- name: appscode | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Spoke Cluster Proxy | ||
|
||
[Spoke Cluster Proxy](https://github.com/kluster-manager/cluster-proxy) - Spoke Cluster Proxy | ||
|
||
## TL;DR; | ||
|
||
```bash | ||
$ helm repo add appscode https://charts.appscode.com/stable | ||
$ helm repo update | ||
$ helm search repo appscode/spoke-cluster-proxy --version=v2024.2.25 | ||
$ helm upgrade -i spoke-cluster-proxy appscode/spoke-cluster-proxy -n c1 --create-namespace --version=v2024.2.25 | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart deploys a Spoke Cluster Proxy on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.21+ | ||
|
||
## Installing the Chart | ||
|
||
To install/upgrade the chart with the release name `spoke-cluster-proxy`: | ||
|
||
```bash | ||
$ helm upgrade -i spoke-cluster-proxy appscode/spoke-cluster-proxy -n c1 --create-namespace --version=v2024.2.25 | ||
``` | ||
|
||
The command deploys a Spoke Cluster Proxy 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 the `spoke-cluster-proxy`: | ||
|
||
```bash | ||
$ helm uninstall spoke-cluster-proxy -n c1 | ||
``` | ||
|
||
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 `spoke-cluster-proxy` chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
|----------------------|-------------|----------------------------------------------------| | ||
| nameOverride | | <code>""</code> | | ||
| fullnameOverride | | <code>""</code> | | ||
| kubeconfigSecretName | | <code>""</code> | | ||
| kubectl.image | | <code>ghcr.io/appscode/kubectl-nonroot:1.25</code> | | ||
|
||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: | ||
|
||
```bash | ||
$ helm upgrade -i spoke-cluster-proxy appscode/spoke-cluster-proxy -n c1 --create-namespace --version=v2024.2.25 --set kubectl.image=ghcr.io/appscode/kubectl-nonroot:1.25 | ||
``` | ||
|
||
Alternatively, a YAML file that specifies the values for the parameters can be provided while | ||
installing the chart. For example: | ||
|
||
```bash | ||
$ helm upgrade -i spoke-cluster-proxy appscode/spoke-cluster-proxy -n c1 --create-namespace --version=v2024.2.25 --values values.yaml | ||
``` |
7 changes: 7 additions & 0 deletions
7
charts/spoke-cluster-proxy/common/addon/managedclusteraddon.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: addon.open-cluster-management.io/v1alpha1 | ||
kind: ManagedClusterAddOn | ||
metadata: | ||
name: cluster-proxy | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
installNamespace: open-cluster-management-cluster-proxy |
400 changes: 400 additions & 0 deletions
400
charts/spoke-cluster-proxy/crds/addon.open-cluster-management.io_managedclusteraddons.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
project: | ||
name: Spoke Cluster Proxy | ||
shortName: Spoke Cluster Proxy | ||
url: https://github.com/kluster-manager/cluster-proxy | ||
description: Spoke Cluster Proxy | ||
app: a Spoke Cluster Proxy | ||
repository: | ||
url: https://charts.appscode.com/stable | ||
name: appscode | ||
chart: | ||
name: spoke-cluster-proxy | ||
values: -- generate from values file -- | ||
valuesExample: -- generate from values file -- | ||
prerequisites: | ||
- Kubernetes 1.21+ | ||
release: | ||
name: spoke-cluster-proxy | ||
namespace: c1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "spoke-cluster-proxy.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 "spoke-cluster-proxy.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 "spoke-cluster-proxy.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "spoke-cluster-proxy.labels" -}} | ||
helm.sh/chart: {{ include "spoke-cluster-proxy.chart" . }} | ||
{{ include "spoke-cluster-proxy.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "spoke-cluster-proxy.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "spoke-cluster-proxy.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "spoke-cluster-proxy.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "spoke-cluster-proxy.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Addon manager namespace | ||
*/}} | ||
{{- define "spoke-cluster-proxy.namespace" -}} | ||
{{ ternary .Release.Namespace (required "A valid .Values.addonManagerNamespace is required!" .Values.addonManagerNamespace) (empty .Values.kubeconfigSecretName) }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{- if not .Values.kubeconfigSecretName }} | ||
|
||
{{- $restpl := $.Files.Get "common/addon/managedclusteraddon.yaml" }} | ||
{{ tpl $restpl $ }} | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- if .Values.kubeconfigSecretName }} | ||
|
||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: spoke-cluster-proxy-configure-addon | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook-weight": "2" | ||
"helm.sh/hook": post-install,post-upgrade,post-rollback | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | ||
spec: | ||
ttlSecondsAfterFinished: 0 | ||
backoffLimit: 3 | ||
template: | ||
spec: | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: kubectl | ||
image: {{ .Values.kubectl.image }} | ||
workingDir: /var/run/secrets/ocm | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
sleep 2; \ | ||
kubectl --kubeconfig=auth/kubeconfig create ns {{ $.Release.Namespace }} || true; \ | ||
kubectl --kubeconfig=auth/kubeconfig apply -f - <<EOF | ||
{{- $restpl := $.Files.Get "common/addon/managedclusteraddon.yaml" -}} | ||
{{- tpl $restpl $ | nindent 14 }} | ||
EOF | ||
imagePullPolicy: {{ .Values.imagePullPolicy }} | ||
volumeMounts: | ||
- mountPath: /var/run/secrets/ocm/auth | ||
name: ocm-auth | ||
volumes: | ||
- name: ocm-auth | ||
secret: | ||
defaultMode: 420 | ||
secretName: {{ .Values.kubeconfigSecretName }} | ||
restartPolicy: Never | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{- if .Values.kubeconfigSecretName }} | ||
{{ range $path, $data := .Files.Glob "crds/**.yaml" }} | ||
|
||
{{ $content := toString $data }} | ||
{{ $crd := dig "spec" "names" "plural" "" ($content | fromYaml) }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: spoke-cluster-proxy-regcrd-{{ $crd }} | ||
namespace: {{ $.Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook-weight": "0" | ||
"helm.sh/hook": post-install,post-upgrade,post-rollback | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | ||
data: | ||
crd.yaml: | | ||
{{- $content | nindent 4 }} | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: spoke-cluster-proxy-regcrd-{{ $crd }} | ||
namespace: {{ $.Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook": post-install,post-upgrade,post-rollback | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | ||
spec: | ||
ttlSecondsAfterFinished: 0 | ||
backoffLimit: 3 | ||
template: | ||
spec: | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: kubectl | ||
image: {{ $.Values.kubectl.image }} | ||
workingDir: /var/run/secrets/ocm | ||
command: | ||
- sh | ||
- -c | ||
- "sleep 2; \ | ||
kubectl --kubeconfig=auth/kubeconfig apply -f /etc/crds/crd.yaml; \ | ||
" | ||
imagePullPolicy: {{ $.Values.imagePullPolicy }} | ||
volumeMounts: | ||
- mountPath: /var/run/secrets/ocm/auth | ||
name: ocm-auth | ||
- name: crd-volume | ||
mountPath: /etc/crds | ||
volumes: | ||
- name: ocm-auth | ||
secret: | ||
defaultMode: 420 | ||
secretName: {{ $.Values.kubeconfigSecretName }} | ||
- name: crd-volume | ||
configMap: | ||
name: spoke-cluster-proxy-regcrd-{{ $crd }} | ||
restartPolicy: Never | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
properties: | ||
addonManagerNamespace: | ||
type: string | ||
fullnameOverride: | ||
type: string | ||
image: | ||
type: string | ||
imagePullPolicy: | ||
type: string | ||
kubeconfigSecretName: | ||
type: string | ||
kubectl: | ||
properties: | ||
image: | ||
type: string | ||
required: | ||
- image | ||
type: object | ||
nameOverride: | ||
type: string | ||
placement: | ||
properties: | ||
create: | ||
type: boolean | ||
name: | ||
type: string | ||
required: | ||
- create | ||
- name | ||
type: object | ||
registryFQDN: | ||
type: string | ||
tag: | ||
type: string | ||
required: | ||
- image | ||
- imagePullPolicy | ||
- kubectl | ||
- placement | ||
- registryFQDN | ||
type: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
kubeconfigSecretName: "" | ||
|
||
kubectl: | ||
image: ghcr.io/appscode/kubectl-nonroot:1.25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters