Giter Club home page Giter Club logo

azure-fqdn-operator's Introduction

POC Operator - Create AZUR FQDN on service creation

Create a secret with an Azure service principal client credentials, tenant id, and subscription id.

apiVersion: v1
kind: Secret
metadata:
  name: azure
type: Opaque
data:
  AZURE_CLIENT_ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  AZURE_CLIENT_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  AZURE_TENANT_ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  AZURE_SUBSCRIPTION_ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Run the operator with the following manifest.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: azure-fqdn-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: azure-fqdn-operator
  template:
    metadata:
      labels:
        name: azure-fqdn-operator
    spec:
      containers:
        - name: azure-fqdn-operator
          image: neilpeterson/azure-fqdn-operator
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - azure-fqdn-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: AZURE_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: azure
                  key: AZURE_CLIENT_ID
            - name: AZURE_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: azure
                  key: AZURE_CLIENT_SECRET
            - name: AZURE_TENANT_ID
              valueFrom:
                secretKeyRef:
                  name: azure
                  key: AZURE_TENANT_ID
            - name: AZURE_SUBSCRIPTION_ID
              valueFrom:
                secretKeyRef:
                  name: azure
                  key: AZURE_SUBSCRIPTION_ID
            - name: OPERATOR_NAME
              value: "azure-fqdn-operator"

Create a service with the following annotations.

value description
azure-fqdn-value DNS prefix name
azure-fqdn-rg AKS node resource group (MC_..)
azure-fqdn-location Resource group location

Example:

apiVersion: v1
kind: Service
metadata:
  name: service-annotation-is-lb-5
  annotations: {
    "azure-fqdn-value": "demo-app-030",
    "azure-fqdn-rg": "MC_scottyCarbone_scottyCarbone_eastus",
    "azure-fqdn-location": "eastus"
  }
spec:
  type: LoadBalancer
  ports:
  - port: 80

Once run, the Azure Public IP Address assigned to the service will be updated with a DNS name.

azure-fqdn-operator's People

Contributors

neilpeterson avatar

Watchers

 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.