Skip to content

Instantly share code, notes, and snippets.

@kinneyjohn
kinneyjohn / kubevirt.io:vmcontrol-cluster-role.yaml
Last active September 19, 2025 16:55
Example Cluster Role to allow VM Control functions such as stop, start, restart, access the VM's console and create and manage snapshots.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
kubevirt.io: ""
name: kubevirt.io:vmcontrol
rules:
- apiGroups:
- subresources.kubevirt.io
resources:
@kinneyjohn
kinneyjohn / metallb-ingress-service.yaml
Created August 25, 2025 19:04
Example Ingress Controller LoadBalancer Service using MetalLB
kind: Service
apiVersion: v1
metadata:
annotations:
metallb.universe.tf/address-pool: lab-network
metallb.universe.tf/loadBalancerIPs: 192.168.125.160
name: metallb-ingress
namespace: openshift-ingress
spec:
ports:
@kinneyjohn
kinneyjohn / 1-metallb-operator.yaml
Last active August 26, 2025 13:41
Example MetalLB deployment
---
apiVersion: v1
kind: Namespace
metadata:
name: metallb-system
labels:
openshift.io/cluster-monitoring: "true"
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
@kinneyjohn
kinneyjohn / openshift-virtualization-configs-policyset.yaml
Created August 21, 2025 14:04
Example ACM Policyset to deploy a few Virtualization related operators and MetalLB for managed cluster Ingress when doing an HCP deployment.
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: virtualization-configs-placement
namespace: acm-policies
spec:
clusterSets:
- east-non-prod
tolerations:
@kinneyjohn
kinneyjohn / worker1-nmstateconfig.yaml
Created August 19, 2025 22:01
NMStateConfig Example for ACM host Inventory
apiVersion: agent-install.openshift.io/v1beta1
kind: NMStateConfig
metadata:
labels:
infraenvs.agent-install.openshift.io: east-dc-bare-metal-pool
name: worker1
namespace: east-dc-bare-metal-pool
spec:
config:
dns-resolver:
@kinneyjohn
kinneyjohn / balance-xor example
Last active July 30, 2025 16:33
Example NNCP configuration to configure a balance-xor bond and ovs bridge
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: br-vm-data-vlan-trunk
spec:
nodeSelector:
kubernetes.io/hostname: <node01>
#node-role.kubernetes.io/worker: ''
desiredState:
interfaces:
@kinneyjohn
kinneyjohn / image-registry-status.yaml
Created October 10, 2024 14:54
Example status check manifest that can be used with an ACM Policy Generator
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
metadata:
name: cluster
status:
conditions:
- reason: Ready
status: 'True'
type: Available
- status: 'False'
@kinneyjohn
kinneyjohn / loki-logging-s3-bucket-secret.yaml
Last active October 10, 2024 15:54
Example secret manifest that can be used with an ACM Policy Generator
apiVersion: v1
kind: Secret
metadata:
name: loki-logging-s3-bucket
namespace: openshift-logging
type: Opaque
data:
access_key_id: '{{ fromSecret "openshift-logging" "loki-bucket" "AWS_ACCESS_KEY_ID" }}'
access_key_id_1: '{{ (lookup "v1" "Secret" "openshift-logging" "loki-bucket").data.AWS_ACCESS_KEY_ID }}'
#
@kinneyjohn
kinneyjohn / get-request-limits.sh
Created September 18, 2024 21:58
Simple script to print pods requests and limits from all namespaces
#!/bin/bash
NAMESPACE='NAMESPACE:.metadata.namespace'
POD="POD:.metadata.name"
CONTAINER='CONTAINER:.spec.containers[*].name'
MEM_REQ='MEM_REQUEST:.spec.containers[*].resources.requests.memory'
MEM_LIM='MEM_LIMIT:.spec.containers[*].resources.limits.memory'
CPU_REQ='CPU_REQUEST:.spec.containers[*].resources.requests.cpu'
CPU_LIM='CPU_LIMIT:.spec.containers[*].resources.limits.cpu'
@kinneyjohn
kinneyjohn / ingress-example-with-edge-termination.yaml
Created August 29, 2023 18:40
MuleSoft RTF Edge Termination Examples
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
route.openshift.io/termination: edge
name: rtf-ingress
namespace: rtf
labels:
mule-business-group: business-group-id