diff --git a/docs/azure/cluster-parameters.md b/docs/azure/cluster-parameters.md index d0bbf46d9..6575649c7 100644 --- a/docs/azure/cluster-parameters.md +++ b/docs/azure/cluster-parameters.md @@ -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 diff --git a/templates/azure-hosted-cp/Chart.yaml b/templates/azure-hosted-cp/Chart.yaml index 5c3bfcbf6..54068bc9b 100644 --- a/templates/azure-hosted-cp/Chart.yaml +++ b/templates/azure-hosted-cp/Chart.yaml @@ -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. diff --git a/templates/azure-hosted-cp/templates/_helpers.tpl b/templates/azure-hosted-cp/templates/_helpers.tpl index dae9addfb..06dc0b9f7 100644 --- a/templates/azure-hosted-cp/templates/_helpers.tpl +++ b/templates/azure-hosted-cp/templates/_helpers.tpl @@ -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 }} diff --git a/templates/azure-hosted-cp/templates/k0sworkerconfigtemplate.yaml b/templates/azure-hosted-cp/templates/k0sworkerconfigtemplate.yaml index 1233d640e..17618007e 100644 --- a/templates/azure-hosted-cp/templates/k0sworkerconfigtemplate.yaml +++ b/templates/azure-hosted-cp/templates/k0sworkerconfigtemplate.yaml @@ -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 diff --git a/templates/azure-hosted-cp/values.schema.json b/templates/azure-hosted-cp/values.schema.json index 9d6b4e391..dd04d037b 100644 --- a/templates/azure-hosted-cp/values.schema.json +++ b/templates/azure-hosted-cp/values.schema.json @@ -7,9 +7,6 @@ "workersNumber", "location", "subscriptionID", - "tenantID", - "clientID", - "clientSecret", "clusterIdentity", "resourceGroup", "network", @@ -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", diff --git a/templates/azure-hosted-cp/values.yaml b/templates/azure-hosted-cp/values.yaml index 6feea59a5..3440db477 100644 --- a/templates/azure-hosted-cp/values.yaml +++ b/templates/azure-hosted-cp/values.yaml @@ -13,11 +13,6 @@ clusterNetwork: # Azure cluster parameters location: "" subscriptionID: "" -# k0sproject/k0smotron#692 workaround -tenantID: "" -clientID: "" -clientSecret: "" -### bastion: enabled: false bastionSpec: diff --git a/templates/azure-standalone-cp/Chart.yaml b/templates/azure-standalone-cp/Chart.yaml index f8398fdb2..d47838fac 100644 --- a/templates/azure-standalone-cp/Chart.yaml +++ b/templates/azure-standalone-cp/Chart.yaml @@ -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. diff --git a/templates/azure-standalone-cp/templates/_helpers.tpl b/templates/azure-standalone-cp/templates/_helpers.tpl index 264bb1db0..dfd4b9b8b 100644 --- a/templates/azure-standalone-cp/templates/_helpers.tpl +++ b/templates/azure-standalone-cp/templates/_helpers.tpl @@ -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 }} diff --git a/templates/azure-standalone-cp/templates/k0scontrolplane.yaml b/templates/azure-standalone-cp/templates/k0scontrolplane.yaml index 8ec5035ae..95294cf93 100644 --- a/templates/azure-standalone-cp/templates/k0scontrolplane.yaml +++ b/templates/azure-standalone-cp/templates/k0scontrolplane.yaml @@ -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 diff --git a/templates/azure-standalone-cp/templates/k0sworkerconfigtemplate.yaml b/templates/azure-standalone-cp/templates/k0sworkerconfigtemplate.yaml index 51f3c614f..9072c62e3 100644 --- a/templates/azure-standalone-cp/templates/k0sworkerconfigtemplate.yaml +++ b/templates/azure-standalone-cp/templates/k0sworkerconfigtemplate.yaml @@ -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 diff --git a/templates/azure-standalone-cp/values.schema.json b/templates/azure-standalone-cp/values.schema.json index 75bf5c400..50e55def5 100644 --- a/templates/azure-standalone-cp/values.schema.json +++ b/templates/azure-standalone-cp/values.schema.json @@ -7,9 +7,6 @@ "workersNumber", "location", "subscriptionID", - "tenantID", - "clientID", - "clientSecret", "clusterIdentity" ], "properties": { @@ -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", diff --git a/templates/azure-standalone-cp/values.yaml b/templates/azure-standalone-cp/values.yaml index 7ba5003b1..9b9bb0520 100644 --- a/templates/azure-standalone-cp/values.yaml +++ b/templates/azure-standalone-cp/values.yaml @@ -13,11 +13,6 @@ clusterNetwork: # Azure cluster parameters location: "" subscriptionID: "" -# k0sproject/k0smotron#692 workaround -tenantID: "" -clientID: "" -clientSecret: "" -### bastion: enabled: false bastionSpec: diff --git a/templates/hmc-templates/files/templates/azure-hosted-cp.yaml b/templates/hmc-templates/files/templates/azure-hosted-cp.yaml index 67daba869..4f91571ad 100644 --- a/templates/hmc-templates/files/templates/azure-hosted-cp.yaml +++ b/templates/hmc-templates/files/templates/azure-hosted-cp.yaml @@ -5,4 +5,4 @@ metadata: spec: helm: chartName: azure-hosted-cp - chartVersion: 0.0.1 + chartVersion: 0.1.1 diff --git a/templates/hmc-templates/files/templates/azure-standalone-cp.yaml b/templates/hmc-templates/files/templates/azure-standalone-cp.yaml index a8bd9856f..7276ef07a 100644 --- a/templates/hmc-templates/files/templates/azure-standalone-cp.yaml +++ b/templates/hmc-templates/files/templates/azure-standalone-cp.yaml @@ -5,4 +5,4 @@ metadata: spec: helm: chartName: azure-standalone-cp - chartVersion: 0.0.1 + chartVersion: 0.1.1 diff --git a/templates/hmc-templates/files/templates/k0smotron.yaml b/templates/hmc-templates/files/templates/k0smotron.yaml index adf37ee44..cd2c2ea33 100644 --- a/templates/hmc-templates/files/templates/k0smotron.yaml +++ b/templates/hmc-templates/files/templates/k0smotron.yaml @@ -5,4 +5,4 @@ metadata: spec: helm: chartName: k0smotron - chartVersion: 0.1.2 + chartVersion: 0.1.3 diff --git a/templates/k0smotron/Chart.yaml b/templates/k0smotron/Chart.yaml index 7a2d2493a..8e715a2ef 100644 --- a/templates/k0smotron/Chart.yaml +++ b/templates/k0smotron/Chart.yaml @@ -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 diff --git a/templates/k0smotron/templates/providers.yaml b/templates/k0smotron/templates/providers.yaml index 461ec50c4..addf50193 100644 --- a/templates/k0smotron/templates/providers.yaml +++ b/templates/k0smotron/templates/providers.yaml @@ -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 }} @@ -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 }} @@ -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 }}