Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
218f51f
Changed all compute/network/resources api versions, fixed availabilit…
chlau-az Jul 3, 2020
4a10bd6
Fixed virtualmachines service
chlau-az Jul 3, 2020
b79875e
Fixed scalesets service
chlau-az Jul 3, 2020
76cbb6d
Fixed machine validation api version
chlau-az Jul 3, 2020
48f6448
Changed azure stack authorization
chlau-az Jul 6, 2020
0b587af
Fixed runtime errors for azure cluster, network
chlau-az Jul 8, 2020
185f181
Set image to be raw ubuntu
chlau-az Jul 8, 2020
353e0cc
Implemented ADFS working environment
chlau-az Jul 10, 2020
472f634
Referenced platform image for VM
chlau-az Jul 10, 2020
b3ab471
Resolved authentication issue for kubelet and controller manager, con…
chlau-az Jul 15, 2020
0e6d786
Put back internal load balancer tcp probe
chlau-az Jul 17, 2020
47de0b0
Removed hardcode of ResourceManagerVMDNSSuffix
chlau-az Jul 17, 2020
94bf4aa
Removed hard code of arm endpoint
chlau-az Jul 20, 2020
64846b5
Changed back file paths
chlau-az Jul 20, 2020
3ac64e3
Removed location from setCredentials, added azure stack to DNSZoneFor…
chlau-az Jul 20, 2020
b7f3efc
Added flavor azure-stack for clusterctl
chlau-az Jul 22, 2020
9bf82d5
Added support for Azure Stack AAD
chlau-az Jul 23, 2020
82b05dc
Merge remote-tracking branch 'cluster-api-provider-azure/stack-main' …
chlau-az Jul 24, 2020
5ca0944
Fixed new loadbalancer service
chlau-az Jul 24, 2020
64c6317
Changed API versions for new services added
chlau-az Jul 24, 2020
20b7a05
Fixed scalesets service
chlau-az Jul 24, 2020
7655c1b
Fixed virtualmachines service
chlau-az Jul 24, 2020
3daf6bf
Fixed loadbalancer service, removed call to getAvailablePrivateIP
chlau-az Jul 24, 2020
e9f4fb0
Removed accelerated networking check to avoid resource sku cache
chlau-az Jul 24, 2020
33f5efe
Created documentation for Azure Stack clusterctl and environment
chlau-az Jul 25, 2020
97fa9a6
Fixed documentation typo
chlau-az Jul 25, 2020
ba8714c
Moved pre/post kubeadm commands to script
chlau-az Jul 27, 2020
086df1c
Reverted tilt files
chlau-az Jul 27, 2020
f4b54e9
Removed log debug statements
chlau-az Jul 27, 2020
17f2d67
Corrected Azure Stack Hub disk storage account types
chlau-az Jul 28, 2020
a4cc6a1
Debugging kube controller manager
chlau-az Jul 30, 2020
4fad985
Still debugging kube controller manager
chlau-az Jul 30, 2020
0ab9aaf
Fixed kube controller manager error, in template
chlau-az Jul 31, 2020
f77596d
Created machinepool template
chlau-az Jul 31, 2020
41bf25d
Fixed template typo
chlau-az Jul 31, 2020
9ab8420
Fixed machine pool vmss not being created
chlau-az Aug 1, 2020
ecda6bc
Fixed flavors and templates for aad and adfs, using machinepool
chlau-az Aug 3, 2020
72ecdf7
Fixed E2E tests for Azure Stack
chlau-az Aug 12, 2020
936e8fe
Changed capi image to v0.3.8
chlau-az Aug 12, 2020
8b61bb1
Fixed azure stack flavor sed unknown option
chlau-az Aug 12, 2020
9b987af
Fixed azure stack aad and adfs flavors to reflect recent commit changes
chlau-az Aug 13, 2020
ec05b3a
Updated Azure Stack flavors for E2E tests
chlau-az Aug 13, 2020
40575c1
Removed debug statements
chlau-az Aug 13, 2020
e7f75db
Updated Azure Stack documentation, made consistent aad/adfs
chlau-az Aug 14, 2020
41b562f
Merged aad and adfs flavors into one azure stack flavor
chlau-az Aug 14, 2020
23b6e69
Removed remaining debug statements
chlau-az Aug 18, 2020
39ea3b6
Linted Azure Stack markdown files
chlau-az Aug 18, 2020
0022cd2
Merge pull request #2 from chlau-az/stack-2
jadarsie Aug 18, 2020
8398d77
Create Dockerfile dev copy for certs
chlau-az Aug 20, 2020
03e2397
Merge pull request #3 from chlau-az/stack-2
jadarsie Aug 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
!/main.go
!/go.mod
!/go.sum
!/.vscode/**
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
# Copy the controller-manager into a thin image
FROM gcr.io/distroless/static:latest
WORKDIR /
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
COPY --from=builder /workspace/manager .
USER nobody
ENTRYPOINT ["/manager"]
50 changes: 50 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed 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.

# Build the manager binary
FROM golang:1.13.8 as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
ARG goproxy=https://proxy.golang.org
ENV GOPROXY=$goproxy

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the sources
COPY ./ ./

# Build
ARG ARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -a -ldflags '-extldflags "-static"' \
-o manager .


COPY .vscode/azs.crt /usr/local/share/ca-certificates/
COPY .vscode/azs02.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates

# Copy the controller-manager into a thin image
FROM gcr.io/distroless/static:latest
WORKDIR /
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
COPY --from=builder /workspace/manager .
USER nobody
ENTRYPOINT ["/manager"]
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ test-e2e: $(ENVSUBST) $(GINKGO) ## Run e2e tests
-e2e.config="$(E2E_CONF_FILE_ENVSUBST)" \
-e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER)

.PHONY: test-e2e-dev
test-e2e-dev: $(ENVSUBST) $(GINKGO) ## Run e2e tests
PULL_POLICY=IfNotPresent $(MAKE) docker-build-dev
MANAGER_IMAGE=$(CONTROLLER_IMG)-$(ARCH):$(TAG) \
$(ENVSUBST) < $(E2E_CONF_FILE) > $(E2E_CONF_FILE_ENVSUBST) && \
$(GINKGO) -v -trace -tags=e2e -focus=$(GINKGO_FOCUS) -nodes=$(GINKGO_NODES) --noColor=$(GINKGO_NOCOLOR) ./test/e2e -- \
-e2e.artifacts-folder="$(ARTIFACTS)" \
-e2e.config="$(E2E_CONF_FILE_ENVSUBST)" \
-e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER)

$(KUBECTL) $(KUBE_APISERVER) $(ETCD): ## install test asset kubectl, kube-apiserver, etcd
source ./scripts/fetch_ext_bins.sh && fetch_tools

Expand Down Expand Up @@ -272,7 +282,13 @@ generate-flavors: $(KUSTOMIZE)
docker-build: ## Build the docker image for controller-manager
docker build --pull --build-arg ARCH=$(ARCH) . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG)
MANIFEST_IMG=$(CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) $(MAKE) set-manifest-image
$(MAKE) set-manifest-pull-policy
$(MAKE) set-manifest-pull-policy

.PHONY: docker-build-dev
docker-build-dev: ## Build the docker image for controller-manager
docker build -f Dockerfile.dev --pull --build-arg ARCH=$(ARCH) . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG)
MANIFEST_IMG=$(CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) $(MAKE) set-manifest-image
$(MAKE) set-manifest-pull-policy

.PHONY: docker-push
docker-push: ## Push the docker image
Expand Down Expand Up @@ -384,7 +400,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST)
kubectl wait --for=condition=Available --timeout=5m apiservice v1beta1.webhook.cert-manager.io

# Deploy CAPI
curl -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.7/cluster-api-components.yaml | $(ENVSUBST) | kubectl apply -f -
curl -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.8/cluster-api-components.yaml | $(ENVSUBST) | kubectl apply -f -

# Deploy CAPZ
kind load docker-image $(CONTROLLER_IMG)-$(ARCH):$(TAG) --name=capz
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions api/v1alpha3/azuremachine_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"encoding/base64"
"fmt"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
"golang.org/x/crypto/ssh"
"k8s.io/apimachinery/pkg/util/validation/field"
)
Expand Down Expand Up @@ -110,7 +109,7 @@ func ValidateOSDisk(osDisk OSDisk, fieldPath *field.Path) field.ErrorList {
allErrs = append(allErrs, err)
}

if osDisk.DiffDiskSettings != nil && osDisk.DiffDiskSettings.Option == string(compute.Local) && osDisk.ManagedDisk.StorageAccountType != "Standard_LRS" {
if osDisk.DiffDiskSettings != nil && osDisk.DiffDiskSettings.Option == "Local" && osDisk.ManagedDisk.StorageAccountType != "Standard_LRS" {
allErrs = append(allErrs, field.Invalid(
fieldPath.Child("managedDisks").Child("storageAccountType"),
osDisk.ManagedDisk.StorageAccountType,
Expand All @@ -134,7 +133,7 @@ func ValidateManagedDisk(old, new ManagedDisk, fieldPath *field.Path) field.Erro

func validateDiffDiskSetings(d *DiffDiskSettings, fldPath *field.Path) *field.Error {
if d != nil {
if d.Option != string(compute.Local) {
if d.Option != "Local" {
return field.Invalid(
fldPath.Child("option"),
d,
Expand Down Expand Up @@ -184,11 +183,12 @@ func validateStorageAccountType(storageAccountType string, fieldPath *field.Path
return allErrs
}

for _, possibleStorageAccountType := range compute.PossibleDiskStorageAccountTypesValues() {
possibleDiskStorageAccountTypesValues := []string{"Premium_LRS", "Standard_LRS"}
for _, possibleStorageAccountType := range possibleDiskStorageAccountTypesValues {
if string(possibleStorageAccountType) == storageAccountType {
return allErrs
}
}
allErrs = append(allErrs, field.Invalid(storageAccTypeChildPath, "", fmt.Sprintf("allowed values are %v", compute.PossibleDiskStorageAccountTypesValues())))
allErrs = append(allErrs, field.Invalid(storageAccTypeChildPath, "", fmt.Sprintf("allowed values are %v", possibleDiskStorageAccountTypesValues)))
return allErrs
}
5 changes: 2 additions & 3 deletions api/v1alpha3/azuremachine_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"fmt"
"testing"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
"github.com/Azure/go-autorest/autorest/to"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -91,7 +90,7 @@ func TestAzureMachine_ValidateOSDisk(t *testing.T) {
DiskSizeGB: 30,
OSType: "blah",
DiffDiskSettings: &DiffDiskSettings{
Option: string(compute.Local),
Option: "Local",
},
ManagedDisk: ManagedDisk{
StorageAccountType: "Standard_LRS",
Expand Down Expand Up @@ -161,7 +160,7 @@ func generateNegativeTestCases() []osDiskTestInput {
StorageAccountType: "Premium_LRS",
},
DiffDiskSettings: &DiffDiskSettings{
Option: string(compute.Local),
Option: "Local",
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion cloud/converters/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package converters
import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
"github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute"
"github.com/pkg/errors"

infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3"
Expand Down
2 changes: 1 addition & 1 deletion cloud/converters/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package converters

import (
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
"github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute"
"github.com/Azure/go-autorest/autorest/to"
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3"
)
Expand Down
18 changes: 11 additions & 7 deletions cloud/converters/vmss.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package converters

import (
"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
"github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute"
"github.com/Azure/go-autorest/autorest/to"

infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3"
Expand All @@ -37,9 +37,11 @@ func SDKToVMSS(sdkvmss compute.VirtualMachineScaleSet, sdkinstances []compute.Vi
vmss.Capacity = to.Int64(sdkvmss.Sku.Capacity)
}

if sdkvmss.Zones != nil && len(*sdkvmss.Zones) > 0 {
vmss.Zones = to.StringSlice(sdkvmss.Zones)
}
/*
if sdkvmss.Zones != nil && len(*sdkvmss.Zones) > 0 {
vmss.Zones = to.StringSlice(sdkvmss.Zones)
}
*/

