Skip to content

Instantly share code, notes, and snippets.

View IronCore864's full-sized avatar
:octocat:
*

Tiexin Guo IronCore864

:octocat:
*
View GitHub Profile
import subprocess
from concurrent import futures
def get_releases(namespace: str = "default"):
ret = subprocess.run(
["helm", "list", "-n", namespace, "-q"],
capture_output=True,
check=True,
)
import subprocess
def get_releases(namespace: str = "default"):
ret = subprocess.run(
["helm", "list", "-n", namespace, "-q"],
capture_output=True,
check=True,
)
return ret.stdout.decode().splitlines()
$ cat a-text-file.txt
{
"data": "ENC[AES256_GCM,data:U1j0eOC7URJZsNb+Iqs=,iv:4F3Bw1YOIE2xxdag+PbrMLGcqAjG48qVDeiu+xTfnro=,tag:2tX0jUssBYeI0IF7Lxmy+A==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": null,
"lastmodified": "2022-09-15T04:38:19Z",

Cloud Native Computing Foundation

A project of The Linux Foundation

Individual Contributor License Agreement ("Agreement") v1.0

Thank you for your interest in the Cloud Native Computing Foundation project (“CNCF”) of The Linux Foundation (the "Foundation"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Foundation must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of CNCF, the Foundation and its users; it does not change your rights to use your own Contributions for any other purpose.

@IronCore864
IronCore864 / main.go
Last active December 7, 2021 03:51
Go Resty with GitHub Releases
package main
import (
"fmt"
"log"
"time"
resty "github.com/go-resty/resty/v2"
)
@IronCore864
IronCore864 / Dockerfile
Created August 1, 2021 08:42
Dockerfile Example
FROM golang:alpine
WORKDIR /app
COPY . .
RUN apk add git
RUN go get ./... && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app
I0803 10:03:13.689964 1 static_autoscaler.go:147] Starting main loop
I0803 10:03:13.780154 1 auto_scaling_groups.go:354] Regenerating instance to ASG map for ASGs: [eks-1cb9d9ce-32fe-2f15-35db-3a088d186141]
I0803 10:03:13.842713 1 aws_manager.go:263] Refreshed ASG list, next refresh after 2020-08-03 10:04:13.842705977 +0000 UTC m=+561.584674568
I0803 10:03:13.842938 1 utils.go:626] No pod using affinity / antiaffinity found in cluster, disabling affinity predicate for this loop
I0803 10:03:13.842955 1 static_autoscaler.go:303] Filtering out schedulables
I0803 10:03:13.843012 1 static_autoscaler.go:320] No schedulable pods
I0803 10:03:13.843034 1 static_autoscaler.go:328] No unschedulable pods
I0803 10:03:13.843047 1 static_autoscaler.go:375] Calculating unneeded nodes
I0803 10:03:13.843106 1 scale_down.go:379] Scale-down calculation: ignoring 2 nodes unremovable in the last 5m0s
I0803 10:03:13.843120 1 scale_down.go:410] Node ip-192-168-85-16.eu-cent
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:SetDesiredCapacity",
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
namespace: default
labels:
app: nginx
spec:
replicas: 4
selector:
tiexin@Tiexins-MacBook-Pro ~ $ eksctl create cluster -n test --managed
[ℹ] eksctl version 0.24.0
[ℹ] using region eu-central-1
[ℹ] setting availability zones to [eu-central-1c eu-central-1b eu-central-1a]
[ℹ] subnets for eu-central-1c - public:192.168.0.0/19 private:192.168.96.0/19
[ℹ] subnets for eu-central-1b - public:192.168.32.0/19 private:192.168.128.0/19
[ℹ] subnets for eu-central-1a - public:192.168.64.0/19 private:192.168.160.0/19
[ℹ] using Kubernetes version 1.16
[ℹ] creating EKS cluster "test" in "eu-central-1" region with managed nodes
[ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial managed nodegroup