Skip to content

Instantly share code, notes, and snippets.

View hemanth22's full-sized avatar

Hemanth B hemanth22

View GitHub Profile
@FreedomBen
FreedomBen / retrieved-deployment-basic-ocp-demo.yaml
Created January 8, 2021 02:16
Deployment read back from OpenShift API with `oc get deployment basic-ocp-demo -o yaml`
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"basic-ocp-demo"},"name":"basic-ocp-demo","namespace":"basic-ocp-demo-project"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"basic-ocp-demo"}},"template":{"metadata":{"labels":{"app":"basic-ocp-demo"}},"spec":{"containers":[{"env":[{"name":"BASIC_OCP_DEMO_ENV","value":"master"}],"image":"quay.io/freedomben/basic-ocp-demo:latest","imagePullPolicy":"Always","name":"basic-ocp-demo","ports":[{"containerPort":4567,"protocol":"TCP"}],"readinessProbe":{"httpGet":{"path":"/healthz","port":4567,"scheme":"HTTP"},"initialDelaySeconds":5,"periodSeconds":1}}]}}}}
creationTimestamp: "2021-01-08T02:09:21Z"
generation: 1
labels:
@alexlarkou
alexlarkou / log_index.py
Last active August 28, 2022 15:20
Elasticsearch
from elasticsearch_dsl import Date, Document, Keyword, Nested, Text, Integer
class HttpLog(Document):
"""The schema for a Log document."""
level = Keyword()
request = Nested(properties={"body": Text(analyzer="snowball"), "headers": Keyword(), "arguments": Keyword()})
response = Nested(properties={"message": Text(analyzer="snowball"), "status": Integer()})
timestamp = Date()
@hemanth22
hemanth22 / docker.tf
Last active August 16, 2020 15:27 — forked from darkn3rd/docker.tf
Terraform Docker Solution
provider "docker" {}
variable wordpress_port {
default = "8080"
}
resource "docker_volume" "db_data" {}
resource "docker_network" "wordpress_net" {
name = "wordpress_net"
resource "docker_container" "hello_world_app" {
image = "hello_world_app:latest"
name = "hello_world_app"
restart = "always"
volumes {
container_path = "/myapp"
# replace the host_path with full path for your project directory starting from root directory /
host_path = "/path/to/your/project/directory"
read_only = false
}
provider "aws" {
region = "ap-south-1"
profile = "EKS"
}
resource "aws_iam_role" "eks_cluster" {
name = "ViRocluster"
assume_role_policy = <<POLICY
@saadlu
saadlu / usefuloc.asciidoc
Last active December 1, 2021 15:16
useful kubectl/oc jsonpaths
  1. Print containers of a pod

    oc get pod <pod_name> -o jsonpath='{.spec.containers[*].name}{"\n"}' | tr ' ' '\n'
  2. IBM Chart repo URI

resource "docker_container" "hello_world_app" {
image = "hello_world_app:latest"
name = "hello_world_app"
restart = "always"
volumes {
container_path = "/myapp"
# replace the host_path with full path for your project directory starting from root directory /
host_path = "/path/to/your/project/directory"
read_only = false
}
@hemanth22
hemanth22 / helm-cheatsheet.md
Created May 12, 2020 05:22 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!
@MichaelCurrin
MichaelCurrin / README.md
Last active March 5, 2024 22:06
GitHub GraphQL - Get files in a repository

Get GitHub Files

Get the metadata and content of all files in a given GitHub repo using the GraphQL API

You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.

The approach here is to query data from GitHub using the Github V4 GraphQL API.

About the query

data "aws_region" current {}
data "aws_eks_cluster" "cluster" {
name = var.cluster_id
}
data "aws_eks_cluster_auth" "cluster" {
name = var.cluster_id
}