Skip to content

Commit

Permalink
Remove azure.json workaround; Bump k0smotron version
Browse files Browse the repository at this point in the history
  • Loading branch information
a13x5 committed Sep 4, 2024
1 parent d9cfcd3 commit 72d6105
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 141 deletions.
16 changes: 0 additions & 16 deletions docs/azure/cluster-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,3 @@ These objects then should be referenced in the `Deployment` object in the
Subscription ID which was used to create service principal should be the
same that will be used in the `.spec.config.subscriptionID` field of the
`Deployment` object.

### Cloud controller manager note

In order for CCM to work on Azure it requires `azure.json` file to be located on
all nodes.

Because of a limitation (k0sproject/k0smotron#692) it's not currently possible
to automatically pass credentials to all nodes.

To mitigate that you should pass cluster identity data once again in the
following fields of a `Deployment` object:

- `.spec.config.tenantID` - value of the `tenant` field of a service principal
- `.spec.config.clientID` - value of the `appId` field of a service principal
- `.spec.config.clientSecret` - value of the `password` field of a service
principal
2 changes: 1 addition & 1 deletion templates/azure-hosted-cp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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
version: 0.1.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.
Expand Down
24 changes: 0 additions & 24 deletions templates/azure-hosted-cp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,3 @@
{{- define "machinedeployment.name" -}}
{{- include "cluster.name" . }}-md
{{- end }}

{{- define "azure.json" -}}
{
"cloud": "AzurePublicCloud",
"tenantId": "{{ .Values.tenantID }}",
"subscriptionId": "{{ .Values.subscriptionID }}",
"aadClientId": "{{ .Values.clientID }}",
"aadClientSecret": "{{ .Values.clientSecret }}",
"resourceGroup": "{{ .Values.resourceGroup }}",
"securityGroupName": "{{ .Values.network.securityGroupName }}",
"securityGroupResourceGroup": "{{ .Values.resourceGroup }}",
"location": "{{ .Values.location }}",
"vmType": "vmss",
"vnetName": "{{ .Values.network.vnetName }}",
"vnetResourceGroup": "{{ .Values.resourceGroup }}",
"subnetName": "{{ .Values.network.nodeSubnetName }}",
"routeTableName": "{{ .Values.routeTableName }}",
"loadBalancerSku": "Standard",
"loadBalancerName": "",
"maximumLoadBalancerRuleCount": 250,
"useManagedIdentityExtension": false,
"useInstanceMetadata": true
}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ spec:
files:
- path: "/etc/kubernetes/azure.json"
permissions: "0644"
content: {{ include "azure.json" . | toJson }}
contentFrom:
secretRef:
key: worker-node-azure.json
name: {{ include "azuremachinetemplate.name" . }}-azure-json
15 changes: 0 additions & 15 deletions templates/azure-hosted-cp/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"workersNumber",
"location",
"subscriptionID",
"tenantID",
"clientID",
"clientSecret",
"clusterIdentity",
"resourceGroup",
"network",
Expand Down Expand Up @@ -65,18 +62,6 @@
"description": "Azure subscription ID which will be used for all resources",
"type": "string"
},
"tenantID": {
"description": "Tenant ID for the service principal",
"type": "string"
},
"clientID": {
"description": "Client ID of the service principal",
"type": "string"
},
"clientSecret": {
"description": "Client secret of the service principal",
"type": "string"
},
"bastion": {
"type": "object",
"description": "The configuration of the bastion host",
Expand Down
5 changes: 0 additions & 5 deletions templates/azure-hosted-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ clusterNetwork:
# Azure cluster parameters
location: ""
subscriptionID: ""
# k0sproject/k0smotron#692 workaround
tenantID: ""
clientID: ""
clientSecret: ""
###
bastion:
enabled: false
bastionSpec:
Expand Down
2 changes: 1 addition & 1 deletion templates/azure-standalone-cp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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
version: 0.1.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.
Expand Down
48 changes: 0 additions & 48 deletions templates/azure-standalone-cp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,3 @@
{{- define "machinedeployment.name" -}}
{{- include "cluster.name" . }}-md
{{- end }}

{{- define "azure.json.worker" -}}
{
"cloud": "AzurePublicCloud",
"tenantId": "{{ .Values.tenantID }}",
"subscriptionId": "{{ .Values.subscriptionID }}",
"aadClientId": "{{ .Values.clientID }}",
"aadClientSecret": "{{ .Values.clientSecret }}",
"resourceGroup": "{{ include "cluster.name" . }}",
"securityGroupName": "{{ include "cluster.name" . }}-node-nsg",
"securityGroupResourceGroup": "{{ include "cluster.name" . }}",
"location": "{{ .Values.location }}",
"vmType": "vmss",
"vnetName": "{{ include "cluster.name" . }}-vnet",
"vnetResourceGroup": "{{ include "cluster.name" . }}",
"subnetName": "{{ include "cluster.name" . }}-node-subnet",
"routeTableName": "{{ include "cluster.name" . }}-node-routetable",
"loadBalancerSku": "Standard",
"loadBalancerName": "",
"maximumLoadBalancerRuleCount": 250,
"useManagedIdentityExtension": false,
"useInstanceMetadata": true
}
{{- end }}

{{- define "azure.json.controller" -}}
{
"cloud": "AzurePublicCloud",
"tenantId": "{{ .Values.tenantID }}",
"subscriptionId": "{{ .Values.subscriptionID }}",
"aadClientId": "{{ .Values.clientID }}",
"aadClientSecret": "{{ .Values.clientSecret }}",
"resourceGroup": "{{ include "cluster.name" . }}",
"securityGroupName": "{{ include "cluster.name" . }}-controlplane-nsg",
"securityGroupResourceGroup": "{{ include "cluster.name" . }}",
"location": "{{ .Values.location }}",
"vmType": "vmss",
"vnetName": "{{ include "cluster.name" . }}-vnet",
"vnetResourceGroup": "{{ include "cluster.name" . }}",
"subnetName": "{{ include "cluster.name" . }}-controlplane-subnet",
"routeTableName": "{{ include "cluster.name" . }}-controlplane-routetable",
"loadBalancerSku": "Standard",
"loadBalancerName": "",
"maximumLoadBalancerRuleCount": 250,
"useManagedIdentityExtension": false,
"useInstanceMetadata": true
}
{{- end }}
5 changes: 4 additions & 1 deletion templates/azure-standalone-cp/templates/k0scontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ spec:
files:
- path: "/etc/kubernetes/azure.json"
permissions: "0644"
content: {{ include "azure.json.controller" . | toJson }}
contentFrom:
secretRef:
key: control-plane-azure.json
name: {{ include "k0scontrolplane.name" . }}-0-azure-json
k0s:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ spec:
files:
- path: "/etc/kubernetes/azure.json"
permissions: "0644"
content: {{ include "azure.json.worker" . | toJson }}
contentFrom:
secretRef:
key: worker-node-azure.json
name: {{ include "azuremachinetemplate.worker.name" . }}-azure-json
15 changes: 0 additions & 15 deletions templates/azure-standalone-cp/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"workersNumber",
"location",
"subscriptionID",
"tenantID",
"clientID",
"clientSecret",
"clusterIdentity"
],
"properties": {
Expand Down Expand Up @@ -62,18 +59,6 @@
"description": "Azure subscription ID which will be used for all resources",
"type": "string"
},
"tenantID": {
"description": "Tenant ID for the service principal",
"type": "string"
},
"clientID": {
"description": "Client ID of the service principal",
"type": "string"
},
"clientSecret": {
"description": "Client secret of the service principal",
"type": "string"
},
"bastion": {
"type": "object",
"description": "The configuration of the bastion host",
Expand Down
5 changes: 0 additions & 5 deletions templates/azure-standalone-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ clusterNetwork:
# Azure cluster parameters
location: ""
subscriptionID: ""
# k0sproject/k0smotron#692 workaround
tenantID: ""
clientID: ""
clientSecret: ""
###
bastion:
enabled: false
bastionSpec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: azure-hosted-cp
chartVersion: 0.0.1
chartVersion: 0.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: azure-standalone-cp
chartVersion: 0.0.1
chartVersion: 0.1.1
2 changes: 1 addition & 1 deletion templates/hmc-templates/files/templates/k0smotron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
helm:
chartName: k0smotron
chartVersion: 0.1.2
chartVersion: 0.1.3
4 changes: 2 additions & 2 deletions templates/k0smotron/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ 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.2
version: 0.1.3
# 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.
# It is recommended to use it with quotes.
appVersion: "1.0.2"
appVersion: "1.0.4"
annotations:
hmc.mirantis.com/type: provider
hmc.mirantis.com/infrastructure-providers: k0smotron
Expand Down
6 changes: 3 additions & 3 deletions templates/k0smotron/templates/providers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: InfrastructureProvider
metadata:
name: k0smotron
spec:
version: v1.0.2
version: v1.0.4
fetchConfig:
url: https://github.com/k0sproject/k0smotron/releases/{{ .Values.version }}/infrastructure-components.yaml
{{- if .Values.configSecret.name }}
Expand All @@ -17,7 +17,7 @@ kind: BootstrapProvider
metadata:
name: k0smotron
spec:
version: v1.0.2
version: v1.0.4
fetchConfig:
url: https://github.com/k0sproject/k0smotron/releases/{{ .Values.version }}/bootstrap-components.yaml
{{- if .Values.configSecret.name }}
Expand All @@ -31,7 +31,7 @@ kind: ControlPlaneProvider
metadata:
name: k0smotron
spec:
version: v1.0.2
version: v1.0.4
fetchConfig:
url: https://github.com/k0sproject/k0smotron/releases/{{ .Values.version }}/control-plane-components.yaml
{{- if .Values.configSecret.name }}
Expand Down

0 comments on commit 72d6105

Please sign in to comment.