-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 🧑💻 add development environement script
- Loading branch information
1 parent
d3c0c74
commit 998f77f
Showing
10 changed files
with
381 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.github/ | ||
ci/ | ||
kind/ | ||
.release-please-manifest.json | ||
release-please-manifest.json | ||
README.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Run kubernetes locally with docker | ||
|
||
## Prerequisite | ||
|
||
Download & install on your local machine : | ||
- [kind](https://github.com/kubernetes-sigs/kind) | ||
- [kubectl](https://github.com/kubernetes/kubectl) | ||
- [helm](https://github.com/helm/helm) | ||
|
||
## Commands | ||
|
||
```sh | ||
# Start kind cluster | ||
sh ./run.sh -c create | ||
|
||
# Build and load docker-compose images into the cluster | ||
sh ./run.sh -c build | ||
|
||
# Stop kind cluster | ||
sh ./run.sh -c delete | ||
|
||
# Start kind cluster, build and load images and deploy app | ||
sh ./run.sh -c dev | ||
``` | ||
|
||
## Cluster | ||
|
||
One single node is deployed but it can be customized in `./configs/kind-config.yml`. The cluster comes with [Traefik](https://doc.traefik.io/traefik/providers/kubernetes-ingress/) ingress controller installed with port mapping on both ports `80` and `443`. | ||
|
||
The node is using `extraMounts` to provide a volume binding between host working directory and `/app` to give the ability to bind mount volumes into containers during development. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
extraPortMappings: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
- containerPort: 443 | ||
hostPort: 443 | ||
protocol: TCP | ||
extraMounts: | ||
- hostPath: ./ | ||
containerPath: /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
providers: | ||
kubernetesCRD: | ||
namespaces: | ||
- default | ||
- ingress-traefik | ||
kubernetesIngress: | ||
namespaces: | ||
- default | ||
- ingress-traefik | ||
|
||
ports: | ||
web: | ||
nodePort: 80 | ||
websecure: | ||
nodePort: 443 | ||
|
||
service: | ||
type: NodePort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
services: | ||
server: | ||
image: external-dns-midaas-webhook:dev | ||
build: | ||
context: .. | ||
dockerfile: ./Dockerfile | ||
target: dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -- How DNS records are synchronized between sources and providers; available values are `sync` & `upsert-only`. | ||
policy: sync | ||
# -- Specify the registry for storing ownership and labels. | ||
# Valid values are `txt`, `aws-sd`, `dynamodb` & `noop`. | ||
# If `noop` midaas manage all records on zone | ||
registry: txt | ||
# can restrict zone | ||
provider: | ||
name: webhook | ||
webhook: | ||
image: | ||
repository: external-dns-midaas-webhook | ||
tag: dev | ||
pullPolicy: Never | ||
env: | ||
- name: TSIG_ZONE_foo | ||
value: bar | ||
- name: API_LOG_LEVEL | ||
value: DEBUG | ||
- name: PROVIDER_SKIP_TLS_VERIFY | ||
value: "true" | ||
extraVolumeMounts: | ||
- name: dev-workspace | ||
mountPath: /go/src/app | ||
env: | ||
- name: PROVIDER_DNS_ZONE_SUFFIX | ||
value: "dev.example.com" | ||
- name: PROVIDER_WS_URL | ||
value: https://midaas.example.com/midaas/ws" | ||
- name: TSIG_ZONE_foo | ||
value: bar | ||
podSecurityContext: | ||
runAsNonRoot: false | ||
extraVolumes: | ||
- name: dev-workspace | ||
hostPath: | ||
path: /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: test | ||
spec: | ||
rules: | ||
- host: test.foo.dev.example.com | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: test | ||
port: | ||
number: 8080 |
Oops, something went wrong.