Skip to content

Instantly share code, notes, and snippets.

View xcoulon's full-sized avatar

Xavier Coulon xcoulon

View GitHub Profile
name: ui
containers:
- image: registry.devshift.net/fabric8-ui/fabric8-ui:309eeb
env:
- name: FABRIC8_SSO_API_URL
value: "https://sso.prod-preview.openshift.io"
- name: FABRIC8_WIT_API_URL
value: "http://wit:8080"
- name: FABRIC8_AUTH_API_URL
value: "http://auth:8089"
@xcoulon
xcoulon / webapp-deploy
Created November 19, 2017 15:51
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes (resource for the story on Medium)
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: webapp
spec:
template:
metadata:
labels:
app: webapp
spec:
@xcoulon
xcoulon / database-deployment.yaml
Created November 19, 2017 15:50
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes (resource for the story on Medium)
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postgres
spec:
template:
metadata:
labels:
app: postgres
spec:
@xcoulon
xcoulon / databse-secrets.yaml
Created November 19, 2017 15:49
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes (resource for the story on Medium)
apiVersion: v1
kind: Secret
metadata:
name: database-secret-config
type: Opaque
data:
dbname: dXJsX3Nob3J0ZW5lcl9kYg==
username: dXNlcg==
password: bXlzZWNyZXRwYXNzd29yZA==
@xcoulon
xcoulon / webapp-deployment.yaml
Created November 19, 2017 15:48
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes (resource for the story on Medium)
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: webapp
spec:
...
env:
- name: POSTGRES_HOST
value: postgres
- name: POSTGRES_PORT
@xcoulon
xcoulon / postgres-deployment.yaml
Created November 19, 2017 15:47
Managing Pod configuration using ConfigMaps and Secrets in Kubernetes (resource for the story on Medium)
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postgres
spec:
...
env:
- name: POSTGRES_DB
value: url_shortener_db
- name: POSTGRES_USER
@xcoulon
xcoulon / unmarshalling.go
Last active November 19, 2017 15:31
Nested structs in Golang (resource for the story on Medium)
type Config struct {
Server struct {
Host string `json:"host"`
Port string `json:"port"`
} `json:"server"`
Postgres struct {
Host string `json:"host"`
User string `json:"user"`
Password string `json:"password"`
DB string `json:"db"`
@xcoulon
xcoulon / template_init.go
Last active November 19, 2017 13:07
Nested structs in Golang (resource for the story on Medium)
tmpl := template.New("foo_bar").Parse(
`<div id="{{.ID}}"><p>{{.Content}}</p></div>`)
tmpl.Execute(w, struct {
ID string
Content string
}{
ID: "foo",
Content: "bar",
})
@xcoulon
xcoulon / nested_structs_init.go
Last active November 19, 2017 15:28
Nested structs in Golang (resource for the story on Medium)
config := Config{
Server: struct {
Host string `json:"host"`
Port string `json:"port"`
}{
Host: "localhost",
Port: "8080",
},
Postgres: struct {
Host string `json:"host"`
@xcoulon
xcoulon / top_level_structs.go
Last active November 19, 2017 13:09
Nested structs in Golang (resource for the story on Medium)
type Config struct {
Server Server `json:"server"`
Postgres Postgres `json:"postgres"`
}
type Server struct {
Host string `json:"host"`
Port string `json:"port"`
}