Skip to content

Instantly share code, notes, and snippets.

@harsh4870
harsh4870 / nginx-oci-mesh.yaml
Last active July 17, 2022 13:46
Nginx with Oracle service mesh integration
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
spec:
ports:
- name: http
port: 80
@harsh4870
harsh4870 / daemonset-configmap-mount.yaml
Created June 10, 2022 06:54
Daemonset configmap hostpath mounting
kind: ServiceAccount
metadata:
name: daemonset-access
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: cron-namespace-admin-rbac
subjects:
@harsh4870
harsh4870 / http-echo-istio-deployment.yaml
Created April 19, 2022 09:13
Kubernetes print request, body & header details into logs going into service
apiVersion: apps/v1
kind: Deployment
metadata:
name: istio-echoserver
spec:
replicas: 1
selector:
matchLabels:
app: istio-echoserver
template:
@harsh4870
harsh4870 / mongodb-docker-compose.yaml
Created March 1, 2022 20:16
MongoDb docker compose
version: '3.7'
services:
mongodb_container:
image: mongo:latest
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=password
- MONGO_INITDB_DATABASE=test
ports:
- 27017:27017
@harsh4870
harsh4870 / elasticsearch.yaml
Created February 22, 2022 12:29
Elasticsearch Kubernetes YAML stateful set for Dev and testing purpose not for Prod
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app : elasticsearch
component: elasticsearch
release: elasticsearch
name: elasticsearch
spec:
podManagementPolicy: Parallel
@harsh4870
harsh4870 / dnssec.yml
Created February 10, 2022 14:56
cloud custodian array or list parse
filters:
- and:
- type: value
key: dnssecConfig.defaultKeySpecs[].algorithm
value: rsasha256
value_type: swap
op: in
- type: value
key: dnssecConfig.defaultKeySpecs[].keyType
op: in
@harsh4870
harsh4870 / logging-enabled.yml
Last active February 10, 2022 14:39
Cloud custodian GCP policy medium blog
policies:
- name: check-all-bucket-logging
description: |
Check all bucket logging enabled
resource: gcp.bucket
filters:
- type: value
key: logging
value: absent
actions:
sudo curl -L -o /usr/local/bin/aws-vault https://github.com/99designs/aws-vault/releases/download/v4.2.0/aws-vault-linux-amd64
sudo chmod 755 /usr/local/bin/aws-vault
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-prod
spec:
acme:
email: [email protected]
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-prod
@harsh4870
harsh4870 / install_terraform.mac.sh
Created June 15, 2021 14:09 — forked from HammoTime/install_terraform.mac.sh
Install Terraform on a Mac
brew install jq
brew install wget
cd ~
version=$(curl https://api.github.com/repos/hashicorp/terraform/releases/latest --silent | jq ".tag_name" -r)
version=$(echo $version | sed 's/v//g') # get rid of 'v' from version number
echo "Installing Terraform $version."
url="https://releases.hashicorp.com/terraform/$version/terraform_$(echo $version)_darwin_amd64.zip"
wget $url
unzip "terraform_$(echo $version)_darwin_amd64.zip"
chmod +x terraform