Skip to content

Commit

Permalink
Merge branch 'main' into values-schema-allow-defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
joejulian authored Jul 22, 2023
2 parents 176bcee + d6a2112 commit 7657373
Show file tree
Hide file tree
Showing 52 changed files with 2,513 additions and 70 deletions.
19 changes: 19 additions & 0 deletions .buildkite/capi/aks-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: v2
name: aks-cluster
description: A Helm chart for aks capi clusters

# 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.1.0
26 changes: 26 additions & 0 deletions .buildkite/capi/aks-cluster/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{/*
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.
*/}}





Congratulations on installing {{ .Chart.Name }}!

You can get the kubeconfig file by running:

TODO create task file
63 changes: 63 additions & 0 deletions .buildkite/capi/aks-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "aks-cluster.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 "aks-cluster.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 "aks-cluster.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "aks-cluster.labels" -}}
helm.sh/chart: {{ include "aks-cluster.chart" . }}
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
{{ include "aks-cluster.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

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

{{/*
Create the name of the service account to use
*/}}
{{- define "aks-cluster.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "aks-cluster.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
214 changes: 214 additions & 0 deletions .buildkite/capi/aks-cluster/templates/aks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: {{ include "aks-cluster.fullname" . }}
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
name: {{ include "aks-cluster.fullname" . }}-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureCluster
name: {{ include "aks-cluster.fullname" . }}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureCluster
metadata:
name: {{ include "aks-cluster.fullname" . }}
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
identityRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureClusterIdentity
name: {{ include "aks-cluster.fullname" . }}
location: {{ .Values.location }}
networkSpec:
subnets:
- name: control-plane-subnet
role: control-plane
- name: node-subnet
role: node
vnet:
name: {{ include "aks-cluster.fullname" . }}-vnet
resourceGroup: {{ .Values.resourceGroup }}
subscriptionID: {{ .Values.subscriptionID }}
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
metadata:
name: {{ include "aks-cluster.fullname" . }}-control-plane
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
kubeadmConfigSpec:
clusterConfiguration:
apiServer:
extraArgs:
cloud-provider: external
timeoutForControlPlane: 20m
controllerManager:
extraArgs:
allocate-node-cidrs: "false"
cloud-provider: external
cluster-name: {{ include "aks-cluster.fullname" . }}
etcd:
local:
dataDir: /var/lib/etcddisk/etcd
extraArgs:
quota-backend-bytes: "8589934592"
diskSetup:
filesystems:
- device: /dev/disk/azure/scsi1/lun0
extraOpts:
- -E
- lazy_itable_init=1,lazy_journal_init=1
filesystem: ext4
label: etcd_disk
- device: ephemeral0.1
filesystem: ext4
label: ephemeral0
replaceFS: ntfs
partitions:
- device: /dev/disk/azure/scsi1/lun0
layout: true
overwrite: false
tableType: gpt
files:
- contentFrom:
secret:
key: control-plane-azure.json
name: {{ include "aks-cluster.fullname" . }}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-provider: external
name: {{ printf "'{{ ds.meta_data[\"local_hostname\"] }}'" }}
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-provider: external
name: {{ printf "'{{ ds.meta_data[\"local_hostname\"] }}'" }}
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
name: {{ include "aks-cluster.fullname" . }}-control-plane
replicas: {{ .Values.controlPlaneReplicas }}
version: {{ .Values.kubernetesVersion }}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
metadata:
name: {{ include "aks-cluster.fullname" . }}-control-plane
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
template:
spec:
dataDisks:
- diskSizeGB: 256
lun: 0
nameSuffix: etcddisk
osDisk:
diskSizeGB: 128
osType: Linux
sshPublicKey: ""
vmSize: Standard_B2s
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: {{ include "aks-cluster.fullname" . }}
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
clusterName: {{ include "aks-cluster.fullname" . }}
replicas: {{ .Values.workerReplicas }}
selector:
matchLabels: null
template:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: {{ include "aks-cluster.fullname" . }}-workers
clusterName: {{ include "aks-cluster.fullname" . }}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
name: {{ include "aks-cluster.fullname" . }}-workers
version: {{ .Values.kubernetesVersion }}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
metadata:
name: {{ include "aks-cluster.fullname" . }}-workers
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
template:
spec:
osDisk:
diskSizeGB: 128
osType: Linux
sshPublicKey: ""
vmSize: Standard_B2s
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: {{ include "aks-cluster.fullname" . }}-workers
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
template:
spec:
files:
- contentFrom:
secret:
key: worker-node-azure.json
name: {{ include "aks-cluster.fullname" . }}-workers-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-provider: external
name: {{ printf "'{{ ds.meta_data[\"local_hostname\"] }}'" }}
preKubeadmCommands: []
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureClusterIdentity
metadata:
name: {{ include "aks-cluster.fullname" . }}
namespace: {{ .Release.namespace | default "default" }}
labels: {{ include "aks-cluster.labels" . | nindent 4 }}
spec:
allowedNamespaces: {}
clientID: {{ .Values.clientID }}
clientSecret:
name: {{ .Values.clientSecret.name }}
namespace: {{ .Values.clientSecret.namespace }}
tenantID: {{ .Values.tenantID }}
type: ServicePrincipal
25 changes: 25 additions & 0 deletions .buildkite/capi/aks-cluster/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Default values for aks-cluster.

# nameOverride: ""
# fullNameOverride: ""

# Make sure to use same Kubernetes version here as building the GCE image
kubernetesVersion: 1.26.3

# Name of the Azure datacenter location. Change this value to your desired location
location: "westus2"

clientID: ""
tenantID: ""

resourceGroup: ""

subscriptionID: ""

controlPlaneReplicas: 1
workerReplicas: 1

clientSecret:
name: ""
namespace: ""
6 changes: 6 additions & 0 deletions .buildkite/hooks/post-command
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ gke() {
unset CI PROJECT_ID TEST_BUCKET TEST_SA_NAME
}

aks() {
cp charts/redpanda/ci/23-aks-tiered-storage-with-creds-values.yaml .local/artifacts/
support-bundle -o ".local/artifacts/${CLOUD_PROVIDER}-${BUILDKITE_BUILD_NUMBER}" .buildkite/scripts/bundle.yaml
unset CI TEST_STORAGE_ACCOUNT TEST_RESOURCE_GROUP
}

$CLOUD_PROVIDER
Loading

0 comments on commit 7657373

Please sign in to comment.