if len(sdkvmss.Tags) > 0 {
vmss.Tags = MapToTags(sdkvmss.Tags)
Expand All @@ -55,9 +57,11 @@ func SDKToVMSS(sdkvmss compute.VirtualMachineScaleSet, sdkinstances []compute.Vi
State: infrav1.VMState(to.String(vm.ProvisioningState)),
}

if vm.Zones != nil && len(*vm.Zones) > 0 {
instance.AvailabilityZone = to.StringSlice(vm.Zones)[0]
}
/*
if vm.Zones != nil && len(*vm.Zones) > 0 {
instance.AvailabilityZone = to.StringSlice(vm.Zones)[0]
}
*/
vmss.Instances[i] = instance
}
}
Expand Down
20 changes: 10 additions & 10 deletions cloud/converters/vmss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"testing"

"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
"github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute"
"github.com/Azure/go-autorest/autorest/to"
"github.com/onsi/gomega"

Expand All @@ -40,39 +40,39 @@ func Test_SDKToVMSS(t *testing.T) {
tags := map[string]*string{
"foo": to.StringPtr("bazz"),
}
zones := []string{"zone0", "zone1"}
// zones := []string{"zone0", "zone1"}
return compute.VirtualMachineScaleSet{
Sku: &compute.Sku{
Name: to.StringPtr("skuName"),
Tier: to.StringPtr("skuTier"),
Capacity: to.Int64Ptr(2),
},
Zones: to.StringSlicePtr(zones),
// Zones: to.StringSlicePtr(zones),
ID: to.StringPtr("vmssID"),
Name: to.StringPtr("vmssName"),
Location: to.StringPtr("westus2"),
Tags: tags,
VirtualMachineScaleSetProperties: &compute.VirtualMachineScaleSetProperties{
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
ProvisioningState: to.StringPtr("Succeded"),
},
},
[]compute.VirtualMachineScaleSetVM{
{
InstanceID: to.StringPtr("0"),
ID: to.StringPtr("vm/0"),
Name: to.StringPtr("vm0"),
Zones: to.StringSlicePtr([]string{"zone0"}),
// Zones: to.StringSlicePtr([]string{"zone0"}),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
ProvisioningState: to.StringPtr("Succeeded"),
},
},
{
InstanceID: to.StringPtr("1"),
ID: to.StringPtr("vm/1"),
Name: to.StringPtr("vm1"),
Zones: to.StringSlicePtr([]string{"zone1"}),
// Zones: to.StringSlicePtr([]string{"zone1"}),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
ProvisioningState: to.StringPtr("Succeeded"),
},
},
}
Expand All @@ -83,8 +83,8 @@ func Test_SDKToVMSS(t *testing.T) {
Name: "vmssName",
Sku: "skuName",
Capacity: 2,
Zones: []string{"zone0", "zone1"},
State: "Succeeded",
// Zones: []string{"zone0", "zone1"},
State: "Succeeded",
Tags: map[string]string{
"foo": "bazz",
},
Expand Down
Loading