Skip to content

Commit

Permalink
infra changes very big (#20)
Browse files Browse the repository at this point in the history
* new values

* new values

* new values

* vault json

* readme

* major refactor

* readme

* refactor

* working again

* revised working versions

* kustomize

* broken network

* still broken network but with update and holepunch

* do update after network init

* add del security rule. fix k8s network.

* use ubuntu user not root. lock down sshd config to prevent root and password.

* working with kubectl delete -f

* working docker compose test

* gcp and azure

* working docker swarm

* more examples
  • Loading branch information
bobmex authored Dec 29, 2018
1 parent 0c1ca83 commit 84f2a8b
Show file tree
Hide file tree
Showing 107 changed files with 8,849 additions and 1,771 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el
62 changes: 62 additions & 0 deletions deployments/examples/application/example/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: v1
name: {{.Name}}
kind: application
resource: {{.Resource.Group}}
metadata:
kind: {{.Application.Kind}}
name: {{.Application.Name}}
tags: {{.Application.Name}}-tag
tenant: {{.Application.Name}}-tenant
operator: {{.Operator.Name}}
dnszone: {{.Network.DNSZone}}
config:
kind: config
source:
detail:
base: {{.Application.Base}}
resources:
template: {{.Application.Template}}
deployment: {{.Application.Deployment}}
manifest: {{.Application.Manifest}}
spec:
flags: none
key: {{.Cluster.Name}}
rootlb: {{.Cluster.Name}}.{{.Operator.Name}}.{{.Network.DNSZone}}
image: {{.Application.Image}}
imagetype: {{.Application.ImageType}}
proxypath: {{.Application.ProxyPath}}
flavor: {{.Cluster.Flavor}}
uri: https://{{.Application.Name}}.{{.Cluster.Name}}.{{.Operator.Name}}.{{.Network.DNSZone}}
ipaccess: {{.Network.IPAccess}}
ports:
- name: lprotohttp1
mexproto: LProtoHTTP
proto: TCP
internalport: 27272
publicport: 27272
publicpath: {{.Application.Name}}-grpc
- name: lprotohttp2
mexproto: LProtoHTTP
proto: TCP
internalport: 27273
publicport: 27273
publicpath: {{.Application.Name}}-rest
- name: lprotohttp3
mexproto: LProtoHTTP
proto: TCP
internalport: 27274
publicport: 27274
publicpath: {{.Application.Name}}-http
- name: lprototcp1
mexproto: LProtoTCP
proto: TCP
internalport: 27275
publicport: 27275
publicpath: {{.Application.Name}}-tcp
- name: lprotoudp1
mexproto: LProtoUDP
proto: UDP
internalport: 27276
publicport: 27276
publicpath: {{.Application.Name}}-udp
command:
22 changes: 22 additions & 0 deletions deployments/examples/cluster/azure/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
name: {{.Name}}
kind: cluster
resource: {{.Resource.Group}}
metadata:
name: {{.Cluster.Name}}
tags: {{.Cluster.Name}}-tag
kind: {{.Cluster.Kind}}
tenant: {{.Cluster.Name}}-tenant
region: {{.Cluster.Region}}
zone: {{.Cluster.Zone}}
location: {{.Cluster.Location}}
resourcegroup: {{.Resource.Group}}
operator: {{.Operator.Name}}
dnszone: {{.Network.DNSZone}}
spec:
flags: force
flavor: {{.Cluster.Flavor}}
key: {{.Cluster.Name}}
dockerregistry: {{.Registry.Docker}}
rootlb: {{.Cluster.Name}}.{{.Operator.Name}}.{{.Network.DNSZone}}
networkscheme: {{.Network.Scheme}}
23 changes: 23 additions & 0 deletions deployments/examples/cluster/gcp/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
name: {{.Name}}
kind: cluster
resource: {{.Resource.Group}}
metadata:
name: {{.Cluster.Name}}
tags: {{.Cluster.Name}}-tag
kind: {{.Cluster.Kind}}
tenant: {{.Cluster.Name}}-tenant
region: {{.Cluster.Region}}
zone: {{.Cluster.Zone}}
location: {{.Cluster.Location}}
resourcegroup: {{.Resource.Group}}
operator: {{.Operator.Name}}
dnszone: {{.Network.DNSZone}}
project: {{.Resource.Project}}
spec:
flags: force
flavor: {{.Cluster.Flavor}}
key: {{.Cluster.Name}}
dockerregistry: {{.Registry.Docker}}
rootlb: {{.Cluster.Name}}.{{.Operator.Name}}.{{.Network.DNSZone}}
networkscheme: {{.Network.Scheme}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
web:
image: registry.mobiledgex.net:5000/stackdemo
build: .
ports:
- "8000:8000"
redis:
image: redis:alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# this is a dummy. no kustomize for docker-compose
apiVersion: v1
kind: Kustomization
#resources:
#- docker-compose.yml


Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: v1
kind: Service
metadata:
name: mexexample-tcp-service
labels:
run: mexexample
spec:
type: LoadBalancer
ports:
- port: 27272
targetPort: 27272
protocol: TCP
name: grpc27272
- port: 27273
targetPort: 27273
protocol: TCP
name: rest27273
- port: 27274
targetPort: 27274
protocol: TCP
name: http27274
- port: 27275
targetPort: 27275
protocol: TCP
name: tcp27275
selector:
run: mexexample
---
apiVersion: v1
kind: Service
metadata:
name: mexexample-udp-service
labels:
run: mexexample
spec:
type: LoadBalancer
ports:
- port: 27276
targetPort: 27276
protocol: UDP
name: udp27276
selector:
run: mexexample
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mexexample-deployment
spec:
selector:
matchLabels:
run: mexexample
replicas: 2
template:
metadata:
labels:
run: mexexample
spec:
volumes:
- name: mexexample
emptyDir: {}
imagePullSecrets:
- name: mexregistrysecret
containers:
- name: mexexample
image: registry.mobiledgex.net:5000/mobiledgex/mexexample
imagePullPolicy: Always
ports:
- containerPort: 27272
protocol: TCP
- containerPort: 27273
protocol: TCP
- containerPort: 27274
protocol: TCP
- containerPort: 27275
protocol: TCP
- containerPort: 27276
protocol: UDP
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Kustomization

#namespace: example
#namePrefix: example-
#commonAnnotations:
# operator-contact: 800-555-1212
#commonLabels:
# app: example

resources:
- app.yaml

8 changes: 8 additions & 0 deletions deployments/examples/kustomize/application/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -x
for i in overlays/*; do
kustomize build $i > output/$(basename $i).yaml
done
# bogus 0 length output for docker-compose example
rm output/stackdemo.yaml
cp base/docker-swarm/stackdemo/docker-compose.yml output/stackdemo.yaml
78 changes: 78 additions & 0 deletions deployments/examples/kustomize/application/output/mytest-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: v1
kind: Service
metadata:
labels:
run: mytest-app
name: mytest-app-mexexample-tcp-service
spec:
ports:
- name: grpc27272
port: 27272
protocol: TCP
targetPort: 27272
- name: rest27273
port: 27273
protocol: TCP
targetPort: 27273
- name: http27274
port: 27274
protocol: TCP
targetPort: 27274
- name: tcp27275
port: 27275
protocol: TCP
targetPort: 27275
selector:
run: mytest-app
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
labels:
run: mytest-app
name: mytest-app-mexexample-udp-service
spec:
ports:
- name: udp27276
port: 27276
protocol: UDP
targetPort: 27276
selector:
run: mytest-app
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mytest-app-mexexample-deployment
spec:
replicas: 2
selector:
matchLabels:
run: mytest-app
template:
metadata:
labels:
run: mytest-app
spec:
containers:
- image: registry.mobiledgex.net:5000/mobiledgex/mexexample
imagePullPolicy: Always
name: mexexample
ports:
- containerPort: 27272
protocol: TCP
- containerPort: 27273
protocol: TCP
- containerPort: 27274
protocol: TCP
- containerPort: 27275
protocol: TCP
- containerPort: 27276
protocol: UDP
imagePullSecrets:
- name: mexregistrysecret
volumes:
- emptyDir: {}
name: mexexample
10 changes: 10 additions & 0 deletions deployments/examples/kustomize/application/output/stackdemo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
web:
image: registry.mobiledgex.net:5000/stackdemo
build: .
ports:
- "8000:8000"
redis:
image: redis:alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mexexample-deployment
spec:
selector:
matchLabels:
run: mytest-app
template:
metadata:
labels:
run: mytest-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Kustomization
bases:
- ../../base/kubernetes/testapp
patchesStrategicMerge:
- tcp.yaml
- udp.yaml
- deploy.yaml
namePrefix: mytest-app-
#commonLabels:
# org: acme
# variant: testing
#commonAnnotations:
# note: Hello, I am testing!

Loading

0 comments on commit 84f2a8b

Please sign in to comment.