-
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.
- Loading branch information
Thomas Eckert
committed
Aug 29, 2023
1 parent
1e57cd7
commit c5501cd
Showing
25 changed files
with
3,186 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,12 @@ | ||
#!/bin/bash | ||
|
||
CONSUL_K8S=~/repos/consul-k8s | ||
HELM_CHART=~/repos/consul-k8s/charts/consul | ||
|
||
cd $CONSUL_K8S | ||
make control-plane-dev-docker | ||
docker tag consul-k8s-control-plane-dev consul-k8s-control-plane-dev:local | ||
kind load docker-image consul-k8s-control-plane-dev:local -n one | ||
cd - | ||
|
||
helm install consul $HELM_CHART --set global.imageK8S=consul-k8s-control-plane-dev:local --namespace consul --create-namespace --wait |
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,32 @@ | ||
global: | ||
datacenter: test-custom-build | ||
imageK8S: hashicorppreview/consul-k8s-control-plane:1.2.0-dev | ||
logLevel: "trace" | ||
acls: | ||
manageSystemACLs: true | ||
bootstrapToken: | ||
secretName: acl-bootstrap | ||
secretKey: bootstrapToken | ||
tls: | ||
enabled: true | ||
|
||
|
||
externalServers: | ||
enabled: true | ||
hosts: ["test-custom-build.consul.fc085032-c7a5-40cb-b3d7-6eccaf9163c3.aws.hashicorp.cloud"] | ||
httpsPort: 443 | ||
useSystemRoots: true | ||
|
||
server: | ||
enabled: false | ||
|
||
connectInject: | ||
default: true | ||
apiGateway: | ||
logLevel: "trace" | ||
|
||
meshGateway: | ||
enabled: false | ||
|
||
ingressGateways: | ||
enabled: false |
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,7 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
- role: worker | ||
- role: worker |
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,23 @@ | ||
global: | ||
enabled: false | ||
imageK8S: hashicorp/consul-k8s-control-plane:1.1 | ||
image: hashicorp/consul:1.15 | ||
logLevel: "trace" | ||
acls: | ||
manageSystemACLs: true | ||
|
||
apiGateway: | ||
enabled: true | ||
image: hashicorp/consul-api-gateway:0.5.4 | ||
managedGatewayClass: | ||
enabled: true | ||
|
||
server: | ||
replicas: 3 | ||
enabled: true | ||
|
||
connectInject: | ||
default: true | ||
apiGateway: | ||
logLevel: "trace" | ||
|
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,36 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: sidecar-container-demo | ||
spec: | ||
containers: | ||
- image: busybox | ||
command: ["/bin/sh"] | ||
args: | ||
[ | ||
"-c", | ||
"while true; do echo echo $(date -u) 'Written by busybox sidecar container' >> /var/log/index.html; sleep 5;done", | ||
] | ||
name: sidecar-container | ||
resources: {} | ||
volumeMounts: | ||
- name: var-logs | ||
mountPath: /var/log | ||
lifecycle: | ||
postStart: | ||
httpPost: | ||
path: /index.html | ||
port: 80 | ||
scheme: HTTP | ||
- image: nginx | ||
name: main-container | ||
resources: {} | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- name: var-logs | ||
mountPath: /usr/share/nginx/html | ||
dnsPolicy: Default | ||
volumes: | ||
- name: var-logs | ||
emptyDir: {} |
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,31 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: sidecar-container-demo | ||
namespace: lifecycle | ||
annotations: | ||
consul.hashicorp.com/connect-inject: "false" | ||
spec: | ||
containers: | ||
- image: busybox | ||
command: ["/bin/sh"] | ||
args: | ||
[ | ||
"-c", | ||
"while true; do echo echo $(date -u) 'Written by busybox sidecar container' >> /var/log/index.html; sleep 10;done", | ||
] | ||
name: sidecar-container | ||
volumeMounts: | ||
- name: var-logs | ||
mountPath: /var/log | ||
- image: nginx | ||
name: main-container | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- name: var-logs | ||
mountPath: /usr/share/nginx/html | ||
dnsPolicy: Default | ||
volumes: | ||
- name: var-logs | ||
emptyDir: {} |
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: v1 | ||
kind: Pod | ||
metadata: | ||
name: lifecycle-demo | ||
spec: | ||
containers: | ||
- name: lifecycle-demo-container | ||
image: nginx | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] | ||
preStop: | ||
exec: | ||
command: ["/bin/sh","-c","nginx -s quit; while killall -0 nginx; do sleep 1; done"] | ||
|
||
|
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,15 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: lifecycle | ||
spec: | ||
containers: | ||
- image: nginx | ||
name: application | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- name: static | ||
mountPath: /usr/share/nginx/html | ||
|
||
|
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
File renamed without changes.
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,10 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: Gateway | ||
metadata: | ||
name: hello-gateway-orange | ||
spec: | ||
gatewayClassName: consul-orange | ||
listeners: | ||
- protocol: HTTP | ||
port: 80 | ||
name: http |
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,10 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: GatewayClass | ||
metadata: | ||
name: consul-orange | ||
spec: | ||
controllerName: consul.hashicorp.com/gateway-controller | ||
parametersRef: | ||
group: consul.hashicorp.com | ||
kind: GatewayClassConfig | ||
name: consul-api-gateway-orange |
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,13 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: GatewayClassConfig | ||
metadata: | ||
name: consul-api-gateway-orange | ||
spec: | ||
deployment: | ||
resources: | ||
limits: | ||
cpu: 122m | ||
memory: 122Mi | ||
requests: | ||
cpu: 111m | ||
memory: 111Mi |
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,11 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: hello-route | ||
spec: | ||
parentRefs: | ||
- name: hello-gateway-orange | ||
rules: | ||
- backendRefs: | ||
- name: hello-world | ||
port: 80 |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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 @@ | ||
#!/bin/bash | ||
|
||
CONSUL_K8S=~/repos/consul-k8s | ||
HELM_CHART=~/repos/consul-k8s/charts/consul | ||
CONSUL_DATAPLANE=~/repos/consul-dataplane | ||
|
||
cd $CONSUL_DATAPLANE | ||
|
||
cd - | ||
|
||
cd $CONSUL_K8S | ||
make control-plane-dev-docker | ||
docker tag consul-k8s-control-plane-dev consul-k8s-control-plane-dev:local | ||
kind load docker-image consul-k8s-control-plane-dev:local -n one | ||
cd - | ||
|
||
helm install consul $HELM_CHART -f ./consul-values.yaml --namespace consul --create-namespace --wait | ||
|
||
kubectl apply -f ../resources/server.yaml | ||
|
||
|
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,5 @@ | ||
{ | ||
"Kind": "service-detaults", | ||
"Name": "web", | ||
"Protocol": "http" | ||
} |
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,9 @@ | ||
Kind = "proxy-defaults" | ||
Name = "global" | ||
Expose { | ||
Paths = [ | ||
{ | ||
Protocol = "tcp" | ||
} | ||
] | ||
} |
Empty file.
Empty file.