Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(s string, keyring []byte) ([]byte, error)
- func GetDefaultAK() (string, string, string)
- func GetLocalAK() (string, string)
- func GetManagedToken() (string, string, string)
- func GetMetaData(resource string) string
- func GetSTSAK() (string, string, string)
- func ListDevice(vgName string) []string
- func NewEcsClient(regionID, accessKeyID, accessKeySecret, accessToken string) (ecsClient *ecs.Client)
- func PKCS5UnPadding(origData []byte) []byte
- type AKInfo
- type ResourceManager
- type RoleAuth
- type VgDeviceConfig
- type VgList
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 GetDefaultAK ¶
GetDefaultAK read default ak from local file or from STS
func GetLocalAK ¶
GetLocalAK read ossfs ak from local or from secret file
func GetManagedToken ¶
GetManagedToken get ak from csi secret
func ListDevice ¶
func NewEcsClient ¶
func NewEcsClient(regionID, accessKeyID, accessKeySecret, accessToken string) (ecsClient *ecs.Client)
NewEcsClient create a ecsClient object
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 (*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 ...
Click to show internal directories.
Click to hide internal directories.