Skip to content

Instantly share code, notes, and snippets.

View dennybaa's full-sized avatar

Denis Baryshev dennybaa

View GitHub Profile
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apiextensions.k8s.io/v1","kind":"CustomResourceDefinition","metadata":{"annotations":{"controller-gen.kubebuilder.io/version":"v0.14.0"},"name":"users.rabbitmq.com"},"spec":{"group":"rabbitmq.com","names":{"categories":["all","rabbitmq"],"kind":"User","listKind":"UserList","plural":"users","singular":"user"},"scope":"Namespaced","versions":[{"name":"v1beta1","schema":{"openAPIV3Schema":{"description":"User is the Schema for the users API.","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind"
name: Publish Image
on:
workflow_dispatch:
inputs:
imageName:
type: string
description: Directory and the image name with a Dockerfile
env:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: webapp-playdemo
namespace: argocd
spec:
generators:
- list:
elements:
- stage: dev
@dennybaa
dennybaa / kubconfig
Created April 14, 2022 07:05
~/.kube/config generator
#!/bin/sh
## ~/.kube/config generator
##
## - creates ~/.kube/config file with the provided context name
## - uses authentication helper which cats token from the path given (used with volume projection)
: ${KUBE_CONTEXT:?kube context name is not provided}
: ${KUBE_TOKENPATH:?path to Kubernetes token path is not provided}
mkdir -p $HOME/.kube/bin
templates:
- |
# Service account which can decrypt helm secrets
apiVersion: v1
kind: ServiceAccount
metadata:
name: github-actions-deployer
namespace: github-actions
annotations:
iam.gke.io/gcp-service-account: [email protected]
@dennybaa
dennybaa / sonoff-flash.sh
Last active May 17, 2020 20:41
Flash sonoff with Tasmota #sonoff #tasmota
#!/bin/bash
## Hotspot should be created
# sonoffDiy 20170618sn
# ref: https://www.sigmdel.ca/michel/ha/sonoff/sonoff_mini_en.html
# ref: https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/other/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v1.4.md
download() {
# Download latest
# Get lite version (must be less 508kb!)
@dennybaa
dennybaa / deployment.yml
Created April 12, 2019 05:48 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables #k8s #envfrom
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@dennybaa
dennybaa / semver-regex.md
Last active April 4, 2019 13:21 — forked from jhorsman/semver-regex.md
Semantic versioning regex #semver #regex

Semantic versioning regex

^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$

^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$

example

http://regexr.com/3er1i

also see

@dennybaa
dennybaa / backup.yml
Last active May 13, 2020 18:44
backup resource #heptio
apiVersion: ark.heptio.com/v1
kind: Backup
metadata:
creationTimestamp: 2018-11-08T14:33:07Z
generation: 1
name: my-db-test
namespace: heptio-ark
resourceVersion: "33426"
selfLink: /apis/ark.heptio.com/v1/namespaces/heptio-ark/backups/my-db-test
uid: 35c1bb4f-e363-11e8-8d80-02ec800e0240
@dennybaa
dennybaa / tips.md
Last active September 2, 2018 09:20
Generate self-signed wildcard openssl certificate #openssl #tips #self-signed

Generate self-signed wildcard openssl certificate

generate csr and key

cat <<-EOF > /tmp/config.ss
[req]
distinguished_name = dn
req_extensions = v3_req
prompt = no