Code Monkey home page Code Monkey logo

azure-habitat-example's Introduction

azure-habitat-example

Example application for blog post on deploying to AKS & ACR with Habitat

See http://habitat.sh/blog/2018/05/aks-and-acr-walkthrough for the full details of the walkthrough.

Contents

Dependencies

You need the following tools installed on the workstation you're running these scripts from:

  • az
  • kubectl
  • helm
  • svcat

Setting up the cluster

  1. Run scripts/setup-aks-acr.sh. This will create a resource group (by default habitat-aks-demo) containing both a AKS instance as well as a ACR registry. It will grant Owner rights on the ACR register to the AKS Service Principal so it can pull images from ACR.

At the end of the run it will output some configuration details to be used for the Habitat Builder integration:

...
...
...
Configuration Details for Habitat Builder:
  Server URL : habitatregistry.azurecr.io
  Service Principal ID : 9104325b-d11a-40a9-8178-7ec858aed4bd
  Service Principal Password : **************
  1. Run scripts/setup-service-catalog.sh to setup the Service Catalog. This will take some time to run and get all the pods started correctly. Wait unit svcat get plans returns successfully before progressing to next step.

You can check if the catalog is ready by looking at the status of the pods in the catalog namespace:

$ kubectl get pods --namespace catalog
NAME                                                  READY     STATUS    RESTARTS   AGE
catalog-catalog-apiserver-77dbbd4cc5-m55ds            1/2       Running   0          3m
catalog-catalog-controller-manager-6c7b679dc9-9rdhn   0/1       Running   4          3m
  1. Run scripts/setup-osba.sh to install the Open Service Broker for Azure

You can check if the broker is running by looking at the status of the pods in the osba namespace:

$ kubectl get pods --namespace osba
NAME                                              READY     STATUS    RESTARTS   AGE
osba-open-service-broker-azure-6b7d9f9c45-bjmfh   1/1       Running   3          7m
osba-redis-c555f5c6-zssxd                         1/1       Running   0          7m
  1. Add OSBA managed database instance and binding
$ kubectl apply -f osba/mysql-instance.yml
serviceinstance.servicecatalog.k8s.io "osba-mysql" created
$ kubectl apply -f osba/mysql-binding.yml
servicebinding.servicecatalog.k8s.io "wordpress-mysql-binding" created
$ svcat get instances
     NAME      NAMESPACE        CLASS             PLAN            STATUS
+------------+-----------+-----------------+-----------------+--------------+
  osba-mysql   default     azure-mysql-5-7   general-purpose   Provisioning
$ svcat get bindings
           NAME             NAMESPACE    INSTANCE           STATUS
+-------------------------+-----------+------------+-----------------------+
  wordpress-mysql-binding   default     osba-mysql   ErrorInstanceNotReady

Wait until the instance and binding are provisioned.

  1. Run scripts/setup-habitat.sh to install via the habitat operator via Helm

  2. Configure habitat builder and republish packages

  3. Run Wordpress on OSBA example

$ kubectl apply -f deploy-osba-wordpress.yml

License

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.

azure-habitat-example's People

Contributors

jamesc avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.