Skip to content

Instantly share code, notes, and snippets.

View zshi-redhat's full-sized avatar
🏠
Working from home

zshi zshi-redhat

🏠
Working from home
  • Red Hat
  • Beijing
View GitHub Profile
@zshi-redhat
zshi-redhat / Note.md
Created January 10, 2019 09:31
Openshift Containernetworking cni plugins (supported/unsupported) DaemonSet yaml file
  1. In above yaml files, apiVersion is set to app/v1 as below, I copied it from Dan's PR which I think is used in openshift. With kubernetes, apiVersion is set to extensions/v1beta1

apiVersion: apps/v1

  1. the image names in above files will be replaced by env vars set in network operator manifests; example can be found here: https://github.com/openshift/cluster-network-operator/pull/54/commits/4211d3a41cf0b9cd526a1229c08453f18038a7d9#diff-1cf3d8447bdd10b4fd172cc55ca05700R37

{{.ContainerNetworkingCNIPluginsSupportedImage}} and {{.ContainerNetworkingCNIPluginsUnsupportedImage}}

@zshi-redhat
zshi-redhat / apply failure of CRD & CR in single run
Created January 11, 2019 07:36
Network operator testing - Multus Daemonset PR 54
[core@ip-10-0-15-231 cluster-network-operator]$ ./_output/linux/amd64/cluster-network-operator -v 6 --url-only-kubeconfig=/etc/kubernetes/kubeconfig
2019/01/11 07:17:45 Go Version: go1.10.3
2019/01/11 07:17:45 Go OS/Arch: linux/amd64
2019/01/11 07:17:45 operator-sdk Version: v0.1.0
2019/01/11 07:17:45 overriding kubernetes api to https://multus-test-cluster-api.devcluster.openshift.com:6443
INFO[0000] trying to become the leader
INFO[0000] Skipping leader election; not running in a cluster
2019/01/11 07:17:46 Registering Components.
2019/01/11 07:17:46 Starting the Cmd.
2019/01/11 07:17:46 Reconciling NetworkConfig /default
@zshi-redhat
zshi-redhat / sriov-admission-controller.yaml
Created January 15, 2019 09:08
SR-IOV admission controller manifests
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: sriov-device-plugin
name: sriovdp-admission-controller-sa
---
apiVersion: v1
kind: Secret
metadata:
name: sriovdp-admission-controller-sa-secret
apiVersion: "networkoperator.openshift.io/v1"
kind: "NetworkConfig"
metadata:
name: "default"
spec:
serviceNetwork: "172.30.0.0/16"
clusterNetworks:
- cidr: "10.128.0.0/14"
hostSubnetLength: 9
defaultNetwork:
apiVersion: "networkoperator.openshift.io/v1"
kind: "NetworkConfig"
metadata:
name: "default"
spec:
serviceNetwork: "172.30.0.0/16"
clusterNetworks:
- cidr: "10.128.0.0/14"
hostSubnetLength: 9
defaultNetwork:
apiVersion: v1
kind: Namespace
metadata:
name: multus
labels:
name: multus
openshift.io/run-level: "0"
annotations:
openshift.io/node-selector: "" #override default node selector
openshift.io/description: "Multus network plugin components"
apiVersion: v1
kind: Pod
metadata:
name: test1
spec:
containers:
- name: app1
image: centos/tools
imagePullPolicy: IfNotPresent
command: [ "/bin/bash", "-c", "--" ]
@zshi-redhat
zshi-redhat / scale.sh
Last active January 23, 2019 02:39
Multus-upgrade-pod-stability-test
#!/bin/bash
# scale up and down pod replicas
# sleep time is to ensure pods are created or deleted successfully
while true
do
oc scale --replicas 1 deployment/multus-test-deployment >/dev/null
sleep 20
oc scale --replicas 6 deployment/multus-test-deployment >/dev/null
sleep 20
[zshi@192 templates]$ oc describe pod multus-test-deployment-694d7d698c-bf52x
Name: multus-test-deployment-694d7d698c-bf52x
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: ip-10-0-128-153.ec2.internal/10.0.128.153
Start Time: Wed, 23 Jan 2019 12:23:41 +0800
Labels: app=multus-test-app
pod-template-hash=2508382547
Annotations: k8s.v1.cni.cncf.io/networks-status=[{
@zshi-redhat
zshi-redhat / install-k8s.sh
Last active December 2, 2019 02:19
sriov in VM with kube-1.16
#!/bin/bash
set -x
## On the undercloud, don't forget to configure the DNS
yum -y install docker
systemctl enable docker
systemctl start docker
cat <<EOF > /etc/yum.repos.d/kubernetes.repo