Skip to content

Commit

Permalink
Remove OpenShift support (Azure#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma authored Dec 5, 2018
1 parent eb24a97 commit 49ed37b
Show file tree
Hide file tree
Showing 126 changed files with 63 additions and 10,039 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ test/aks-engine-test/report/TestReport.json

# I have no idea why these get generated when I run the e2e test
test/e2e/kubernetes/translations/
test/e2e/openshift/translations/
pkg/openshift/translations/

# test outputs
cmd/_test_output
Expand Down
1 change: 0 additions & 1 deletion .prowci/plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ config_updater:
label:
additional_labels:
- orchestrator/k8s
- orchestrator/openshift
- orchestrator/dcos
- orchestrator/swarm
- DO-NOT-MERGE
Expand Down
7 changes: 1 addition & 6 deletions Gopkg.lock

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

4 changes: 0 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ required = [
name = "gopkg.in/go-playground/validator.v9"
version = "9.4.0"

[[constraint]]
name = "gopkg.in/yaml.v2"
version = "2.0.0"

[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.10.0"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ifneq ($(GIT_BASEDIR),)
endif

test: generate
ginkgo -skipPackage test/e2e/dcos,test/e2e/kubernetes,test/e2e/openshift -failFast -r .
ginkgo -skipPackage test/e2e/dcos,test/e2e/kubernetes -failFast -r .

.PHONY: test-style
test-style:
Expand Down
29 changes: 0 additions & 29 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ const (
deployName = "deploy"
deployShortDescription = "Deploy an Azure Resource Manager template"
deployLongDescription = "Deploy an Azure Resource Manager template, parameters file and other assets for a cluster"

// aadServicePrincipal is a hard-coded service principal which represents
// Azure Active Dirctory (see az ad sp list)
aadServicePrincipal = "00000002-0000-0000-c000-000000000000"

// aadPermissionUserRead is the User.Read hard-coded permission on
// aadServicePrincipal (see az ad sp list)
aadPermissionUserRead = "311a71cc-e848-46a1-bdf8-97ff7156d8e6"
)

type deployCmd struct {
Expand Down Expand Up @@ -326,22 +318,6 @@ func autofillApimodel(dc *deployCmd) error {
appURL := fmt.Sprintf("https://%s/", appName)
var replyURLs *[]string
var requiredResourceAccess *[]graphrbac.RequiredResourceAccess
if dc.containerService.Properties.OrchestratorProfile.OrchestratorType == api.OpenShift {
appName = fmt.Sprintf("%s.%s.cloudapp.azure.com", appName, dc.containerService.Properties.AzProfile.Location)
appURL = fmt.Sprintf("https://%s:8443/", appName)
replyURLs = to.StringSlicePtr([]string{fmt.Sprintf("https://%s:8443/oauth2callback/Azure%%20AD", appName)})
requiredResourceAccess = &[]graphrbac.RequiredResourceAccess{
{
ResourceAppID: to.StringPtr(aadServicePrincipal),
ResourceAccess: &[]graphrbac.ResourceAccess{
{
ID: to.StringPtr(aadPermissionUserRead),
Type: to.StringPtr("Scope"),
},
},
},
}
}
applicationResp, servicePrincipalObjectID, secret, err := dc.client.CreateApp(ctx, appName, appURL, replyURLs, requiredResourceAccess)
if err != nil {
return errors.Wrap(err, "apimodel invalid: ServicePrincipalProfile was empty, and we failed to create valid credentials")
Expand Down Expand Up @@ -469,10 +445,5 @@ func (dc *deployCmd) run() error {
log.Fatalln(err)
}

if dc.containerService.Properties.OrchestratorProfile.OrchestratorType == api.OpenShift {
// TODO: when the Azure client library is updated, read this from the template `masterFQDN` output
fmt.Printf("OpenShift web UI available at https://%s.%s.cloudapp.azure.com:8443/\n", dc.containerService.Properties.MasterProfile.DNSPrefix, dc.location)
}

return nil
}
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
const (
rootName = "aks-engine"
rootShortDescription = "AKS-Engine deploys and manages container orchestrators in Azure"
rootLongDescription = "AKS-Engine deploys and manages Kubernetes, OpenShift, Swarm Mode, and DC/OS clusters in Azure"
rootLongDescription = "AKS-Engine deploys and manages Kubernetes, Swarm Mode, and DC/OS clusters in Azure"
)

var (
Expand Down
28 changes: 2 additions & 26 deletions cmd/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package cmd

import (
"bytes"
"context"
"encoding/json"
"fmt"
Expand All @@ -23,7 +22,6 @@ import (
"github.com/Azure/aks-engine/pkg/engine/transform"
"github.com/Azure/aks-engine/pkg/helpers"
"github.com/Azure/aks-engine/pkg/i18n"
"github.com/Azure/aks-engine/pkg/openshift/filesystem"
"github.com/Azure/aks-engine/pkg/operations"
"github.com/leonelquinteros/gotext"
"github.com/pkg/errors"
Expand Down Expand Up @@ -56,8 +54,8 @@ type scaleCmd struct {

const (
scaleName = "scale"
scaleShortDescription = "Scale an existing Kubernetes or OpenShift cluster"
scaleLongDescription = "Scale an existing Kubernetes or OpenShift cluster by specifying increasing or decreasing the node count of an agentpool"
scaleShortDescription = "Scale an existing Kubernetes cluster"
scaleLongDescription = "Scale an existing Kubernetes cluster by specifying increasing or decreasing the node count of an agentpool"
apiModelFilename = "apimodel.json"
)

Expand Down Expand Up @@ -279,20 +277,6 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error {
if err != nil {
return errors.Wrap(err, "Got error while draining the nodes to be deleted")
}
case api.OpenShift:
bundle := bytes.NewReader(sc.containerService.Properties.OrchestratorProfile.OpenShiftConfig.ConfigBundles["master"])
fs, err := filesystem.NewTGZReader(bundle)
if err != nil {
return errors.Wrap(err, "failed to read master bundle")
}
kubeConfig, err := fs.ReadFile("etc/origin/master/admin.kubeconfig")
if err != nil {
return errors.Wrap(err, "failed to read kube config")
}
err = sc.drainNodes(string(kubeConfig), vmsToDelete)
if err != nil {
return errors.Wrap(err, "Got error while draining the nodes to be deleted")
}
}

errList := operations.ScaleDownVMs(sc.client, sc.logger, sc.SubscriptionID.String(), sc.resourceGroupName, vmsToDelete...)
Expand Down Expand Up @@ -389,14 +373,6 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error {
templateJSON["variables"].(map[string]interface{})[sc.agentPool.Name+"Index"] = winPoolIndex
}
switch orchestratorInfo.OrchestratorType {
case api.OpenShift:
err = transformer.NormalizeForOpenShiftVMASScalingUp(sc.logger, sc.agentPool.Name, templateJSON)
if err != nil {
return errors.Wrapf(err, "error tranforming the template for scaling template %s", sc.apiModelPath)
}
if sc.agentPool.IsAvailabilitySets() {
addValue(parametersJSON, fmt.Sprintf("%sOffset", sc.agentPool.Name), highestUsedIndex+1)
}
case api.Kubernetes:
err = transformer.NormalizeForK8sVMASScalingUp(sc.logger, templateJSON)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion docs/acsengine.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ The build process leaves the compiled `aks-engine` binary in the `bin` directory

```sh
$ ./bin/aks-engine
AKS Engine deploys and manages Kubernetes, OpenShift, Swarm Mode, and DC/OS clusters in Azure
AKS Engine deploys and manages Kubernetes, Swarm Mode, and DC/OS clusters in Azure

Usage:
aks-engine [command]
Expand Down
2 changes: 1 addition & 1 deletion docs/acsengine.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ make build

```
# ./bin/aks-engine
AKS Engine deploys and manages Kubernetes, OpenShift, Swarm Mode, and DC/OS clusters in Azure
AKS Engine deploys and manages Kubernetes, Swarm Mode, and DC/OS clusters in Azure
Usage:
aks-engine [command]
Expand Down
Loading

0 comments on commit 49ed37b

Please sign in to comment.