Skip to content

Instantly share code, notes, and snippets.

View enable_wm_wcp-cluster-41_haproxy.ps1
$haproxy_ca_cert_file = Get-Content "./lab-haproxy-41_ca.crt" | Out-String
$workload_network_primary = New-WMNamespaceNetworkSpec `
-Name "network-1" `
-DistributedPortGroup "DPortGroup-0021-WL1" `
-Gateway "192.168.21.1" `
-Subnet "255.255.255.0" `
-AddressRanges "192.168.21.11-192.168.21.79"
$workload_network_additional_1 = New-WMNamespaceNetworkSpec `
View web-avi.yml
---
kind: Service
apiVersion: v1
metadata:
name: svc-web
spec:
type: LoadBalancer
selector:
app: httpd
ports:
View tkc-crb-privileged.yml
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: crb-vmware-system-privileged
roleRef:
kind: ClusterRole
name: psp:vmware-system-privileged
apiGroup: rbac.authorization.k8s.io
subjects:
View login_tanzu-cluster-51.sh
export SCP=192.168.24.11
export TKC_NS=lab-ns-51
export TKC_NAME=tanzu-cluster-51
export VSPHERE_USERNAME=administrator@vsphere.local
export KUBECTL_VSPHERE_PASSWORD=VMware1!
kubectl vsphere login \
--server=$SCP \
--tanzu-kubernetes-cluster-namespace=$TKC_NS \
--tanzu-kubernetes-cluster-name=$TKC_NAME \
View login_wcp-cluster-51.sh
export SCP=192.168.24.11
export TKC_NS=lab-ns-51
export VSPHERE_USERNAME=administrator@vsphere.local
export KUBECTL_VSPHERE_PASSWORD=VMware1!
kubectl vsphere login \
--server=$SCP \
--vsphere-username=$VSPHERE_USERNAME \
--insecure-skip-tls-verify
View tanzu-cluster-51.yml
---
kind: TanzuKubernetesCluster
apiVersion: run.tanzu.vmware.com/v1alpha1
metadata:
name: tanzu-cluster-51
spec:
distribution:
version: v1.19.7
topology:
controlPlane:
@gowatana
gowatana / terraform-centos7-vm.yml
Last active Mar 28, 2021
Nutanix AHV の Custom Script(Cloud-Init)で Terraform がインストールされた VM を作成する。
View terraform-centos7-vm.yml
#cloud-config
disable_root: true
ssh_pwauth: true
package_upgrade: false
users:
- name: nutanix
lock-passwd: false
passwd: $6$oDzrtJla$rMzS0vuH95Q2PjDgqVOsI30MqAYemPK5Y9uYsSpeQWd99R4hqm/JWoJqH4Y81SlbtTMkglp243leccceKNZ9h.
@gowatana
gowatana / demo.md
Last active Jan 27, 2021
ingress-nginx のデモ。
View demo.md

ingress-nginx の様子をデモ。WebサービスA、サービスBを起動して、Ingressで振り分け。

1. LB (MetalLB) の準備

  • NSX-T LB の代わり

MetalLB の IP レンジを決めておく。(ワーカーの IP レンジで。例: 10.0.3.221-10.0.3.229)

$ cat configmap.yml
@gowatana
gowatana / set_vcls_retreat.ps1
Last active Jan 24, 2021
vSphere 7.0 U1 の vCLS Retreat Mode 設定変更スクリプト。(自宅ラボむけ)参考: https://kb.vmware.com/s/article/80472
View set_vcls_retreat.ps1
param(
[Switch]$Enable = $true
)
$cluster_name = $args[0]
# list parameter
$clusters = Get-Cluster -Name $cluster_name
$clusters | %{
$cluster = $_
$vpxd_parameter = "config.vcls.clusters." + $cluster.ExtensionData.MoRef.Value + ".enabled"
@gowatana
gowatana / kubectl-centos7-vm.yml
Last active Mar 17, 2021
Nutanix AHV の Custom Script(Cloud-Init)で kubectl むけ VM を作成する。
View kubectl-centos7-vm.yml
#cloud-config
disable_root: true
ssh_pwauth: true
package_upgrade: false
users:
- name: nutanix
lock-passwd: false
passwd: $6$oDzrtJla$rMzS0vuH95Q2PjDgqVOsI30MqAYemPK5Y9uYsSpeQWd99R4hqm/JWoJqH4Y81SlbtTMkglp243leccceKNZ9h.