Skip to content

Instantly share code, notes, and snippets.

View role-binding-vcsso.yml
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rb-edit-k8s-dev-user
roleRef:
kind: ClusterRole
name: edit
apiGroup: rbac.authorization.k8s.io
subjects:
View role-binding-psp.yml
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rb-vmware-system-privileged
roleRef:
kind: ClusterRole
name: psp:vmware-system-privileged
apiGroup: rbac.authorization.k8s.io
subjects:
View role-binding-edit.yml
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rb-edit-sa-01
roleRef:
kind: ClusterRole
name: edit
apiGroup: rbac.authorization.k8s.io
subjects:
@gowatana
gowatana / diff
Created Nov 23, 2020
diff httpd.yml httpd_anti-affinity.yml
View diff
37a38,47
> affinity:
> podAntiAffinity:
> requiredDuringSchedulingIgnoredDuringExecution:
> - labelSelector:
> matchExpressions:
> - key: app
> operator: In
> values:
> - demo-httpd
View httpd-nodeport.yml
---
kind: Service
apiVersion: v1
metadata:
name: httpd-svc
spec:
type: NodePort
ports:
- port: 80
protocol: TCP
View tkg-cluster-01.yml
---
kind: TanzuKubernetesCluster
apiVersion: run.tanzu.vmware.com/v1alpha1
metadata:
name: tkg-cluster-01
spec:
distribution:
version: v1.16.8
topology:
controlPlane:
View nginx-pod.yml
---
kind: Pod
apiVersion: v1
metadata:
name: nginx-pod
labels:
app: wcp-demo
spec:
containers:
- image: nginx
@gowatana
gowatana / get_vm_relocate_report.ps1
Last active Nov 12, 2020
Output Simple vSphere RelocateVM (vMotion / Cold Migration) operation report.
View get_vm_relocate_report.ps1
# Output Simple vSphere RelocateVM (vMotion / Cold Migration) operation report.
# Created by: gowatana
# Usage:
# PS> Connect-VIServer
# PS> ./get_vm_relocate_report.ps1
# PS> ./get_vm_relocate_report.ps1 "2020/11/11"
# PS> ./get_vm_relocate_report.ps1 "2020/11/11" | Out-File -Encoding utf8 -Width 300 -FilePath ./vm_relocate_report.txt
$start_time = $args[0]
View tanzu-cluster-41.yml
---
kind: TanzuKubernetesCluster
apiVersion: run.tanzu.vmware.com/v1alpha1
metadata:
name: tanzu-cluster-41
spec:
distribution:
version: v1.18.5
topology:
controlPlane:
View get_haproxy_vm_cacert.ps1
# Get HAProxy CA Cert.
# Usage:
# PS> Connect-VIServer $vCenter_Address -Force
# PS> ./get_haproxy_vm_cacert.ps1 $ha_proxy_vm_name
$VMname = $args[0]
$AdvancedSettingName = "guestinfo.dataplaneapi.cacert"
$Base64cert = Get-VM $VMname | Get-AdvancedSetting -Name $AdvancedSettingName
$cert = [Text.Encoding]::Utf8.GetString([Convert]::FromBase64String($Base64cert.Value))
$cert
You can’t perform that action at this time.