Skip to content

Instantly share code, notes, and snippets.

@jm96441n
Created April 17, 2024 19:26
Show Gist options
  • Save jm96441n/2150bc604beb9a64cd1178a2b005f2da to your computer and use it in GitHub Desktop.
Save jm96441n/2150bc604beb9a64cd1178a2b005f2da to your computer and use it in GitHub Desktop.
NET-8412 replication
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: basic
nodes:
- role: control-plane
image: kindest/node:v1.25.3
- role: worker
image: kindest/node:v1.25.3
# Contains values that affect multiple components of the chart.
global:
imageK8S: hashicorp/consul-k8s-control-plane:1.3.3
#imageK8S: consul-k8s-control-plane:local
image: hashicorp/consul-enterprise:1.17.2-ent
logLevel: debug
tls:
enabled: true
acls:
manageSystemACLs: true
enterpriseLicense:
secretName: "license"
secretKey: "key"
server:
enabled: true
# The number of server agents to run. This determines the fault tolerance of the cluster.
replicas: 1
# Contains values that configure the Consul UI.
ui:
enabled: true
connectInject:
#this needs to be true for newly created services to be added to the service mesh
#so they will display a topology tab. They won't if they're not explicitly in the service mesh
enabled: true
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: api-gateway
spec:
gatewayClassName: consul
listeners:
- protocol: HTTP
port: 9001
name: listener-one
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
name: global
spec:
config:
protocol: http
#!/bin/bash
set -e
if [ -z "$(kind get clusters | rg "basic")" ]; then
kind create cluster --config cluster.yaml
fi
kubectl create namespace consul
kubectl create secret generic license -n consul --from-literal="key=$CONSUL_LICENSE"
# The following line assumes that you have compiled the image locally using `make docker/dev` from the consul-k8s repo
kind load docker-image consul-k8s-control-plane:local -n basic
echo "helm installing"
consul-k8s install -config-file=./consul_values.yaml -auto-approve
echo "helm is done"
kubectl wait --timeout=180s --for=condition=Available=True deployments/consul-connect-injector -n consul
kubectl apply -f ./proxy-defaults.yaml
kubectl apply -f ./gw.yaml
while ! kubectl get deployments api-gateway; do sleep 1; done
kubectl wait --timeout=180s --for=condition=Available=True deployments/api-gateway || true
kubectl get svc -n consul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment