Skip to content

Instantly share code, notes, and snippets.

sonobuoy-config:
driver: Job
plugin-name: giantswarm
result-format: raw
spec:
image: sonobuoy-plugin
name: plugin
env:
- name: KUBECONFIG
- name: CP_KUBECONFIG
https://docs.google.com/presentation/d/18c0x7QhfDSxcgUZaDHgyT5UbdE2bAm2yeAXnNGjdR4U/edit?usp=sharing
https://drive.google.com/open?id=1m-lhdU-iGoGGgYkVcH_rJSz-fxzwzaMi
@fiunchinho
fiunchinho / service.go
Created December 3, 2018 09:44
Dependency injection
func NewIamRoleAnnotator(k8sCli kubernetes.Interface, awsAccountID string, logger Logger) *IamRoleAnnotator {
return &IamRoleAnnotator{
client: k8sCli,
awsAccountID: awsAccountID,
logger: logger,
}
}
@fiunchinho
fiunchinho / service.go
Created December 3, 2018 09:43
object using the client-go library directly
func (s *IamRoleAnnotator) submitChangesToKubernetesAPI(deployment *appsv1beta1.Deployment) (*appsv1beta1.Deployment, error) {
s.logger.Infof("Sending changes to k8s API")
return s.client.AppsV1beta1().Deployments(deployment.Namespace).Update(deployment)
}
@fiunchinho
fiunchinho / ping.php
Created December 16, 2017 11:10
Example application for CodelyTvPro
<?php
echo "Ping " . $_SERVER['SERVER_ADDR'];
@fiunchinho
fiunchinho / main.go
Created August 15, 2017 11:54
Controller that whitelist IP's on ingress objects
package main
import (
"flag"
"fmt"
"log"
"reflect"
"time"
"k8s.io/apimachinery/pkg/util/runtime"
@fiunchinho
fiunchinho / ansistrano.md
Created March 27, 2017 20:00
Ansistrano on fresh EC2 Ubuntu

Playbook

---
- hosts: localhost
  vars:
    ansistrano_deploy_to: "/var/www/html"
  roles:
    - carlosbuenosvinos.ansistrano-deploy
@fiunchinho
fiunchinho / elastic.md
Last active January 28, 2017 18:17
Useful endpoints to monitor cluster health

Useful ElasticSearch urls

/_cluster/health?v
/_cat/nodes?v
/_nodes/stats/_all
/_cat/indices?v
/_cat/shards?v
@fiunchinho
fiunchinho / endpoint.java
Last active August 16, 2016 13:54
Endpoint that returns 400 Bad requests when coming from Zuul
@RequestMapping(value = "/endpoint", method = RequestMethod.PUT, produces = "application/json")
public Single<String> sayHello(HttpServletResponse response) throws IOException {
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("payload_big.json");
Observable<String> sobs = Observable.create(new Observable.OnSubscribe<String>() {
@Override
public void call(Subscriber<? super String> subscriber) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
@fiunchinho
fiunchinho / OneLiners.md
Last active May 5, 2016 09:43
One liners to fetch, uncompress and remove