Skip to content

Instantly share code, notes, and snippets.

View nikhil-thomas's full-sized avatar
🧑‍💻

Nikhil Thomas nikhil-thomas

🧑‍💻
View GitHub Profile
begin;
-- create variables for user / password / role / warehouse / database (needs to be uppercase for objects)
set role_name = 'FIVETRAN_ROLE';
set user_name = 'FIVETRAN_USER';
set user_password = 'password123';
set warehouse_name = 'FIVETRAN_WAREHOUSE';
set database_name = 'FIVETRAN_DATABASE';
-- change role to securityadmin for user / role steps
@nikhil-thomas
nikhil-thomas / anyuid.scc.yaml
Created January 25, 2023 23:30
anyuid.scc.yaml
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: true
allowPrivilegedContainer: false
allowedCapabilities: null
apiVersion: security.openshift.io/v1
defaultAddCapabilities: null
@nikhil-thomas
nikhil-thomas / container-build.yaml
Created January 25, 2023 20:36
container-build.yaml
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: true
allowPrivilegedContainer: false
allowedCapabilities:
- SETUID
- SETGID
@nikhil-thomas
nikhil-thomas / anyuid100.yaml
Last active January 25, 2023 20:34
anyuid100.yaml
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: true
allowPrivilegedContainer: false
allowedCapabilities: null
apiVersion: security.openshift.io/v1
defaultAddCapabilities: null
@nikhil-thomas
nikhil-thomas / reference-addon-operator.coreos.com.yaml
Created January 20, 2023 18:21
sample operator.coreos.com api instance for reference-addon
apiVersion: operators.coreos.com/v1
kind: Operator
metadata:
creationTimestamp: "2023-01-20T16:02:46Z"
generation: 1
name: reference-addon.reference-addon
resourceVersion: "18685"
uid: 45c7c7cc-f695-4bc4-baf5-8614f122b5d9
spec: {}
status:
kubeScheme := scheme.Scheme
objT, err := kubeScheme.New(obj.GetObjectKind().GroupVersionKind())
objTD := objT.DeepCopyObject().(client.Object)
fmt.Println("objT type:", reflect.TypeOf(objTD))
err = runtime.DefaultUnstructuredConverter.FromUnstructured(objValue.Object, objTD)
if err != nil {
panic(err.Error())
}
fmt.Println("objectT Type", objT.GetObjectKind().GroupVersionKind())
@nikhil-thomas
nikhil-thomas / dvo metrics
Created October 4, 2022 11:24
dvo metrics (polling)
# HELP deployment_validation_operator_minimum_three_replicas Description: Indicates when a deployment uses less than three replicas ; Remediation: Increase be number of replicas in the deployment to at least three to increase the fault tolerancy of the deployment.
# TYPE deployment_validation_operator_minimum_three_replicas gauge
deployment_validation_operator_minimum_three_replicas{check_description="Indicates when a deployment uses less than three replicas",check_remediation="Increase be number of replicas in the deployment to at least three to increase the fault tolerancy of the deployment.",kind="Deployment",name="dittybopper",namespace="dittybopper"} 1
deployment_validation_operator_minimum_three_replicas{check_description="Indicates when a deployment uses less than three replicas",check_remediation="Increase be number of replicas in the deployment to at least three to increase the fault tolerancy of the deployment.",kind="Deployment",name="nginx-00001",namespace="dvo-load-test-1"} 1
deployment_validatio
apiVersion: v1
kind: ConfigMap
metadata:
name: config-artifact-bucket
namespace: tekton-pipelines
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
data:
# Copyright 2019 The Tekton Authors
#
# Licensed 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@nikhil-thomas
nikhil-thomas / repeat_install_kubeapp
Last active September 8, 2022 21:41
the resources in a given manifest list will be installed repeatedly by appending random suffixes to resoruce names
while true; do
t=$(openssl rand -base64 100 | tr -dc 'a-z' | head -c 10); sed 's/\(^\ \ name: .*\)/\1'${t}'/' tektoncd-pipelines-v0.39.0.yaml | sed 's/\(namespace: tekton-pipelines\)/\1'${t}'/' | tee yaml | oc apply -f - ; echo $t >> suffix-list
done