sfmesh

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

README

Kubernetes Virtual Kubelet with Service Fabric Mesh

Service Fabric Mesh is a fully managed service that enables developers to deploy microservices applications without managing virtual machines, storage, or networking. Applications hosted on Service Fabric Mesh run and scale without you worrying about the infrastructure powering them.

The Virtual kubelet integration allows you to use the Kubernetes API to burst out compute to Service Fabric Mesh and schedule pods as Mesh Applications.

Status: Experimental

This provider is currently in the experimental stages. Contributions are welcome!

Setup

The provider expects the following environment variables to be configured:

  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
  • AZURE_SUBSCRIPTION_ID
  • AZURE_TENANT_ID
  • RESOURCE_GROUP
  • REGION

Quick Start

Run the Virtual Kubelet
./virtual-kubelet --provider=sfmesh --taint azure.com/sfmesh
Create pod yaml:
$ cat pod-nginx
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  nodeName: virtual-kubelet
  containers:
  - name: nginx
    image: nginx:latest
    ports:
    - containerPort: 80
  tolerations:
  - key: azure.com/sfmesh
    effect: NoSchedule
create pod
$ kubectl create -f pod-nginx
list containers on Service Fabric Mesh
$ az mesh app list -o table

Name    ResourceGroup    ProvisioningState    Location
------  ---------------  -------------------  ----------
nginx   myResourceGroup  Succeeded            eastus

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	Auth          string `json:"auth,omitempty"`
	Email         string `json:"email,omitempty"`
	ServerAddress string `json:"serveraddress,omitempty"`
	IdentityToken string `json:"identitytoken,omitempty"`
	RegistryToken string `json:"registrytoken,omitempty"`
}

AuthConfig is the secret returned from an ImageRegistryCredential

type SFMeshProvider

type SFMeshProvider struct {
	// contains filtered or unexported fields
}

SFMeshProvider implements the Virtual Kubelet provider interface

func NewSFMeshProvider

func NewSFMeshProvider(rm *manager.ResourceManager, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*SFMeshProvider, error)

NewSFMeshProvider creates a new SFMeshProvider

func (*SFMeshProvider) Capacity

func (p *SFMeshProvider) Capacity() v1.ResourceList

Capacity returns a resource list containing the capacity limits set for SF Mesh.

func (*SFMeshProvider) CreatePod

func (p *SFMeshProvider) CreatePod(pod *v1.Pod) error

CreatePod accepts a Pod definition and creates a SF Mesh App.

func (*SFMeshProvider) DeletePod

func (p *SFMeshProvider) DeletePod(pod *v1.Pod) (err error)

DeletePod deletes the specified pod out of SF Mesh.

func (*SFMeshProvider) ExecInContainer

func (p *SFMeshProvider) ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error

ExecInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr.

func (*SFMeshProvider) GetContainerLogs

func (p *SFMeshProvider) GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)

GetContainerLogs retrieves the logs of a container by name.

func (*SFMeshProvider) GetPod

func (p *SFMeshProvider) GetPod(namespace, name string) (pod *v1.Pod, err error)

GetPod returns a pod by name that is running inside SF Mesh. returns nil if a pod by that name is not found.

func (*SFMeshProvider) GetPodFullName

func (p *SFMeshProvider) GetPodFullName(namespace string, pod string) string

GetPodFullName gets the full pod name as defined in the provider context

func (*SFMeshProvider) GetPodStatus

func (p *SFMeshProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error)

GetPodStatus returns the status of a pod by name that is "running". returns nil if a pod by that name is not found.

func (*SFMeshProvider) GetPods

func (p *SFMeshProvider) GetPods() ([]*v1.Pod, error)

GetPods returns a list of all pods known to be running within SF Mesh.

func (*SFMeshProvider) NodeAddresses

func (p *SFMeshProvider) NodeAddresses() []v1.NodeAddress

NodeAddresses returns a list of addresses for the node status within Kubernetes.

func (*SFMeshProvider) NodeConditions

func (p *SFMeshProvider) NodeConditions() []v1.NodeCondition

NodeConditions returns a list of conditions (Ready, OutOfDisk, etc), for updates to the node status within Kubernetes.

func (*SFMeshProvider) NodeDaemonEndpoints

func (p *SFMeshProvider) NodeDaemonEndpoints() *v1.NodeDaemonEndpoints

NodeDaemonEndpoints returns NodeDaemonEndpoints for the node status within Kubernetes.

func (*SFMeshProvider) OperatingSystem

func (p *SFMeshProvider) OperatingSystem() string

OperatingSystem returns the operating system for this provider. This is a noop to default to Linux for now.

func (*SFMeshProvider) UpdatePod

func (p *SFMeshProvider) UpdatePod(pod *v1.Pod) error

UpdatePod updates the pod running inside SF Mesh.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL