Skip to content

Instantly share code, notes, and snippets.

View ksingh7's full-sized avatar

karan singh ksingh7

View GitHub Profile
@ksingh7
ksingh7 / kafka-python-producer-consumer.py
Created October 1, 2021 21:48
Kafka Python producer and consumer example that uses SSL and ca.crt files
from kafka import KafkaProducer, KafkaConsumer
import json
from bson import json_util
bootstrap_server = 'my-cluster-kafka-route-bootstrap-nestjs-testing.apps.ocp.ceph-s3.com:443'
print("Producing messages to Kafka topic ...")
producer = KafkaProducer(bootstrap_servers=bootstrap_server, ssl_cafile='ca.crt', security_protocol="SSL")
for i in range(10):
@ksingh7
ksingh7 / OCP_Sample_App.md
Last active September 8, 2021 11:13 — forked from exaV/README.md
Ngninx template for Openshift with ConfigMap

Ngninx template for Openshift

Create a full deployment for an Nginx Proxy that reads its configuration from a config map.

The config map can be edited online and only requires a rolling deployment to take effect.

Quickstart:

oc new-app -f https://gist.githubusercontent.com/ksingh7/f6ca0c13cb9902fe96463704d27065af/raw/da5e0cf24f63de0a5b94b0497d5036e9e2f7b1f5/nginx-template.yaml -p NAME="my-proxy"

@ksingh7
ksingh7 / crc_readme.md
Last active June 9, 2021 19:54
My_CRC_Setup

Deploying CRC

crc config set consent-telemetry no
crc config set enable-cluster-monitoring true
crc config set cpus 15
crc config set memory 60000
crc config view
crc setup
crc start  --log-level debug -p /mnt/hdd_space1/pull-secret.txt
@ksingh7
ksingh7 / prometheus_db_backup_using_Snapshot.md
Last active November 4, 2024 15:53
Prometheus DB Backup using TSDB Snapshot

Get Token for API Authentication

oc whoami -t

Get Prometheus Route URL

oc get route -n openshift-monitoring | grep -i prometheus

Run sample curl request

@ksingh7
ksingh7 / 02_kafka_connector.yaml
Created June 14, 2020 14:49
Kafka Connector YAML for AWS S3
apiVersion: kafka.strimzi.io/v1alpha1
kind: KafkaConnector
metadata:
name: s3-sink-connector
labels:
strimzi.io/cluster: my-connect-cluster
spec:
class: org.apache.camel.kafkaconnector.CamelSinkConnector
tasksMax: 1
config:
@ksingh7
ksingh7 / 02_kafka_connector.yaml
Created June 14, 2020 14:49
Kafka Connector YAML for AWS S3
apiVersion: kafka.strimzi.io/v1alpha1
kind: KafkaConnector
metadata:
name: s3-sink-connector
labels:
strimzi.io/cluster: my-connect-cluster
spec:
class: org.apache.camel.kafkaconnector.CamelSinkConnector
tasksMax: 1
config:
@ksingh7
ksingh7 / 01_kafka_connect.yaml
Last active June 14, 2020 14:20
Kafka connect configuration file
apiVersion: kafka.strimzi.io/v1beta1
kind: KafkaConnect
metadata:
namespace: cc-demo
name: my-connect-cluster
annotations:
strimzi.io/use-connector-resources: "true"
spec:
version: 2.5.0
image: karansingh/camel-aws2-s3-kafka-connector
@ksingh7
ksingh7 / 01_kafka_cluster.yaml
Last active July 1, 2020 05:16
Kafka Cluster k8s configuration file
apiVersion: kafka.strimzi.io/v1beta1
kind: Kafka
metadata:
name: my-cluster
labels:
app: my-cluster
spec:
kafka:
version: 2.5.0
replicas: 3
@ksingh7
ksingh7 / pyspark-test.ipynb
Created April 14, 2019 17:34
pyspark-test.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.