This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: demo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: "service-hive" | |
namespace: "rsyslog" | |
spec: | |
ports: | |
- port: 514 | |
targetPort: 514 | |
protocol: TCP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: rsyslog-deployment | |
namespace: rsyslog | |
labels: | |
app: rsyslog | |
spec: | |
replicas: 3 | |
selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: efs | |
namespace: "rsyslog" | |
spec: | |
capacity: | |
storage: 500Gi | |
volumeMode: Filesystem | |
accessModes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Namespace | |
apiVersion: v1 | |
metadata: | |
name: rsyslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import base64 | |
print('Loading function') | |
def lambda_handler(event, context): | |
output = [] | |
print(event) |