Skip to content

Instantly share code, notes, and snippets.

View radu-matei's full-sized avatar

Radu Matei radu-matei

View GitHub Profile
@radu-matei
radu-matei / main.go
Created September 21, 2017 07:51
simple-web-go
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}
1. Start the az command-line inside a container (or inside the Azure cloud shell)
------------------------------------------------
docker run -p 83:8080 -it azuresdk/azure-cli-python bash
2. Login
--------
az login
3. Select the correct subscription and create a new resource group
------------------------------------------------------------------
@radu-matei
radu-matei / kubernetes18.json
Created October 6, 2017 18:15
kubernetes18.json
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.8"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
@radu-matei
radu-matei / Dockerfile
Last active January 6, 2019 22:58
kubectl-helm-draft
FROM ubuntu:16.04
LABEL maintainer Radu Matei <matei.radu94@gmail.com>
# Latest versions for kubectl, helm and draft
ENV KUBE_LATEST_VERSION="v1.8.0"
ENV HELM_LATEST_VERSION="v2.6.2"
ENV DRAFT_LATEST_VERSION="v0.7.0"
RUN apt-get update && apt-get install -y \
@radu-matei
radu-matei / docker-run
Created October 7, 2017 12:53
docker-run-kubectl-helm-draft
docker run -it \
-v <path-to-cluster-certificates>:/cluster \
-v <path-to-your-source-code-directory--optional>:/go-code \
-p 8080:8080 \
radumatei/kubectl-helm-draft
@radu-matei
radu-matei / jenkins-values.yaml
Last active April 17, 2021 14:54
jenkins-values.yaml
# Default values for jenkins.
# This is a YAML-formatted file.
# Declare name/value pairs to be passed into your templates.
# name: value
Master:
Name: jenkins-master
Image: "jenkinsci/jenkins"
ImageTag: "2.73"
ImagePullPolicy: "Always"
@radu-matei
radu-matei / Jenkinsfile
Last active April 20, 2021 12:49
Jenkinsfile-k8s
podTemplate(label: 'mypod', containers: [
containerTemplate(name: 'docker', image: 'docker', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl:v1.8.0', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'helm', image: 'lachlanevenson/k8s-helm:latest', command: 'cat', ttyEnabled: true)
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'),
]) {
node('mypod') {
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: apache-php-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: apache-php
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: private-api
spec:
replicas: 3
template:
metadata:
labels:
app: private-api
@radu-matei
radu-matei / Dockerfile
Created November 23, 2017 16:11
dockerfile-alpine
FROM microsoft/dotnet-nightly:2.1-sdk AS build-env
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.csproj ./
COPY NuGet.config ./
RUN dotnet restore
# copy everything else and build
COPY . ./