Skip to content

Instantly share code, notes, and snippets.

View cccaternberg's full-sized avatar
🎯
Focusing

Andreas Caternberg cccaternberg

🎯
Focusing
View GitHub Profile
#create the cluster
##These include Jenkins a CI/CD pipeline solution
##Nexus - an artifact repository
##Chartmuseum - a Helm Chart repository
##Monocular which provides a Web UI for searching and discovering charts deployed into your cluster via Jenkins X.
#jx create cluster gke --cluster-name='jx-acaternberg' --labels='created-by-acaternberg'
#jx create cluster gke --skip-login --default-admin-password=mySecretPassWord123 -n jx-acaternberg
jx create cluster gke
#create a spring-boot application
/*
Set yourself up:
1) Install SDKMAN - http://sdkman.io/
2) Install Groovy: sdk install groovy
3) Start the groovy console by typing: groovyConsole
*/
// Single line comments start with two forward slashes
source kops
export BUCKET_NAME=devops23-$(date +%s)
export KOPS_STATE_STORE=s3://$BUCKET_NAME
aws s3api create-bucket \
--bucket $BUCKET_NAME \
--create-bucket-configuration \
LocationConstraint=$AWS_DEFAULT_REGION
kops edit --help
kops edit ig --name $NAME nodes
# Change `spec.maxSize` and `spec.minSize` to `2`, save, and exit.
kops update cluster --name $NAME --yes
kops validate cluster
git clone https://github.com/vfarcic/k8s-specs.git
cd k8s-specs
git pull
open "https://console.aws.amazon.com/iam/home#/security_credential"
export AWS_ACCESS_KEY_ID=[...]
aws elb describe-load-balancers
kubectl config view
kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/ingress-nginx/v1.6.0.yaml
kubectl --namespace kube-ingress get all
aws elb describe-load-balancers
#This one wont work for me
@cccaternberg
cccaternberg / jmx-parameters-example.txt
Created May 29, 2018 08:04 — forked from m-szalik/jmx-parameters-example.txt
How to enable remote JMX access
java -jar yourApp.jar [JVM_OPTIONS]
For local host access only JVM_OPTIONS are:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.host=127.0.0.1
-Dcom.sun.management.jmxremote.local.only=true
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
node (){
stage ("prepare"){
["1", "2", "3"].each {
println "Item: $it"
// Write a text file there.
dir ("output"){
writeFile file: "${it}-test.txt", text: "$it",encoding: "UTF-8"
}
// assume this is some list of things you're going to do something with
def someList
def parallelBranches = someList.collectEntries { n ->
[(n): {
throttle('category') {
node('some-node') {
// do some things with n
}
}
}]