Skip to content

Instantly share code, notes, and snippets.

View kunalkushwaha's full-sized avatar

Kunal Kushwaha kunalkushwaha

View GitHub Profile

Overview.

  • If stateful app(/Assuing Storage NAS) running on one node.

    • In case of network failure with Node, Pod will process the data. But K8s will rechedule the pod to new instance.
    • In such cases data corrucption can happens!.

    In case of failure on Node.

    • Notice that we can’t unmount the volume from the failed node
  • Use the Storage api to force detach the volume

Create container:

$ docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management

Here the default settings include user: user pass: user rabbitmq access port : 5672

@kunalkushwaha
kunalkushwaha / go.mod
Created December 4, 2019 07:50
sample go.mod for using kubevirt client-go by third party apps
module github.com/kunalkushwaha/kubevirtmon
go 1.12
require (
github.com/cjbassi/gotop v0.0.0-20190715230637-2cd92e147e6b
github.com/gizak/termui/v3 v3.1.0
github.com/spf13/pflag v1.0.3
k8s.io/apimachinery v0.0.0-20190719140911-bfcf53abc9f8
kubevirt.io/client-go v0.24.0
$ make cluster-sync
PUSH_LOG_FILE= ./hack/cluster-build.sh
Building ...
[+] Building 0.2s (9/9) FINISHED
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B
@kunalkushwaha
kunalkushwaha / kubevirt-issues.md
Created July 5, 2019 02:51
issues that need to follow up to Kubevirt community
  • We need mechnism to have static IP for Service in different network segment.
    • Lot of legacy systems are designed like that
    • Service should be the point of contact for VMs too, not ip of VM. kubevirt/kubevirt#861

Problem: As we discussed yesterday, we'd like to prepare for some specific technical discussion for the next interview. As I explained during our conversation yesterday, it's not unusual for engineers here to need to come up to speed on unfamiliar code bases as an integral part of investigating a customer issue.

With that in mind, as the role you're applying for has a heavy OpenStack component, we will ask you to please prepare to discuss aspects of the neutron openvswitch agent.

We would like you to study and be able to describe the code path in the OVSNeutronAgent.rpc_loop method in neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py.

We will discuss the overall flow of the code path executed. For this exercise, you can assume that the version of the Neutron code is the Rocky release of OpenStack, available through:

@kunalkushwaha
kunalkushwaha / buildkit-entitlement-test.go
Created April 19, 2019 07:08
Example to used buildkit entitlements with LLB
package main
import (
"context"
"fmt"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/util/entitlements"
)
@kunalkushwaha
kunalkushwaha / go_scp.go
Created April 8, 2019 05:18 — forked from jedy/go_scp.go
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
$ virtctl expose virtualmachineinstance vmi-trac --name trac --type NodePort --target-port 22
Service trac successfully exposed for virtualmachineinstance vmi-trac
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3d2h
trac NodePort 10.108.30.13 <none> 80:30322/TCP,22:31358/TCP 2s
$ kubectl apply -f postrgess-vmi.yaml
virtualmachineinstance.kubevirt.io/vmi-trac created
$ kubectl get vmi
NAME AGE PHASE IP NODENAME