Skip to content

Instantly share code, notes, and snippets.

View lamw's full-sized avatar

William Lam lamw

View GitHub Profile
@lamw
lamw / gist:086320a7545c47b802a4db3127d91b27
Created October 26, 2021 13:49
vSphere w/Tanzu ClusterRole View
root@42294959c845d4be8507807dd2d100d0 [ ~ ]# k get clusterrole view -o yaml
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
@lamw
lamw / configstore_esxi70u2.json
Created July 19, 2021 16:19
Schema for ConfigStore in ESXi 7.0 Update 2
{
"clusterstore": {
"cluster_agent": [
"agent_settings"
]
},
"esx": {
"assignhw": [
"overrides"
],
@lamw
lamw / gist:4e3206fc8e13c3280a0074c9f50498d3
Created April 23, 2021 17:31
ingressroute-gateway-modified.yaml
---
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
annotations:
kubernetes.io/ingress.class: contour-external
labels:
app: vmware
name: event-router
namespace: vmware-system
@lamw
lamw / gist:cd9881727237148e8d5bb8f8435b4c2e
Created February 1, 2021 16:38
Fix vSphere UI downloading plugin-in: com.vmware.h4.vsphere.client
SERVICE_IDS=$(/usr/lib/vmware-lookupsvc/tools/lstool.py list --ep-type com.vmware.cis.vsphereclient.plugin --url http://localhost:7090/lookupservice/sdk --type vsphere.client --id-only | grep -v JAVA)
VC_USERNAME='administrator@vsphere.local'
VC_PASSWORD='VMware1!'
for SERVICE_ID in ${SERVICE_IDS[@]};
do
/usr/lib/vmware-lookupsvc/tools/lstool.py unregister --url http://localhost:7090/lookupservice/sdk --user ${VC_USERNAME} --password "${VC_PASSWORD}" --id ${SERVICE_ID} --no-check-cert
done
vmon-cli -r vsphere-ui
@lamw
lamw / gist:7069bc74e020485d0de8c43a0ff8f67f
Created November 19, 2020 20:02
Automated installation of VMware Harbor Registry on Photon OS
DOCKER_COMPOSE_VERSION=1.27.4
HARBOR_VERSION=1.10.6
DEFAULT_HARBOR_PASSWORD='Tanzu1!'
HARBOR_HOSTNAME=registry.tanzu.local
systemctl enable docker
systemctl start docker
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
@lamw
lamw / gist:a9ab09834a806505fd02415ed2b85131
Created June 23, 2020 16:19
VMC Terraform Provider for deploying 1 & 2 Node SDDC
# 1-Node SDDC
provider "vmc" {
refresh_token = var.refresh_token
org_id = var.org_id
}
resource "vmc_sddc" "sddc_1" {
sddc_name = "1-Node-SDDC"
num_host = 1
@lamw
lamw / gist:27818554a29a1f4db164d432a691bf77
Last active June 23, 2020 16:19
VMC REST API for deploying 1 & 2 Node SDDC
# 1-Node SDDC
POST /orgs/{orgs}/sddcs
{
"name": "1-Node-SDDC",
"num_hosts": 1,
"deployment_type": "SingleAZ",
"sddc_type": "1NODE",
"provider": "AWS",
@lamw
lamw / gist:4769a59dabaa41f789950aaa1c7fab2b
Created May 8, 2020 15:46
tf-debug-ovf-local-deploy
2020/05/08 08:43:05 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/05/08 08:43:05 [INFO] Terraform version: 0.12.24
2020/05/08 08:43:05 [INFO] Go runtime version: go1.12.13
2020/05/08 08:43:05 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "-auto-approve"}
2020/05/08 08:43:05 [DEBUG] Attempting to open CLI config file: /Users/lamw/.terraformrc
2020/05/08 08:43:05 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/08 08:43:05 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/05/08 08:43:05 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
@lamw
lamw / gist:1682db3c1460f4c3838d6a11fe98584b
Created May 8, 2020 15:30
tf-debug-ovf-remote-url-deploy
2020/05/08 08:30:04 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/05/08 08:30:04 [INFO] Terraform version: 0.12.24
2020/05/08 08:30:04 [INFO] Go runtime version: go1.12.13
2020/05/08 08:30:04 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "-auto-approve"}
2020/05/08 08:30:04 [DEBUG] Attempting to open CLI config file: /Users/lamw/.terraformrc
2020/05/08 08:30:04 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/08 08:30:04 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/05/08 08:30:04 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
{
"variables": {
"photon_ovf_template": "photon.xml.template",
"ovftool_deploy_vcenter": "192.168.30.200",
"ovftool_deploy_vcenter_username": "administrator@vsphere.local",
"ovftool_deploy_vcenter_password": "VMware1!"
},
"builders": [
{
"type": "vsphere-iso",