Skip to content

Instantly share code, notes, and snippets.

View zdtsw's full-sized avatar

Wen Zhou zdtsw

View GitHub Profile

Description

To verify Raw Mode can work with cluster which already have ServiceMesh/Serverless installed. Test object is a very simple mnist-8 OCI with sample data as input

Test Steps

install dependency in OCP

This step is only to setup an cluster which has such resource alread in place, to use Raw Mode this is not needed at all.

@zdtsw
zdtsw / tips.txt
Created October 1, 2022 16:02
Jenkins start error "protocol"
when start jenkins service got error "
systemctl status jenkins.service
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled)
Active: failed (Result: protocol) since Sat 2022-10-01 17:47:58 CEST; 1min 50s ago
Process: 8832 ExecStart=/usr/bin/jenkins (code=exited, status=0/SUCCESS)
Main PID: 8832 (code=exited, status=0/SUCCESS)
@zdtsw
zdtsw / lambdaAMICleanup.py
Created March 19, 2021 16:12 — forked from bkozora/lambdaAMICleanup.py
AWS Lambda Function to Delete AMIs and Snapshots
# Automated AMI and Snapshot Deletion
#
# @author Bobby Kozora
#
# This script will search for all instances having a tag named "Backup" with a value of "Backup".
# As soon as we have the instances list, we loop through each instance
# and reference the AMIs of that instance. We check that the latest daily backup
# succeeded then we store every image that's reached its DeleteOn tag's date for
# deletion. We then loop through the AMIs, deregister them and remove all the
# snapshots associated with that AMI.
@zdtsw
zdtsw / README_JenkinsProperty.md
Last active May 19, 2020 05:27
problem of loading gitlab plugin in jenkins job after dsl created pipeline

Background: DSL creates pipeline by default after each run, in our case, we cannot disable create pipeline due to it already exists. Because it might be a change in the jenkinsfile, which need to be reload to the job and requires a re-creation. After a while, (it never happens in my master pipeline, which does a event pull triggere by gitlab) the MR pipeline start to have strange behavior, e.g it does not get trigger by any MR (new one or old one but with new commits) It was very hard to identify what exactly is wrong, but from gitlab activity it shows the webhook did works and it got 200 return So must be something wrong in the jenkins side. One thing I noticed is, the property values (which are used as env variable for jenkins job) are gone it is not consistent or till now I cannot tell what combination cause this "disappear"

Workaround:

@zdtsw
zdtsw / instruction.txt
Last active April 8, 2020 13:46
vault in K8s
~/GitHub/$ git clone https://github.com/hashicorp/vault-helm.git
/* create and set namespace wen-vault1 */
~/GitHub/vault-helm$ kubectl create namespace wen-vault1
~/GitHub/vault-helm$ kubectl config set-context --current --namespace=wen-vault1
/* create serviceaccount serviceaccount-wen-vault1 will be used for below k8s deployment on pod to use */
~/GitHub/vault-helm/wen$ more serviceaccount.yaml
apiVersion: v1
Below is a simple exmple of how to use gitlab ci
you need to have two different runner: one windows with tag "windows" and one linux with tag "linux"
the pipeline basically try to do
-some go static check
-build go app on both window and linux parallel
-run int test
-deploy goapp to qa1 and qa2 parallel
-deploy to production
there is a lot room to improve this, say, qa1 could be a windows qa2 could be a linux, say, we do not really need runner but can use
@zdtsw
zdtsw / helm_chart.txt
Last active April 16, 2020 13:13
Usage of Helm and commands
1. DIR1>helm create $chart
in the current dir, create a folder "chart" with structure
├── charts
├── Chart.yaml
├── templates
│   ├── deployment.yaml
│   ├── _helpers.tpl
│   ├── ingress.yaml
│   ├── NOTES.txt
│   ├── service.yaml
@zdtsw
zdtsw / bug_logParser.txt
Created October 10, 2018 15:01
LogParser plugin not working for pipeline job
LogParserPublisher is the plugin not working well with pipeline job , in the old fashine Jenkins1.0 it seems quite ok
e.g
stage('1'){
node('master'){
echo " FAILURE "
}
}
@zdtsw
zdtsw / 1.txt
Created September 3, 2018 17:20
How to add dependency for your jenkins shard lib
Background:
i need to use http-builder for my jenkins shardlib and by default the jar file is not available to use with a simple "import"
Solution:
from code:
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
import groovyx.net.http.HTTPBuilder
//you can check maven center if there is a newer version (>0.7.1) released, so far this version has been parked there for a couple of years
@zdtsw
zdtsw / QnA.txt
Created December 1, 2017 10:04
All about K8s setting up on CentOS7: 1 master kubint01 (ip: 10.14.48.82) + 2 nodes kubint02 and kubint03(ip: 10.14.48.83, and 10.14.48.84)
Error: cannot see nodes even "kubeadmin init" looks okej
>kubectl get nodes
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
Solution:
[root@kubint01 ~]# cp /etc/kubernetes/kubelet.conf ~/.kube/config
[root@kubint01 ~]# export KUBECONFIG=$HOME/.kube/config
[root@kubint01 ~]# echo $KUBECONFIG
/root/.kube/admin.conf
[root@kubint01 ~]# kubectl get nodes