Skip to content

Instantly share code, notes, and snippets.

View sudheerchamarthi's full-sized avatar

Sudheer Chamarthi sudheerchamarthi

View GitHub Profile
apiVersion: v1
kind: Namespace
metadata:
name: demo
read -p "Enter Cluster name : " CLUSTER_NAME
read -p "Enter the Namespace you want to use: " SERVICE_ACCOUNT_NAMESPACE
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
OIDC_PROVIDER=$(aws eks describe-cluster --name ${CLUSTER_NAME} --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///")
read -r -d '' TRUST_RELATIONSHIP <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
apiVersion: v1
kind: Service
metadata:
name: "rsyslog"
namespace: "rsyslog"
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
alb.ingress.kubernetes.io/scheme: internal
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "environment=stage,app=rsyslog"
apiVersion: v1
kind: Service
metadata:
name: "service-hive"
namespace: "rsyslog"
spec:
ports:
- port: 514
targetPort: 514
protocol: TCP
apiVersion: apps/v1
kind: Deployment
metadata:
name: rsyslog-deployment
namespace: rsyslog
labels:
app: rsyslog
spec:
replicas: 3
selector:
apiVersion: v1
kind: PersistentVolume
metadata:
name: efs
namespace: "rsyslog"
spec:
capacity:
storage: 500Gi
volumeMode: Filesystem
accessModes:
@sudheerchamarthi
sudheerchamarthi / namespace.yaml
Created December 21, 2019 17:18
SeparateNamespace for Rsyslog
kind: Namespace
apiVersion: v1
metadata:
name: rsyslog
version: "3.7"
# USAGE:
# Create and start the cluster: docker-compose up -d
# Tear down the cluster: docker-compose down
# Reove everything including the volumes: docker-compose down -v
services:
# 1. Syslog server
syslogserver:
@sudheerchamarthi
sudheerchamarthi / Dockerfile
Created December 20, 2019 19:51
RsyslogdDockerfile
FROM ubuntu
RUN apt update && apt install rsyslog -y
RUN echo '$ModLoad imudp \n\
$UDPServerRun 514 \n\
$ModLoad imtcp \n\
$InputTCPServerRun 514 \n\
$template RemoteStore, "/var/log/remote/%$year%/%$Month%/%$Day%/%$Hour%.log" \n\
:source, !isequal, "localhost" -?RemoteStore \n\
:source, isequal, "last" ~ ' > /etc/rsyslog.conf
ENTRYPOINT ["rsyslogd", "-n"]
from __future__ import print_function
import base64
print('Loading function')
def lambda_handler(event, context):
output = []
print(event)