Skip to content

Instantly share code, notes, and snippets.

View barkbay's full-sized avatar
👨‍💻

Michael Morello barkbay

👨‍💻
View GitHub Profile
@barkbay
barkbay / eck-7303.yaml
Created November 15, 2023 09:22
eck-7303
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
name: fleet-server-quickstart
namespace: obs-dev-elastic-stack
spec:
version: 8.11.1
kibanaRef:
name: kibana-quickstart
elasticsearchRefs:
@barkbay
barkbay / kubernetes-integration.yaml
Created April 6, 2023 09:18
Automatically adjust Elastic Agent hostPath permissions
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
name: elastic-agent
namespace: my-agent-project
spec:
version: 8.6.1
elasticsearchRefs:
- name: elasticsearch
daemonSet:
@barkbay
barkbay / monitored.yaml
Last active January 27, 2023 09:14
OpenShift: Filebeat stack monitoring
### Requires to run the follwing command for Filebeat:
### oc adm policy add-scc-to-user privileged -z filebeat -n monitored
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
name: filebeat
namespace: monitored
spec:
type: filebeat
version: 8.4.2
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License 2.0;
// you may not use this file except in compliance with the Elastic License 2.0.
package elasticsearch
import (
"context"
"fmt"
"github.com/pkg/errors"
"testing"
@barkbay
barkbay / secret_integration_test.go
Created June 13, 2022 12:46
HTTP Integration Test
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License 2.0;
// you may not use this file except in compliance with the Elastic License 2.0.
package association
import (
"context"
"fmt"
"net"
@barkbay
barkbay / notes.md
Last active March 16, 2022 12:17
RELOCATING shards during restart

Initial state

  • ECK 1.9.0
  • 5 nodes cluster with a cold tier:
pod/elasticsearch-gcs-sample-es-cold-0      1/1     Running   0             28m   10.124.98.26   gke-michael-dev1-default-pool-d46d259a-9cqn   <none>           <none>
pod/elasticsearch-gcs-sample-es-cold-1      1/1     Running   0             30m   10.124.97.32   gke-michael-dev1-default-pool-3c8b09db-lbmw   <none>           <none>
pod/elasticsearch-gcs-sample-es-cold-2      1/1     Running   0             31m   10.124.96.18   gke-michael-dev1-default-pool-b138cacd-cncm   <none>           <none>
pod/elasticsearch-gcs-sample-es-hot-0       1/1     Running   0             53m   10.124.98.25   gke-michael-dev1-default-pool-d46d259a-9cqn   <none>           <none>
pod/elasticsearch-gcs-sample-es-hot-1       1/1     Running   0             55m   10.124.97.29   gke-michael-dev1-default-pool-3c8b09db-lbmw   <none>           <none>
@barkbay
barkbay / NOTICE.txt.diff
Created August 30, 2021 11:22
Removed modules from NOTICE.txt
cloud.google.com/go/bigquery
cloud.google.com/go/datastore
cloud.google.com/go/firestore
cloud.google.com/go/pubsub
cloud.google.com/go/storage
dmitri.shuralyov.com/gpu/mtl
github.com/Azure/go-ansiterm
github.com/Azure/go-autorest
github.com/Azure/go-autorest/autorest
github.com/Azure/go-autorest/autorest/adal
@barkbay
barkbay / apm.pod.yaml
Created July 1, 2020 06:37
APM Server 8.0.0
apiVersion: v1
kind: Pod
metadata:
annotations:
k8s.v1.cni.cncf.io/networks-status: |-
[{
"name": "openshift-sdn",
"interface": "eth0",
"ips": [
"10.129.2.61"
@barkbay
barkbay / ec2-nvme-provisioner.yaml
Last active October 31, 2021 04:53
EC2 NVME Local Storage Provisioner
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
mountOptions:
- noatime
- nodiratime
{
"log": "{\"log.level\":\"error\",\"@timestamp\":\"2020-01-20T13:53:19.874Z\",\"log.logger\":\"controller-runtime.controller\",\"message\":\"Reconciler error\",\"service.version\":\"1.0.0-bf9563a3\",\"service.type\":\"eck\",\"ecs.version\":\"1.4.0\",\"controller\":\"webhook-certificates-controller\",\"request\":\"/elastic-webhook.k8s.elastic.co\",\"error\":\"validatingwebhookconfigurations.admissionregistration.k8s.io \\\"elastic-webhook.k8s.elastic.co\\\" not found\",\"errorCauses\":[{\"error\":\"validatingwebhookconfigurations.admissionregistration.k8s.io \\\"elastic-webhook.k8s.elastic.co\\\" not found\"}],\"error.stack_trace\":\"github.com/go-logr/zapr.(*zapLogger).Error\\n\\t/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128\\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\\n\\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:258\\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\\n