Skip to content

Instantly share code, notes, and snippets.

View lvthillo's full-sized avatar

Lorenz Vanthillo lvthillo

View GitHub Profile
@lvthillo
lvthillo / jenkins-pipeline.groovy
Last active December 3, 2019 03:47
Example Jenkins Maven pipeline which uses slackNotifier.groovy
/* import shared library */
@Library('jenkins-shared-library')_
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '3'))
}
@lvthillo
lvthillo / values.yaml
Last active April 28, 2018 13:38
Values for OpenVPN Chart (Helm)
# Default values for openvpn.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: jfelten/openvpn-docker
tag: 1.1.0
pullPolicy: IfNotPresent
service:
name: openvpn
@lvthillo
lvthillo / openvpn-pv-claim.yaml
Created April 25, 2018 18:00
Persistent volume claim for OpenVPN
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: openvpn-data-claim
namespace: openvpn
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
@lvthillo
lvthillo / get-certificate
Created April 28, 2018 15:03
Get .OVPN file by executing each line separately
# execute each line separately
POD_NAME=$(kubectl get pods --namespace openvpn -l type=openvpn -o jsonpath='{ .items[0].metadata.name }')
SERVICE_NAME=$(kubectl get svc --namespace openvpn -l type=openvpn -o jsonpath='{ .items[0].metadata.name }')
SERVICE_IP=$(kubectl get svc --namespace openvpn $SERVICE_NAME -o go-template='{{ range $k, $v := (index .status.loadBalancer.ingress 0)}}{{ $v }}{{end}}')
KEY_NAME=kubeVPN
kubectl --namespace openvpn exec -it $POD_NAME /etc/openvpn/setup/newClientCert.sh $KEY_NAME $SERVICE_IP
kubectl --namespace openvpn exec -it $POD_NAME cat /etc/openvpn/certs/pki/$KEY_NAME.ovpn > $KEY_NAME.ovpn
@lvthillo
lvthillo / deployment.yaml
Created August 20, 2018 20:43
Example of NodePort service in Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
selector:
matchLabels:
run: my-app
replicas: 2
template:
@lvthillo
lvthillo / policy-document-1.json
Last active December 23, 2018 17:58
AWS IAM Policy Document to allow user to assume role
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:ListRoles",
"sts:AssumeRole"
],
"Resource": "*"
@lvthillo
lvthillo / policy-document-2.json
Created December 23, 2018 18:06
AWS IAM Policy Document to allow to put S3 object
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::demo-lvthillo-bucket/*"
}
@lvthillo
lvthillo / application-role-trust-policy.json
Created December 23, 2018 18:15
Assume role policy document
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::123456789012:root" },
"Action": "sts:AssumeRole"
}
}
@lvthillo
lvthillo / VPC
Created February 27, 2019 18:12
VPC
Parameters:
VPCCidr:
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Type: String
Default: 10.0.0.0/16
Description: Enter the CIDR for your VPC
...
Resources:
VPC:
Type: AWS::EC2::VPC
@lvthillo
lvthillo / Subnets
Created February 27, 2019 18:17
Subnets
Parameters:
Region:
Type: String
Default: eu-west-1
AllowedValues:
- eu-west-1
- eu-west-2
- eu-west-3
- eu-central-1
- us-west-2