Skip to content

Instantly share code, notes, and snippets.

View akash-gautam's full-sized avatar

Akash Gautam akash-gautam

View GitHub Profile
package producer
import (
"config"
"fmt"
"os"
"time"
"github.com/aws/aws-sdk-go/service/kinesis"
package publisher
import (
"config"
"encoding/json"
"fmt"
"log"
"math/rand"
"os"
"time"
apiVersion: v1
kind: Service
metadata:
name: test-service
spec:
type: LoadBalancer
ports:
- name: test-service
port: 80
protocol: TCP
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: test-app
spec:
replicas: 1
template:
metadata:
labels:
app: test-app
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mongodb
spec:
template:
metadata:
labels:
app: mongodb
spec:
apiVersion: v1
kind: Service
metadata:
name: mongodb-service
spec:
ports:
- port: 27017
targetPort: 27017
protocol: TCP
name: mongodbport
package main
import (
"flag"
"fmt"
"time"
"blog.velotio.com/crd-blog/v1alpha1"
"github.com/golang/glog"
apiextension "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
@akash-gautam
akash-gautam / type.go
Created August 21, 2018 10:38
type.go contains the structure of objects of type sslconfig
package v1alpha1
import meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type SslConfig struct {
meta_v1.TypeMeta `json:",inline"`
meta_v1.ObjectMeta `json:"metadata"`
Spec SslConfigSpec `json:"spec"`
Status SslConfigStatus `json:"status,omitempty"`
}
@akash-gautam
akash-gautam / sslconfig.go
Created August 21, 2018 10:37
sslconfig.go contains the sslconfig interface,client and methods for accessing sslconfig objects using the client
package v1alpha1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
)
func (c *SslConfigV1Alpha1Client) SslConfigs(namespace string) SslConfigInterface {
return &sslConfigclient{
client: c.restClient,
@akash-gautam
akash-gautam / register.go
Created August 21, 2018 07:47
register.go contains the function which creates a client which is aware of our crd
package v1alpha1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/rest"
)