Skip to content

Instantly share code, notes, and snippets.

@devx
devx / dcgm-exporter.yaml
Created June 16, 2023 17:18
DCGM exporter with annotations to set the log type to dcgm, and enable scraping of metrics. The annotations align with logz.io collector.
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@devx
devx / logz-io-helm.values-example.yaml
Created May 22, 2023 19:15
Logz.io helm values example: Metrics, Logs, Traces, EKS
disableKubeDnsScraping: true
logs:
enabled: true
logzio-fluentd:
env_id: <ENVIRONMENT ID>
secrets:
logzioListener: listener.logz.io
logzioShippingToken: <SECRET TOKEN>
logzio-k8s-telemetry:
enableMetricsFilter:
@devx
devx / example-ec2-tagging-policy
Created April 13, 2023 18:35
Example EC2 TAG Read policy
{
"Statement": [
{
"Action": [
"ec2:DescribeTags",
],
"Effect": "Allow",
"Resource": "*"
}
],
@devx
devx / logzio-monitoring-values.yaml
Last active April 3, 2023 21:43
Example values for logzio-helm/logzio-monitoring, Enables logs, metrics, SPM, Traces
logs:
enabled: true
logzio-fluentd:
env_id: ${ENV_ID}
secrets:
logzioListener: listener.logz.io
logzioShippingToken: ${LOGZIO_LOGS_TOKEN}
logzio-k8s-telemetry:
enableMetricsFilter:
eks: true
@devx
devx / fluent-bit.conf
Created September 7, 2022 20:21
fluent bit base config
[SERVICE]
# Flush
# =====
# set an interval of seconds before to flush records to a destination
flush 1
# Daemon
# ======
# instruct Fluent Bit to run in foreground or background mode.
daemon Off
@devx
devx / create_htpasswd_with_openssl.md
Last active September 18, 2020 15:47
Create htpasswd file with openssl no additional packages to install

add entry to existing htpasswd

User: MyUser, Password: Secrete

printf "MyUser:$(openssl passwd -apr1 Secrete)\n" >> htpasswd

Create a bunch of users with the same password

for i in john jose josh joe ; do
  printf "$i:$(openssl passwd -apr1 Secrete)\n" >> htpasswd
done
@devx
devx / OCP build notes
Last active February 11, 2020 04:48
ocp build notes
# Create the config and edit necesary fields
openshift-install create install-config --dir $HOME/cluster-${GUID}
# create the cluster
openshift-install create cluster --dir $HOME/cluster-${GUID}
#Create a httpassword file
#apply identity provider via web ui
@devx
devx / gist:69dee43fc7e8566517273e54919dcf11
Created January 10, 2020 00:22
Generate a unique hash of every event to prevent duplicates
# @see https://github.com/uken/fluent-plugin-elasticsearch#generate-hash-id
<filter **>
@type elasticsearch_genid
hash_id_key _hash
</filter>
# Apply value from filter to id_key field
# Elasticsearch also doesn't like field names with `_` so remove it.
<match **>
@type elasticsearch
hosts elasticsearch.local:9200
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: psp:istio-system:privileged
namespace: istio-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:privileged
subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: istio-remote-clusterrole
rules:
- apiGroups: ["extensions"]
resources: ["podsecuritypolicies"]
resourceNames: ["psp:privileged"]
verbs: ["use"]
---