Skip to content

Instantly share code, notes, and snippets.

@nuthanc
nuthanc / NetworkPolicy.txt
Last active September 7, 2021 10:42
k8s session
Configuring Network Policy on default cirros pod to allow traffic only from cirros pod of Nuthan
kubectl create -f nut_ns.yml
kubectl create -f kir_ns.yml
kubectl run cirros --image=cirros -l app=kirthan -n kirthan
kubectl run cirros --image=cirros -l app=nuthan -n nuthan
kubectl run cirros --image=cirros -l app=default
@nuthanc
nuthanc / physical_setup.txt
Last active May 21, 2021 04:07
Physical setup configs and virtual problems
Physical setup fip is fixed please see the details and configs below .
I verified it manually ..please run the script and check once ..
[root@nodeg12 ~]# kubectl get svc -n ctest-namespace-48338615
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ctest-nginx-svc-54593658 ClusterIP 10.98.106.110 10.204.220.196 80/TCP 84m
@nuthanc
nuthanc / README.md
Last active May 21, 2021 11:49
k8s Ingress and external ip failures

Failure to reach external ip

  • wget to external ip's port 80 is failing
@nuthanc
nuthanc / ansible.sh
Created May 12, 2021 04:12
Pod-rename-scripts #Yuvaraja
#! /bin/bash <cluster_name>
POD_FILE='pod-name-uid-list'
HOST_FILE='hosts'
kubectl get pods --all-namespaces -o custom-columns=namespace:.metadata.namespace,name:.metadata.name,uid:.metadata.uid | grep -v namespace | sed 's/ * /:/g' | sed 's/:/__/1' | sed "s/^/$1__/g" > $POD_FILE
kubectl get nodes | grep -v NAME | cut -d ' ' -f 1 > $HOST_FILE
export ANSIBLE_HOST_KEY_CHECKING=false
ansible-playbook -i $HOST_FILE setup.yml --extra-vars "ansible_user=root ansible_password=c0ntrail123"
rm $POD_FILE
rm $HOST_FILE
@nuthanc
nuthanc / instances.yaml
Created May 6, 2021 15:28
Instances.yaml
deployment:
type:
contrail:
branch: R2011
registry: bng-artifactory.juniper.net/contrail-nightly
sku: queens
os: centos7
version: "R2011.L1.297"
orchestrator: kubernetes
deployer: contrail-ansible-deployer
@nuthanc
nuthanc / 1912_instances.yaml
Last active May 18, 2021 12:23
k8s upgrade ansible
deployment:
type:
contrail:
branch: R1912
registry: bng-artifactory.juniper.net/contrail-nightly
sku: queens
os: centos7
version: "1912.L2.58"
orchestrator: kubernetes
deployer: contrail-ansible-deployer
@nuthanc
nuthanc / history
Created April 30, 2021 07:35
Spirent noden1 history
cd /root/ActiveTcl-8.4/bin
pwd
ls
tclsh
which tclsh
tclsh
ls /volume/labtools/lib/Spirent/ActiveTcl-8.4/bin
cd
c
echo $PATH
@nuthanc
nuthanc / sshd_config
Created April 7, 2021 15:53
sshd_config nodei34
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
@nuthanc
nuthanc / contrail_test_input.yaml
Last active April 8, 2021 05:47
m21 contrail_test_input.yaml
contrail_configuration: {CLOUD_ORCHESTRATOR: openstack, CONTROLLER_NODES: '10.1.0.173,10.1.0.24,10.1.0.152',
CONTROL_NODES: '10.0.0.54,10.0.0.134,10.0.0.142', KEYSTONE_AUTH_ADMIN_PASSWORD: c0ntrail123,
KEYSTONE_AUTH_HOST: 10.2.0.122, KEYSTONE_AUTH_URL_VERSION: /v3, OPENSTACK_NODES: '10.1.0.148,10.1.0.30,10.1.0.200',
RABBITMQ_NODE_PORT: 5673, VROUTER_GATEWAY: 10.0.0.1}
deployment: {deployer: rhosp}
instances:
overcloud-contrailcontroller-0:
ip: 10.1.0.152
provider: bms
roles: {analytics: null, analytics_database: null, config: null, config_database: null,
@nuthanc
nuthanc / show.py
Created February 9, 2021 00:49
Vijay review proof
stackrc_dict = {
'user_name': 'userA',
'password': 'c0ntrail123',
'project_name': 'userA_project',
'domain_name': 'userA_domain',
'auth_url': '192.168.7.14:5000'
}
ResourceUtil.perform_operations(stackrc_dict=stackrc_dict, inputs='abc')