Skip to content

Instantly share code, notes, and snippets.

View xynova's full-sized avatar

Hec xynova

  • Australia
View GitHub Profile
@xynova
xynova / aws-kubectl Dockerfile
Created April 21, 2018 11:18
aws-kubectl Dockerfile
FROM mesosphere/aws-cli as PKG
RUN apk --no-cache add openssl \
&& wget -q -O kubectl https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/kubectl \
&& wget -q -O gomplate https://github.com/hairyhenderson/gomplate/releases/download/v2.4.0/gomplate_linux-amd64-slim \
&& chmod +x kubectl gomplate \
&& mv kubectl gomplate /usr/local/bin
ENTRYPOINT ["/bin/sh","-c"]
CMD [""]
@xynova
xynova / aws-registry-deployment.yml
Last active April 21, 2018 10:48
AWS registry proxy deployment
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: aws-registry-proxy
labels:
app: aws-registry-proxy
buildRef: latest
spec:
replicas: 2
@xynova
xynova / aws-registry-credential-cron.yml
Last active April 22, 2018 06:11
AWS registry proxy config operator cronjob
# Updates aws registry credentials
# https://medium.com/@xynova/keeping-aws-registry-pull-credentials-fresh-in-kubernetes-2d123f581ca6
apiVersion: batch/v2alpha1
kind: CronJob
metadata:
name: aws-registry-credential-cron
spec:
successfulJobsHistoryLimit: 2
failedJobsHistoryLimit: 2
schedule: "1 */8 * * *"
@xynova
xynova / aws-registry-credential-job.yml
Created April 18, 2018 21:38
AWS registry proxy config operator job
# Creates aws registry credentials for the first time
# https://medium.com/@xynova/keeping-aws-registry-pull-credentials-fresh-in-kubernetes-2d123f581ca6
apiVersion: batch/v1
kind: Job
metadata:
name: aws-registry-credential-job
spec:
backoffLimit: 4
template:
spec:
@xynova
xynova / aws-registry-proxy-tpl.yml
Last active April 21, 2018 10:09
AWS registry proxy config template
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-registry-proxy-tpl
data:
registry.conf: |-
server {
listen 8080;
# http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
@xynova
xynova / aws-registry-credential-cron.yml
Last active November 17, 2021 17:57
Kubernetes CronJob to keep AWS Registry pull credentials fresh
apiVersion: batch/v2alpha1
kind: CronJob
metadata:
name: aws-registry-credential-cron
spec:
schedule: "* */8 * * *"
successfulJobsHistoryLimit: 2
failedJobsHistoryLimit: 2
jobTemplate:
spec:
@xynova
xynova / sshd_config
Last active August 16, 2017 07:01
App-Services base setup
# This is ssh server systemwide configuration file.
# required by Azure AppServices
#
Port 2222
Ciphers aes128-cbc,3des-cbc,aes256-cbc
MACs hmac-sha1,hmac-sha1-96
PermitRootLogin yes
PasswordAuthentication yes
ListenAddress 0.0.0.0
@xynova
xynova / entrypoint.sh
Last active August 20, 2017 08:57
App-Services base setup
#!/bin/sh
set -ebm
setup_ssh() {
echo "Create App Services root password"
echo "root:Docker!" | chpasswd
echo "Create ssh host keys"
ssh-keygen -A
@xynova
xynova / Dockerfile
Last active August 20, 2017 09:55
App-Services base setup
# BUILD STAGE
#
FROM golang:1.8.3-alpine3.6 AS confd-build-stage
WORKDIR /go/src/github.com/kei-sato
RUN apk --update add git bash
RUN git clone --depth 1 https://github.com/kei-sato/http-echo.git \
&& cd http-echo \
&& go build -o bin/http-echo . \
&& chmod +x bin/http-echo
@xynova
xynova / set-redis-key-to-coffee.sh
Created August 10, 2017 03:03
Setting a redis key through the nginx-confd container Raw
docker run --rm -ti --name rediscli \
--net container:nginx \
redis:alpine \
redis-cli -h localhost -p 6379 -a THE-XXXX-PASSWORD set /myapp/suggestions/drink coffee