This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<domstatus state='running' reason='booted' pid='93'> | |
<taint flag='custom-monitor'/> | |
<monitor path='/var/lib/libvirt/qemu/domain-1-mvp-static_static-vm/monitor.sock' type='unix'/> | |
<vcpus> | |
<vcpu id='0' pid='98'/> | |
<vcpu id='1' pid='99'/> | |
<vcpu id='2' pid='100'/> | |
<vcpu id='3' pid='101'/> | |
</vcpus> | |
<qemuCaps> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
dhctl "github.com/deckhouse/deckhouse/dhctl/pkg/config" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "kubernetes_manifest" "vmd" { | |
manifest = { | |
"apiVersion" = "virtualization.deckhouse.io/v1alpha2" | |
"kind" = "VirtualMachineDisk" | |
"metadata" = { | |
"name" = var.root_disk_name | |
"namespace" = var.namespace | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Scripts checks images and its layers for currently used virtualization module | |
# mpo virtualization is needed! | |
rst='\033[0m' # Text Reset | |
red='\033[0;31m' # Red | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap 'other_commands' EXIT | |
other_commands() { | |
echo "Closing..." | |
jobs -p | xargs kill 2>/dev/null | |
} | |
random_port() { | |
echo $((10000 + $RANDOM % 20000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rst='\033[0m' # Text Reset | |
red='\033[0;31m' # Red | |
module_image_path="dev-registry.deckhouse.io/sys/deckhouse-oss/modules/virtualization" | |
virtualization_image_digest=$(kubectl get mpo virtualization -o json | jq .status.imageDigest -r) | |
module_images=$(crane export ${module_image_path}@${virtualization_image_digest} | tar -Oxf - images_digests.json | jq '. | to_entries | .[]' -c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import yaml | |
keepIt = ["description"] | |
def custom_represent(dumper, data): | |
if len(data) > 30: # Set a condition for when to use the | | |
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ns=tfprod | |
vms=$(kubectl -n ${ns} get pods -l vm.kubevirt.io/name -o json | jq '.items[] | select(.status.phase=="Running") | { ns: .metadata.namespace, name: .metadata.name, node: .spec.nodeName, claims: [.spec.volumes[] | select(.persistentVolumeClaim!=null) | .persistentVolumeClaim.claimName] }' -cr) | |
for vm in ${vms}; do | |
echo ${vm} | jq '. | {ns,name,node}' -c | |
pvcs=$(echo ${vm} | jq .claims[] -r) | |
for pvc in ${pvcs}; do | |
volume_name=$(kubectl -n ${ns} get pvc ${pvc} -o json | jq .spec.volumeName -r) | |
echo "${pvc} / ${volume_name}" | |
kubectl exec -n d8-linstor deploy/linstor-controller -- linstor r l -r ${volume_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TMP_DIR=./tmp | |
IMAGE_NAME=cirros-0.5.1 | |
IMAGE_PATH=${TMP_DIR}/${IMAGE_NAME} | |
# https://docs.openstack.org/image-guide/obtain-images.html | |
bold := $(shell tput bold) | |
red := $(shell tput setaf 1) | |
green := $(shell tput setaf 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hooks | |
import ( | |
"github.com/flant/addon-operator/pkg/module_manager/go_hook" | |
"github.com/flant/addon-operator/sdk" | |
"github.com/flant/shell-operator/pkg/kube/object_patch" | |
) | |
var _ = sdk.RegisterFunc(&go_hook.HookConfig{ | |
OnAfterDeleteHelm: &go_hook.OrderedConfig{Order: 10}, |
NewerOlder