Skip to content

Instantly share code, notes, and snippets.

View jessehu's full-sized avatar
💭
SmartX Kubernetes Service https://www.smartx.com/global/smtx-kubernetes-service/

Jesse Hu jessehu

💭
SmartX Kubernetes Service https://www.smartx.com/global/smtx-kubernetes-service/
View GitHub Profile
@jessehu
jessehu / deploy-rabbitmq.sh
Last active October 16, 2021 03:49
Install RabbitMQ Helm Chart
# Homepage: https://artifacthub.io/packages/helm/bitnami/rabbitmq
# Note: Specify `--set clustering.enabled=false` in Minikube with a single k8s node.
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install -n rabbitmq-system --create-namespace rabbitmq bitnami/rabbitmq \
--set clustering.enabled=false \
--set auth.username=user --set auth.password=pass \
--set persistence.size=1Gi \
--wait
@jessehu
jessehu / 01_additional_ca_certs.yaml
Last active February 28, 2023 08:09
tkg-ytt-overlay-additional-ca-certs
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#! This ytt overlay adds additional custom CA certificates on TKG cluster nodes, so containerd and other tools trust these CA certificates.
#! It works when using Photon or Ubuntu as the TKG node template on all TKG infrastructure providers.
#! Trust your custom CA certificates on all Control Plane nodes.
#@overlay/match by=overlay.subset({"kind":"KubeadmControlPlane"})
---
spec:
@jessehu
jessehu / gist:903cf39200c1db965f1b0c28e60f9efb
Created July 9, 2019 02:37
Helm Tiller RBAC setup for K8s v1.6+
https://gist.github.com/mgoodness/bd887830cd5d483446cc4cd3cb7db09d
Helm RBAC setup for K8s v1.6+
```
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
```
https://github.com/fnproject/fn-helm/issues/21
Error: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list resource "configmaps" in API group "" in the namespace "kube-system"

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@jessehu
jessehu / gist:c580b58a259d1fb205ea82713b0169d1
Created March 29, 2018 08:03
Change IP of vCenter 6.5
Open a console session of the VCSA
Login as: root
Default password is: vmware
Execute the following command: /opt/vmware/share/vami/vami_config_net
After executing the command, a menu is displayed. Within the menu It is possible to change the IP address, hostname, DNS, Default gateway and proxy server.
Execute 'reboot'
@jessehu
jessehu / gist:8997c4e8f781d726d4583cd98e93b298
Created March 6, 2018 03:54
Curl for getting docker image tags
# 'username:password' is required for non-public image repo
curl -s https://username:password@registry.hub.docker.com/v1/repositories/vmware/harbor-ui/tags
@jessehu
jessehu / gist:90f7c00efe8fd8c5bf74d304faa62a7c
Created June 29, 2017 08:37
Basic of Using VMware vRealize Automation
Here is the process for using vRA to deploy a sample OpenStack VM:
Login as admin (I use configadmin), go to 基础架构(Infrastructure)
create an OpenStack End Point for OpenStack Kilo
create fabric group (架构组), select the discovery OpenStack Region as 'Compute resources'
Go to 管理 -> 用户和组 -> 业务组
@jessehu
jessehu / gist:2e28b2d8ab454e67712cd943a8500512
Created October 26, 2016 02:40
List linked mode vCenter Servers 6.0 or other Service Endpoints from PSC
from pyVim import connect
import requests
import sys, ssl
from xml.etree.ElementTree import XML, fromstring, tostring
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
server=sys.argv[1]
protocol='https'
@jessehu
jessehu / gist:deacfae0996b7c13673f
Created July 7, 2014 07:33
Disable unneccessary ohai plugins to compact the chef node size so as to speed up chef get/search API calls
https://wiki.opscode.com/display/chef/Disabling+Ohai+Plugi
http://engineering.voxer.com/2013/03/22/chef-part-2-performance/
In Ohai 7, the ohai plugin name is not the plugin file name, but defined in the plugin file. Here is what I used in Ohai 7.0.4 :
Ohai::Config[:disabled_plugins] = [:Azure, :Filesystem, :Cloudv2, :Virtualization, :Virtualizationinfo, :Dmi, :Zpools, :Blockdevice, :Lsb, :Nodejs, :Languages, :Php, :Lua, :Perl, :C, :Java, :Python, :Erlang, :Groovy, :Ruby, :Mono, :Os, :Openstack, :Cloud, :Rackspace, :Ps, :Command, :Initpackage, :Rootgroup, :Keys, :Sshhostkey, :Ohai, :Chef, :Ohaitime, :Passwd, :Gce, :Systemprofile, :Linode, :Ipscopes, :Eucalyptus, :Ec2]
@jessehu
jessehu / runknife.rb
Created February 21, 2013 03:32
a ruby script for calling Ironfan's cluster class.
#!/usr/bin/env ruby
require 'chef'
require 'chef/knife'
require 'ironfan'
require 'chef/knife/cluster_bootstrap.rb'
knife = Chef::Knife::ClusterBootstrap.new
knife.class.load_deps
knife.class.chef_config_dir