Check this out on Dev.to
- How to handle SSH keys with ec2-github actions https://zellwk.com/blog/github-actions-deploy/
- SSH_PRIVATE_KEY
- HOST_NAME / IP_ADDRESS
| NAMESPACE=YOUR_NAMESPACE_HERE && \ | |
| kubectl -n $NAMESPACE get --no-headers configmaps | awk '{print $1}' | \ | |
| xargs -I {} sh -c "kubectl -n $NAMESPACE get configmaps {} -o yaml > {}.yaml" |
Check this out on Dev.to
| import goyaml "github.com/go-yaml/yaml" | |
| func SplitYAML(resources []byte) ([][]byte, error) { | |
| dec := goyaml.NewDecoder(bytes.NewReader(resources)) | |
| var res [][]byte | |
| for { | |
| var value interface{} | |
| err := dec.Decode(&value) |
| import ( | |
| "crypto/rand" | |
| "encoding/base64" | |
| "github.com/approveapi/approveapi-go" | |
| "github.com/go-redis/redis" | |
| "time" | |
| ) | |
| func GenerateRandomToken(n int) (string, error) { | |
| b := make([]byte, n) |
This set of instructions goes with this presentation deck.
yum install postgis24_10
| FROM alpine:3.6 | |
| RUN apk add --no-cache --update gcc make automake autoconf libtool musl-dev zlib-dev git openssl nodejs nodejs-npm imagemagick | |
| RUN git clone https://github.com/skyrpex/potrace.git && \ | |
| cd potrace && \ | |
| autoreconf -i && \ | |
| ./configure && make && make install | |
| RUN npm install -g svgo |
| // tweaked from: https://stackoverflow.com/a/42718113/1170664 | |
| func getXML(url string) ([]byte, error) { | |
| resp, err := http.Get(url) | |
| if err != nil { | |
| return []byte{}, fmt.Errorf("GET error: %v", err) | |
| } | |
| defer resp.Body.Close() | |
| if resp.StatusCode != http.StatusOK { | |
| return []byte{}, fmt.Errorf("Status error: %v", resp.StatusCode) |
| package main | |
| import ( | |
| "bytes" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "errors" | |
| "io" | |
| "io/ioutil" |
| #!/usr/bin/env ruby | |
| require 'open3' | |
| require 'fileutils' | |
| def run_command(command) | |
| puts("+: " + command) | |
| Open3.popen2e(command) do |stdin, stdout_stderr, wait_thread| | |
| Thread.new do | |
| stdout_stderr.each {|l| puts l } |
I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (saharacluster.com).
A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.
And it was a dream!
All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.
And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go