Skip to content

Instantly share code, notes, and snippets.

View behroozam's full-sized avatar
😁
teheeee

Behrouz Hasanbeygi behroozam

😁
teheeee
View GitHub Profile
@behroozam
behroozam / deployment-example.yml
Created September 12, 2018 12:16
kubernetes deplyment example
apiVersion: v1
kind: Service
metadata:
name: app
labels:
app: appwebserver
spec:
ports:
- port: 80
selector:
@behroozam
behroozam / .gitlab-ci.yml
Created September 12, 2018 12:54
gitlab ci docker build kubernetes deploy
stages:
- build
- kube
variables:
TEST_IMAGE: yourrepo/yourapp:${CI_BUILD_REF_NAME}_${CI_BUILD_REF}
RELEASE_IMAGE: yourrepo/yourapp:latest
build:
stage: build
script:
@behroozam
behroozam / Dockerfile
Created September 12, 2018 12:57
kubctl image build
FROM behroozam/kube:latest
MAINTAINER behroozam <b.hasanbg@gmail.com>
COPY config /root/.kube/
@behroozam
behroozam / .env
Last active November 3, 2018 14:50
send laravl log to stdout
APP_LOG_LEVEL=debug
LOG_CHANNEL=stderr
@behroozam
behroozam / Dockerfile
Last active March 4, 2024 12:15
send nginx custom log to elasticsearch with fluentd syslog input
FROM fluent/fluentd:v1.3-1
# Use root account to use apk
USER root
# below RUN includes plugin as examples elasticsearch is not required
# you may customize including plugins as you wish
RUN apk add --no-cache --update --virtual .build-deps \
build-base ruby-dev \
&& gem install \
@behroozam
behroozam / calico.yml
Created February 17, 2019 14:48
rancher v2 calico-ipam
# calico/kube-controllers:v3.5.1
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# Configure this with the location of your etcd cluster.
@behroozam
behroozam / Dockerfile
Last active May 10, 2019 08:08
k8s laravel Dockerfile
FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv pdo pdo_mysql\
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
COPY fix-permission /bin/
WORKDIR /var/www/html/
@behroozam
behroozam / Dockefile
Last active May 13, 2019 09:05
laravel multi-stage Dockerfile
#
# Install PHP Dependencies
#
FROM composer:1.7 as vendor
COPY database/ database/
COPY composer.json composer.json
COPY composer.lock composer.lock
@behroozam
behroozam / rename.py
Created July 27, 2019 07:20
rename by CSV
#!/usr/bin/env python3
import os
import csv
# Coded by behroozam
# Twitter @b3hroozam
CSV_FILE_LOCATION = "./trim.csv"
PICTURES_SRC = "pictures/"
@behroozam
behroozam / .gitlab-ci.yaml
Last active February 20, 2020 20:15
delete everything in openshift except opened merge requests on gitlab ( due resource limitation )
stages:
- test
- build
- deploy
variables:
OKD_REGISTRY: 'yourprivateregistry'
OKD_PROJECT: ${CI_PROJECT_NAME}
cleanup-okd: