Skip to content

Commit

Permalink
add: build/deploy support based on kustomize & skaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold committed Aug 18, 2020
1 parent 6eb1d6d commit 7f23272
Show file tree
Hide file tree
Showing 9 changed files with 270 additions and 0 deletions.
20 changes: 20 additions & 0 deletions deploy/bases/Kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

commonLabels:
app: syndesis
syndesis.io/app: syndesis
syndesis.io/type: infrastructure
app.kubernetes.io/name: syndesis
app.kubernetes.io/part-of: syndesis
app.kubernetes.io/version: 1.11.0-20200813

resources:
- ../../install/operator/deploy
- ./namespace.yaml
- ./pvc.yaml
- ./rbac.yaml
- ./secrets.yaml
- ./cr.yaml

17 changes: 17 additions & 0 deletions deploy/bases/cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: syndesis.io/v1beta1
kind: Syndesis
metadata:
name: app
spec:
#
# Route hostname is required for the accessing ingress
#
routeHostname: ${external_host}
components:
oauth:
#
# Secrets are required for oauth authorisation and authentication
#
credentialsSecret: syndesis-oauth-credentials
cryptoCommsSecret: syndesis-oauth-comms
6 changes: 6 additions & 0 deletions deploy/bases/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: syndesis

144 changes: 144 additions & 0 deletions deploy/bases/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0001
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0001"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0002
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0002"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0003
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0003"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0004
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0004"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0005
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0005"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0006
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0006"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0007
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0007"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0008
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0008"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: syndesis-pv0009
labels:
type: local
spec:
storageClassName: standard
persistentVolumeReclaimPolicy: Recycle
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/pv0009"
14 changes: 14 additions & 0 deletions deploy/bases/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: syndesis-admin
namespace: syndesis
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: developer
18 changes: 18 additions & 0 deletions deploy/bases/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: v1
kind: Secret
metadata:
name: syndesis-oauth-credentials
stringData:
OAUTH2_PROXY_PROVIDER: "${provider}"
OAUTH2_PROXY_CLIENT_ID: "${client_id}"
OAUTH2_PROXY_CLIENT_SECRET: "${client_secret}"
---
apiVersion: v1
kind: Secret
metadata:
name: syndesis-oauth-comms
type: kubernetes.io/tls
data:
tls.key: ${oauth_key}
tls.crt: ${oauth_cert}
13 changes: 13 additions & 0 deletions install/operator/deploy/Kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ./crds/syndesis.io_syndeses_crd.yaml
- ./cluster_role.yaml
- ./cluster_role_binding.yaml
- ./role.yaml
- ./role_binding.yaml
- ./service_account.yaml
- ./operator.yaml

18 changes: 18 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# explore k8s api
k8sapi:
kubectl proxy --port=8080 &
xdg-open http://localhost:8080

# (re)create dev cluster
k3drecreate:
#!/bin/bash
k3d cluster delete || true
mkdir -p /tmp/k3d/kubelet/pods
# Note: we expose a volume mount of `shared` type to enable the
# Container Storage Interface related functionlity which depends on mount type shared volumes
# So we can do `kubectl alpha debug` and span ephemeral containers for debugging
k3d cluster create --api-port 6550 -p 8081:80@loadbalancer --agents 2 \
-v /tmp/k3d/kubelet/pods:/var/lib/kubelet/pods:shared \
--k3s-server-arg '--kube-apiserver-arg=feature-gates=EphemeralContainers=true'

20 changes: 20 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: skaffold/v2beta6
kind: Config
metadata:
name: syndesis
build:
artifacts:
- image: syndesis/syndesis-operator
context: install/operator/build
- image: syndesis/syndesis-meta
context: install/operator/build
- image: syndesis/syndesis-server
context: install/operator/build
- image: syndesis/syndesis-ui
context: install/operator/build
deploy:
kustomize:
paths:
- deploy/bases
kubeContext: k3d-k3s-default

0 comments on commit 7f23272

Please sign in to comment.