Skip to content

Instantly share code, notes, and snippets.

@berinle
berinle / apply_tkg_gatekeeper.md
Last active April 25, 2024 11:24
Steps to apply gatekeeper to an existing TKG guest cluster

login to your guest cluster e.g.

❯ kubectl vsphere login --server=SERVER_IP --tanzu-kubernetes-cluster-namespace=NAMESPACE --tanzu-kubernetes-cluster-name=CLUSTER_NAME -u=administrator@vsphere.local --insecure-skip-tls-verify

run the gatekeeper.yaml (located in the gatekeeper directory of the cloned/downloaded project)

kubectl apply -f gatekeeper.yaml
@berinle
berinle / custom-tkgserviceconfigurations-proxy.yaml
Created September 29, 2023 14:32
Sample TkgServiceConfiguration
apiVersion: run.tanzu.vmware.com/v1alpha3
kind: TkgServiceConfiguration
metadata:
name: tkg-service-configuration
spec:
defaultCNI: antrea
proxy:
#supported format is `http://<user>:<pwd>@<ip>:<port>`
httpProxy: http://admin:PaSsWoRd@10.66.100.22:80
httpsProxy: http://admin:PaSsWoRd@10.66.100.22:80
@berinle
berinle / sample-tkg-cluster.yaml
Last active November 9, 2023 03:01
Sample snippet for TKG cluster
# https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-B2807BCD-0CE1-4C3A-9C0E-2B78F5DA0E90.html
apiVersion: run.tanzu.vmware.com/v1alpha2 #TKGS API endpoint
kind: TanzuKubernetesCluster #required parameter
metadata:
name: REPLACE_ME #cluster name, user defined
namespace: REPLACE_ME
spec:
topology:
controlPlane:
replicas: 1 #number of control plane nodes
@berinle
berinle / solrconfig.xml
Created August 21, 2023 14:00
solr testing
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@berinle
berinle / gist:1c2bc8ffadb4b2f74909a2f010f4bffa
Created May 19, 2023 23:13
wcp_deactivate_troubleshoot
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:310] [opID=64deebef] Processing cluster sync: "99f81a0c-6421-4c01-80b5-bf3111015bd1"
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:314] [opID=64deebef] Attempting to sync supervisor 99f81a0c-6421-4c01-80b5-bf3111015bd1 state with desired state.
2023-05-19T15:34:35.481Z debug wcp [logger/trace.go:77] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] [BEGIN] [kubelifecycle.(*Controller).syncKubeInstanceState:356] supervisor=99f81a0c-6421-4c01-80b5-bf3111015bd1
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:540] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] creating service accounts for cluster domain-c13
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:2161] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] Will create VMOperator service account
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:2164] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] Will create AppPlatf
@berinle
berinle / nginx.yaml
Created May 15, 2023 14:37
sample nginx
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
namespace: dev
spec:
replicas: 3
selector:
@berinle
berinle / foobar.java
Created March 15, 2023 23:04
sample showing how to read from classpath in JAR
package com.example.foobar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: lion
description: Lion App
tags:
- app-accelerator
- java
- spring
- web
@berinle
berinle / test-tkg-cluster.yaml
Created November 3, 2022 18:50
sample tkg cluster
apiVersion: run.tanzu.vmware.com/v1alpha1 #TKGS API endpoint
kind: TanzuKubernetesCluster #required parameter
metadata:
name: test #cluster name, user defined
namespace: demo
spec:
distribution:
version: v1.20 #Resolves to the latest v1.18 image
topology:
controlPlane:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCd8ADGaopEIoh/wZQXeYoeu9ppFO1SIVE076XzLsR29b0xUzQxfiClNmT3dN6lJ/MsoJPGMxodVK/bFed2oTmsgggydQyYsDNBQ6QA6a9SCBiY+PakpdFGe7V+XJfMpwWp1QbHYDLqoOFCJV88MqtOCZeZECe8arBGXFntmNQNmXqrXQ2W4cOD2ShFt1N7jKRtmZRdqDMayCdAYb0fyWagRux+033Tq6x0FG371MKE7fW1Jo64ZZh/B3kTVPue9ft/Uvc3kEcJtY3p+W629ZsCTWNrZ3JXn0xp+HXYw/lN9Gh1AWlEYl0HIJz8Km6YPeT0dU53fs6uJfNOZNPUOz3BWCn4zuU2GvkT+lhFprX8gqMSdbmcDZnobcM3aD0ipUlAwPVFGWqxhVQWW01OZJ7wjgFvpUZDN5UhbL96awhyAUJgheFUMSgSSC26boxRAWGaymOr8LrTBZAS1WfoPDZ0VzZ4sZOcZD+m2I4RYgoTre5QVQTeRxtoxnI9716kTMvVgPSGbJNsp8xlbNR6Ii1WX/nA9nEvtGwouy7odd7BfhWu92Yb/98vGj048k3WJ3N3NK4jBHaWqbvH+U3/7U6JpF6C/nzM1zvl/sJH1/KvbBahivK5zdHewi1sTTeQlqEUEHrlK89dZNpy+f+SWeJdLLqHdiNwmgaXk0c6ARWyAQ== berinle@gmail.com