Michael.K@CloudNativeForum
go get -u github.com/kubernetes/federation/cmd/kubefed
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=client
gcloud config set container/use_client_certificate True
export CLOUDSDK_CONTAINER_USE_CLIENT_CERTIFICATE=True
kubefed init k8s-fed \
--host-cluster-context={cluster}\
--dns-zone-name={domain}
--dns-provider=googlecloud-dns
kubefed join cluster1 \
--host-cluster-context={host}
kubectl create ns default
go get -u github.com/GoogleCloudPlatform/k8s-multicluster-ingress/cmd/kubemci
kubemci create {multi-ingress name} \
--ingress={ingress yaml} \
--kubeconfig=$HOME/.kube/conf
yarn global add kubefctl
kubefctl clusters create credential k8s \
-c k8s-cluster1,asia-east1-a \
-c k8s-cluster2,us-west1-a
# zoneprinter-deployment.yml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: zoneprinter
labels:
app: zoneprinter
spec:
selector:
matchLabels:
app: zoneprinter
template:
metadata:
labels:
app: zoneprinter
spec:
containers:
- name: frontend
image: gcr.io/google-samples/zone-printer:0.1
ports:
- containerPort: 80
# zoneprinter-service.yml
apiVersion: v1
kind: Service
metadata:
name: zoneprinter
labels:
app: zoneprinter
spec:
type: NodePort
selector:
app: zoneprinter
ports:
- name: http
port: 80
nodePort: 30061
# zoneprinter-ingress.yml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: zoneprinter
annotations:
kubernetes.io/ingress.class: gce-multi-cluster
kubernetes.io/ingress.global-static-ip-name: test-ip-address
spec:
backend:
serviceName: zoneprinter
servicePort: 80
kubefctl apply -f zoneprinter-deployment.yml
kubefctl apply -f zoneprinter-service.yml
kubefctl apply -f zoneprinter-ingress.yml