Skip to content

Instantly share code, notes, and snippets.

View yosshy's full-sized avatar

Akira YOSHIYAMA yosshy

  • NEC Corporation
View GitHub Profile
@yosshy
yosshy / ControllerPublishVolume logs.txt
Created December 30, 2022 08:06
How to reproduce running a pod on another node after a worker node down
## Version Information
- trident_version: v21.04.0
- OpenShift(K8s) version
<pre>
$ oc version -o yaml
clientVersion:
buildDate: "2022-08-02T07:42:48Z"
compiler: gc
gitCommit: 70750898e45ff4a349995b08e1d64a359e4c4880
@yosshy
yosshy / log.txt
Created October 12, 2022 02:07
Details of K8s taint API
I1012 11:01:00.694660 40226 loader.go:372] Config loaded from file: ./inventory/sample/artifacts/admin.conf
I1012 11:01:00.695962 40226 cached_discovery.go:112] returning cached discovery info from /home/yosshy/.kube/cache/discovery/172.18.8.101_6443/servergroups.json
I1012 11:01:00.696414 40226 cached_discovery.go:76] returning cached discovery info from /home/yosshy/.kube/cache/discovery/172.18.8.101_6443/storage.k8s.io/v1beta1/serverresources.json
I1012 11:01:00.696431 40226 cached_discovery.go:76] returning cached discovery info from /home/yosshy/.kube/cache/discovery/172.18.8.101_6443/flowcontrol.apiserver.k8s.io/v1beta1/serverresources.json
I1012 11:01:00.696466 40226 cached_discovery.go:76] returning cached discovery info from /home/yosshy/.kube/cache/discovery/172.18.8.101_6443/autoscaling/v2beta1/serverresources.json
I1012 11:01:00.696583 40226 cached_discovery.go:76] returning cached discovery info from /home/yosshy/.kube/cache/discovery/172.18.8.101_6443/autoscaling/v2beta2/serverresou
@yosshy
yosshy / gist:cca8089771bf6437745d251cd6e1e952
Created June 20, 2022 01:16
Patch for Kubespray to use non-graceful shutdown capability and to build 4 nodes cluster with 1 controller
diff --git a/Vagrantfile b/Vagrantfile
index 1cfa72c8..5bcdee30 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -43,7 +43,7 @@ if File.exist?(CONFIG)
end
# Defaults for config options defined in CONFIG
-$num_instances ||= 3
+$num_instances ||= 4
@yosshy
yosshy / jtchecker.py
Last active September 26, 2021 13:04
Japanese translation checker for minikube
import codecs
import json
import re
import string
CHO_ON_PATTERN = re.compile(r"[ア-ンー・]+[アカガサザタダナハバパマヤラワァィゥェォ][^ア-ン]")
ILLEGAL_CHARACTERS = re.compile("[ ({【『[)}】』]”’,.・0123456789:/-]")
ILLEGAL_KANJI_PATTERN = re.compile("(下さい|無し|為|する事)")
@yosshy
yosshy / maze.py
Last active August 14, 2021 04:32
海外君の娘さんの朝のドリル solver
#!/usr/bin/env python
import sys
MAZE = [
"--------",
"-○○◎■□□ア",
"-□□×□△◎-",
"-■□□××△-",
@yosshy
yosshy / gen_cert
Created September 14, 2019 10:57
gen_cert: Generate X509 Certificate and Private Key
#!/usr/bin/python
# usage: gen_cert [-h] [-C COUNTRY] [-ST STATE] [-L LOCALITY] [-O ORGANIZATION]
# [-OU ORGANIZATION_UNIT] [-CN COMMON_NAME] [-E EMAIL_ADDRESS]
# [-p PERIOD] [-d DNS] [-i IP] [-s SERIAL]
# certfile keyfile
#
# Generate X509 Certificate and Private Key
#
# positional arguments:
# certfile
@yosshy
yosshy / Fix IPv6 config in Monasca APIs
Last active July 30, 2019 04:23
Fix IPv6 config in Monasca APIs
diff --git a/monasca_api/conf/types.py b/monasca_api/conf/types.py
index 5edc56b..a5180e4 100644
--- a/monasca_api/conf/types.py
+++ b/monasca_api/conf/types.py
@@ -36,7 +36,7 @@ class HostAddressPortType(types.HostAddress):
super(HostAddressPortType, self).__init__(version, type_name=type_name)
def __call__(self, value):
- addr, port = value.split(':')
+ addr, port = value.rsplit(':', 1)
@yosshy
yosshy / gen-dc-awx-gitea.sh
Last active December 14, 2019 12:51
Script to generate docker-compose.yml for building AWX + Gitea environment
#!/bin/bash
USER=admin
PASSWORD=password
SYSTEM_USER=sysuser
SYSTEM_PASSWORD=nomoresecret
SECRET_KEY=secrete
FQDN="awx.example.com"
AWX_HTTPS_PORT=443
@yosshy
yosshy / sydney2017.ical
Created October 29, 2017 09:50
iCalendar for OpenStack Summit Sydney 2017
BEGIN:VCALENDAR
DTSTART:20170507T080000
SUMMARY:OpenStack Summit Boston 2017
BEGIN:VEVENT
SUMMARY:Upstream Institute Sponsored by Lenovo - Day 1 (RSVP Required)
DTSTART;VALUE=DATE-TIME:20171104T030000Z
DTEND;VALUE=DATE-TIME:20171104T070000Z
UID:20363@openstacksummitboston2017
DESCRIPTION:OpenStack Upstream Institute is an intensive program designed
to share knowledge about the different ways of contributing to OpenStack l
@yosshy
yosshy / count_openstack_repos.py
Last active September 6, 2017 09:38
OpenStack Repositories Counter
#!/usr/bin/python
import requests
import yaml
URL = ("https://git.openstack.org/cgit/openstack/"
"governance/plain/reference/projects.yaml")