Skip to content

Instantly share code, notes, and snippets.

Decision-Making Style Time Pressure Criticality Description
Consensus Building Low Low Group agreement is sought through discussion and collaboration. Time-consuming but leads to high buy-in.
Consultation Moderate Moderate Input is gathered from stakeholders, but the final decision rests with the leader. Balances speed and diverse perspectives.
Decide and Explain Rationale Moderate to High Moderate to High Leader makes a decision quickly and then explains the reasoning to stakeholders. Efficient when time is limited, but risks lower buy-in.
Autocratic High High Leader makes a decision unilaterally without input from others. Fastest option in a crisis, but can damage morale and trust.

Key Considerations:

Cluster State Metrics

DESCRIPTION NAME IN KUBE-STATE-METRICS COMMAND
Running pods kube_pod_status_phase kubectl get pods
Number of pods desired for a Deployment kube_deployment_spec_replicas kubectl get deployment
Number of pods desired for a DaemonSet kube_daemonset_status_desired_number_scheduled kubectl get daemonset
Number of pods currently running in a Deployment kube_deployment_status_replicas kubectl get deployment

Start by deleting environment repos from github to start from scratch.

The names are defined as: echo $(grep repository jx-requirements.yml | cut -f 2 -d ":") or better: cat jx-requirements.yml| yq ".environments[].repository"

https://cert-manager.io/docs/configuration/acme/dns01/google/

kubectl create namespace jx
@feczo
feczo / knative.md
Last active September 28, 2021 02:40

Base K8 setup

export KUBERNETES_SKIP_CREATE_CLUSTER = 1
curl -sS https://get.k8s.io | bash

change machine type, region and number of worker nodes enable pre-emptible machine type to reduce cost requesting more external IP in region quota (IN_USE_ADDRESSES) on console.cloud.google.com

This takes about 15 minutes to set up all steps inclusive server/client.

  1. GCP VM with CoreOS (or any docker capable) image + network / firewall config
  2. install server image https://hub.docker.com/r/johnae/pritunl/
    sudo echo -n >/etc/systemd/resolved.conf && systemctl stop systemd-resolved
    docker pull johnae/pritunl
    docker run -d --privileged -p 53:53/udp -p 53:53/tcp -p 443:443/tcp johnae/pritunl
    docker ps
    docker exec -it $HEXA /bin/bash
# export PROJECT=my-project-x
# export STAGE=gs://my-bucket-x/ds
mvn compile exec:java \
-Dexec.mainClass=com.google.cloud.dataflow.examples.complete.StreamingLogExtract \
-Dexec.args="--project=$PROJECT \
--stagingLocation=$STAGE \
--pubsubTopic='projects/""$PROJECT""/topics/custom_logs' \
--bigQueryDataset='dataflow_demo' \
--bigQueryTable='custom_logs' \
--runner=DataflowPipelineRunner --workerMachineType='n1-standard-1' --streaming=true"
/*
* Copyright (C) 2015 Google Inc.
*
* 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
- name: log2monitor
cmd: /usr/local/bin/lb_response_code_logging.py
time: '* * * * * *'
onError: Backoff
notifyOnError: false
notifyOnFailure: true