Skip to content

Commit

Permalink
Merge pull request #141 from adberger/master
Browse files Browse the repository at this point in the history
[vcluster]: llow installation of online manifests, disable autoscaler as default, remove unused values & fix references
  • Loading branch information
adberger authored Dec 16, 2024
2 parents fc443a7 + 2f03aba commit 816e799
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 69 deletions.
2 changes: 1 addition & 1 deletion charts/vcluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: vcluster
description: Virtual Kubernetes Cluster
type: application
version: 0.7.0
version: 0.8.0
appVersion: 0.1.0
keywords:
- vcluster
Expand Down
15 changes: 5 additions & 10 deletions charts/vcluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__This Chart is under active development! We try to improve documentation and values consistency over time__

![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Virtual Kubernetes Cluster

Expand Down Expand Up @@ -138,10 +138,8 @@ We use a lifecycle Job/Cronjob to manage certain configurations within the vclus
| lifecycle.cleanup.annotations | object | `{"helm.sh/hook":"pre-delete","helm.sh/hook-delete-policy":"before-hook-creation"}` | Job Annotations |
| lifecycle.cleanup.enabled | bool | `false` | Enable/Disable Cleanup |
| lifecycle.cleanup.labels | object | `{}` | Job Labels |
| lifecycle.current.cleanupScript | string | `nil` | Additional configuration script for the vcluster during cleanup (supports templating) |
| lifecycle.current.extraManifests | object | See values.yaml | These manifests will be applied inside the cluster (supports templating) |
| lifecycle.current.extraManifestsOnInstall | object | See values.yaml | These manifests will be applied inside the cluster, but only on $.Release.Install and wont be touched again (supports templating) |
| lifecycle.current.setupScript | string | `nil` | Additional configuration script for the current cluster (supports templating) |
| lifecycle.jobs.affinity | object | `{}` | Affinity |
| lifecycle.jobs.extraEnv | list | `[]` | Additional Pod Environment variables |
| lifecycle.jobs.extraVolumeMounts | list | `[]` | Additional Pod VolumeMounts |
Expand All @@ -166,10 +164,8 @@ We use a lifecycle Job/Cronjob to manage certain configurations within the vclus
| lifecycle.setup.schedule | string | `"0 0 1 */6 *"` | Cronjob Schedule |
| lifecycle.setup.successfulJobsHistoryLimit | int | `3` | Cronjob successful jobs history limit |
| lifecycle.setup.ttlSecondsAfterFinished | int | `120` | ttlSecondsAfterFinished for setup |
| lifecycle.vcluster.cleanupScript | string | `nil` | Additional configuration script for the vcluster during cleanup (supports templating) |
| lifecycle.vcluster.extraManifests | object | See values.yaml | These manifests will be applied inside the vcluster (supports templating) |
| lifecycle.vcluster.extraManifestsOnInstall | object | See values.yaml | These manifests will be applied inside the vcluster, but only on $.Release.Install and wont be touched again (supports templating) |
| lifecycle.vcluster.setupScript | string | `nil` | Additional configuration script for the vcluster during reconciler (supports templating) |
| lifecycle.vcluster.extraOnlineManifests | list | `[]` | List of URLs which will be applied inside the vcluster (supports templating) |
| lifecycle.vcluster.extraOnlineManifestsOnInstall | list | `[]` | List of URLs which will be applied inside the vcluster, but only on $.Release.Install and wont be touched again (supports templating) |

## Machine Values

Expand Down Expand Up @@ -395,7 +391,6 @@ Available Values for the [Operating System Manager](). The component consists of
Available Values for the [Kubernetes component](#kubernetes).
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| kubernetes.component.removeManifestsOnDisable | bool | `true` | Remove all manifests on disable in the vcluster (**Attention**: When crds are deleted all crs will be deleted as well) |
| kubernetes.controlPlane | object | `{"endpoint":null}` | ControlerPlaneEndpoint |
| kubernetes.controlPlane.endpoint | string | `nil` | Endpoint for ControlPlane (eg `128.1314.1234.4242:6443`). If not set, the vcluster will try to find the endpoint automatically. |
| kubernetes.enabled | bool | `true` | Enable Kubernetes Component |
Expand Down Expand Up @@ -847,7 +842,7 @@ Available Values for the [Autsocaler component](#autoscaler).
---
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| autoscaler.enabled | bool | `true` | Enable autsocaler component |
| autoscaler.enabled | bool | `false` | Enable autsocaler component |
| autoscaler.expanderPriorities | object | `{}` | The expanderPriorities is used if `extraArgs.expander` contains `priority` and expanderPriorities is also set with the priorities. If `args.expander` contains `priority`, then expanderPriorities is used to define cluster-autoscaler-priority-expander priorities. See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md |
| autoscaler.priorityConfigMapAnnotations | object | `{}` | Annotations to add to `cluster-autoscaler-priority-expander` ConfigMap. |

Expand All @@ -859,7 +854,7 @@ Available Values for the [Autsocaler component](#autoscaler).
| autoscaler.affinity | object | `{}` | Affinity |
| autoscaler.annotations | object | `{}` | Annotations for Workload |
| autoscaler.args | object | `{"leader-elect":true,"logtostderr":true,"scale-down-enabled":true,"stderrthreshold":"info","v":4}` | Additional container arguments. Refer to https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca for the full list of cluster autoscaler parameters and their default values. Everything after the first _ will be ignored allowing the use of multi-string arguments. |
| autoscaler.enabled | bool | `true` | Enable autsocaler component |
| autoscaler.enabled | bool | `false` | Enable autsocaler component |
| autoscaler.envs | object | `{"CAPI_GROUP":"cluster.k8s.io"}` | Extra environment variables (`key: value` style, allows templating) |
| autoscaler.envsFrom | list | `[]` | Extra environment variables from |
| autoscaler.expanderPriorities | object | `{}` | The expanderPriorities is used if `extraArgs.expander` contains `priority` and expanderPriorities is also set with the priorities. If `args.expander` contains `priority`, then expanderPriorities is used to define cluster-autoscaler-priority-expander priorities. See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md |
Expand Down
2 changes: 1 addition & 1 deletion charts/vcluster/addons/scripts/configure-current.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CA=$(base64 /pki/admin-client/ca.crt | tr -d '\n')
C_CERT=$(base64 /pki/admin-client/tls.crt | tr -d '\n')
C_KEY=$(base64 /pki/admin-client/tls.key | tr -d '\n')

{{- $kubeconfigs := $.Values.lifecycle.kubeconfigs }}
{{- $kubeconfigs := $lifecycle.kubeconfigs }}
# Iterate over all kubeconfigs
{{- range $kubeconfigs }}{{"\n"}}
{{- $name := (include "pkg.utils.template" (dict "tpl" (required "kubeconfig.name is required" .name) "ctx" $)) -}}
Expand Down
8 changes: 4 additions & 4 deletions charts/vcluster/addons/scripts/configure-vcluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ fi
# Additional Manifests
# ------------------------------------------------------------------------------
{{- if $.Release.IsInstall }}
{{- with $lifecycle.vcluster.extraManifestsOnInstall }}
kubectl apply{{- range $key, $value := . }} -f /manifests/{{ $key }} {{- end }}
{{- range $lifecycle.vcluster.extraOnlineManifests }}
kubectl apply -f {{ . | quote }}
{{- end }}
{{- end }}

{{- with $lifecycle.vcluster.extraManifests }}
kubectl apply{{- range $key, $value := . }} -f /manifests/{{ $key }} {{- end }}
{{- range $lifecycle.vcluster.extraOnlineManifestsOnInstall }}
kubectl apply -f {{ . | quote }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ data:
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
clusterName: {{ include "pkg.cluster.name" $ }}
{{- if $kubernetes.controlPlaneEndpoint }}
controlPlaneEndpoint: {{ $kubernetes.controlPlaneEndpoint }}
{{- if $kubernetes.controlPlane.endpoint }}
controlPlaneEndpoint: {{ $kubernetes.controlPlane.endpoint }}
{{- else }}
controlPlaneEndpoint: {{ include "kubernetes.api.service" $ }}:{{ $kubernetes.apiServer.service.port }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/vcluster/templates/extra-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ items:
{{- if $.Release.IsInstall }}
{{- with $.Values.lifecycle.current.extraManifestsOnInstall }}
{{- range $file, $content := . }}
- {{- include "pkg.utils.template" (dict "tpl" $content "ctx" $) | nindent 4 }}
- {{- include "pkg.utils.template" (dict "tpl" $content "ctx" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
61 changes: 11 additions & 50 deletions charts/vcluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,6 @@ lifecycle:

# Additional customization for interactions with the current cluster
current:

# -- Additional configuration script for the current cluster (supports templating)
setupScript:
# echo "I am a script which runs on the current cluster"

# -- Additional configuration script for the vcluster during cleanup (supports templating)
cleanupScript:
# echo "I am a script which runs on the current cluster"

# -- These manifests will be applied inside the cluster (supports templating)
# @default -- See values.yaml
extraManifests: {}
Expand All @@ -243,34 +234,11 @@ lifecycle:

# Additional customization for interactions with the vcluster cluster
vcluster:
# -- List of URLs which will be applied inside the vcluster (supports templating)
extraOnlineManifests: []

# -- Additional configuration script for the vcluster during reconciler (supports templating)
setupScript:
# echo "I am a script which runs on the vcluster"

# -- Additional configuration script for the vcluster during cleanup (supports templating)
cleanupScript:
# echo "I am a script which runs on the vcluster"

# -- These manifests will be applied inside the vcluster (supports templating)
# @default -- See values.yaml
extraManifests: {}
# -- Filename of the manifest
# namespace.yaml:
# apiVersion: v1
# kind: Namespace
# metadata:
# name: example

# -- These manifests will be applied inside the vcluster, but only on $.Release.Install and wont be touched again (supports templating)
# @default -- See values.yaml
extraManifestsOnInstall: {}
# -- Filename of the manifest
# namespace.yaml:
# apiVersion: v1
# kind: Namespace
# metadata:
# name: example
# -- List of URLs which will be applied inside the vcluster, but only on $.Release.Install and wont be touched again (supports templating)
extraOnlineManifestsOnInstall: []

# ArgoCD Lifecycle configuration
argocd:
Expand Down Expand Up @@ -706,7 +674,7 @@ machine:
# ----------------------------
# Operating System Manager
# ----------------------------
# Refernece:
# Reference:
osm:
# -- Enable Operating System Manager Component
enabled: false
Expand Down Expand Up @@ -1010,12 +978,6 @@ kubernetes:
# -- Enable Kubernetes Component
enabled: true

# Component Settings
component:

# -- Remove all manifests on disable in the vcluster (**Attention**: When crds are deleted all crs will be deleted as well)
removeManifestsOnDisable: true

# -- Version for API Server, Scheduler, Controller Manager (Tag for all kubernetes components)
version: "v1.25.0"

Expand Down Expand Up @@ -2117,7 +2079,7 @@ kubernetes:
# ----------------------------
autoscaler:
# -- Enable autsocaler component
enabled: true
enabled: false
## Priorities Expander
# -- The expanderPriorities is used if `extraArgs.expander` contains `priority` and expanderPriorities is also set with the priorities.
# If `args.expander` contains `priority`, then expanderPriorities is used to define cluster-autoscaler-priority-expander priorities.
Expand Down Expand Up @@ -2165,7 +2127,7 @@ autoscaler:
# balancing-ignore-label_1: first-label-to-ignore
# balancing-ignore-label_2: second-label-to-ignore

# Image COnfiguration
# Image Configuration
image:
# -- Image registry
registry: registry.k8s.io
Expand Down Expand Up @@ -2308,13 +2270,12 @@ autoscaler:
# ----------------------------
# Utilities
# ----------------------------
# -- kubeVersion Override Kubernetes version
kubeVersion: ""

utils:
# -- Base Label used for labels
base_label: "app.kubernetes.io"
# -- Timezone
timezone: "Europe/Zurich"
# -- All controllers are installed on the current cluster without expecting a virtual API
currentcluster: false
# -- kubeVersion Override Kubernetes version
kubeVersion: ""
# -- Timezone
timezone: "Europe/Zurich"

0 comments on commit 816e799

Please sign in to comment.