volumegroup

package
v0.0.0-...-83aa6d9 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetadataURL is metadata server url
	MetadataURL = "http://100.100.100.200/latest/meta-data/"
	// InstanceID is the instance id tag
	InstanceID = "instance-id"
	// RegionIDTag is the region id tag
	RegionIDTag = "region-id"
	// NsenterCmd is the nsenter command
	NsenterCmd = "/usr/bin/nsenter --mount=/proc/1/ns/mnt "
)
View Source
const (
	StorageCmNameSpace = "kube-system"
	StorageCmName      = "cm-node-resource"
	VGConfigKey        = "volumegroup.json"
	AliyunLocalDisk    = "aliyun-local-disk"

	VgConfigFile = "/etc/unified-config/volumegroup"
	VgTypeDevice = "device"
	VgTypePvc    = "pvc"
	VgTypeLocal  = "alibabacloud-local-disk"
	VgTypePmem   = "pmem"
)
View Source
const (
	// ConfigPath the secret mount file
	ConfigPath = "/var/addon/token-config"
)

Variables

View Source
var DeviceChars = []string{"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

DeviceChars ...

Functions

func Decrypt

func Decrypt(s string, keyring []byte) ([]byte, error)

Decrypt secret Decrypt

func GetDefaultAK

func GetDefaultAK() (string, string, string)

GetDefaultAK read default ak from local file or from STS

func GetLocalAK

func GetLocalAK() (string, string)

GetLocalAK read ossfs ak from local or from secret file

func GetManagedToken

func GetManagedToken() (string, string, string)

GetManagedToken get ak from csi secret

func GetMetaData

func GetMetaData(resource string) string

GetMetaData get host regionid, zoneid

func GetSTSAK

func GetSTSAK() (string, string, string)

GetSTSAK get STS AK and token from ecs meta server

func ListDevice

func ListDevice(vgName string) []string

func NewEcsClient

func NewEcsClient(regionID, accessKeyID, accessKeySecret, accessToken string) (ecsClient *ecs.Client)

NewEcsClient create a ecsClient object

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding get pkc

Types

type AKInfo

type AKInfo struct {
	// AccessKeyId access key id
	AccessKeyID string `json:"access.key.id"`
	// AccessKeySecret access key secret
	AccessKeySecret string `json:"access.key.secret"`
	// SecurityToken security token
	SecurityToken string `json:"security.token"`
	// Expiration expiration duration
	Expiration string `json:"expiration"`
	// Keyring key ring
	Keyring string `json:"keyring"`
}

AKInfo access key info

type ResourceManager

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

ResourceManager ...

func NewResourceManager

func NewResourceManager() *ResourceManager

NewResourceManager ...

func (*ResourceManager) AnalyseConfigMap

func (vrm *ResourceManager) AnalyseConfigMap() error

AnalyseConfigMap analyse pmem resource config

func (*ResourceManager) ApplyResourceDiff

func (vrm *ResourceManager) ApplyResourceDiff() error

ApplyResourceDiff apply volume group resource to current node

type RoleAuth

type RoleAuth struct {
	AccessKeyID     string
	AccessKeySecret string
	Expiration      time.Time
	SecurityToken   string
	LastUpdated     time.Time
	Code            string
}

RoleAuth define STS Token Response

type VgDeviceConfig

type VgDeviceConfig struct {
	Name            string   `json:"name,omitempty"`
	PhysicalVolumes []string `json:"physicalVolumes,omitempty"`
}

VgDeviceConfig ...

type VgList

type VgList struct {
	VolumeGroups []model.ResourceYaml `yaml:"volumegroup,omitempty"`
}

VgList ...

Jump to

Keyboard shortcuts

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