Я пытаюсь запустить online-auction-scala
на GCP. Единственная вещь, по которой я скучаю сейчас, это ingress
работа. Проверка работоспособности из службы search
сообщает о состоянии UNHEALTHY
, хотя служба search
запущена и в ее журналах нет ошибок.
Шаги, которые я делаю после создания образов Docker и публикации их в реестре Docker:
gcloud container clusters create mt-develop
gcloud container clusters get-credentials mt-develop
kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
helm install lightbend-helm-charts/reactive-sandbox --name reactive-sandbox
PRIMARY_ACCOUNT=$(gcloud info --format='value(config.account)')
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$PRIMARY_ACCOUNT
kubectl apply -f RBAC.yml
когда reactive-sandbox
готов, я запускаю скрипт из файла KUBERNATES.md
.
#
# NOTE: You must change the secret values below or the applications will crash.
#
# These values are used for Play's application secret. It is important that they are set to a secret value.
# More information: https://www.playframework.com/documentation/latest/ApplicationSecret
secret_bidding=Secret123
secret_item=Secret123
secret_user=Secret123
secret_search=Secret123
secret_web=Secret123
# Configure Play's Allowed Hosts filter.
# More information: https://www.playframework.com/documentation/latest/AllowedHostsFilter
allowed_host=.
# Default addresses for reactive-sandbox, which provides Cassandra, Kafka, Elasticsearch
export service_cassandra=_cql._tcp.reactive-sandbox-cassandra.default.svc.cluster.local
export service_kafka=_broker._tcp.reactive-sandbox-kafka.default.svc.cluster.local
export service_elasticsearch=_http._tcp.reactive-sandbox-elasticsearch.default.svc.cluster.local
# Deploy bidding-impl
rp generate-kubernetes-resources registry.mydomain.com/trg/biddingimpl:1.0.0-SNAPSHOT \
--generate-pod-controllers --generate-services --service-type="NodePort" \
--env JAVA_OPTS="-Dplay.http.secret.key=$secret_bidding -Dplay.filters.hosts.allowed.0=$allowed_host" \
--pod-controller-replicas 2 \
--external-service "cas_native=$service_cassandra" \
--external-service "kafka_native=$service_kafka" | kubectl apply -f -
# Deploy item-impl
rp generate-kubernetes-resources registry.mydomain.com/trg/itemimpl:1.0.0-SNAPSHOT \
--generate-pod-controllers --generate-services --service-type="NodePort" \
--env JAVA_OPTS="-Dplay.http.secret.key=$secret_item -Dplay.filters.hosts.allowed.0=$allowed_host" \
--pod-controller-replicas 2 \
--external-service "cas_native=$service_cassandra" \
--external-service "kafka_native=$service_kafka" | kubectl apply -f -
# Deploy user-impl
rp generate-kubernetes-resources registry.mydomain.com/trg/userimpl:1.0.0-SNAPSHOT \
--generate-pod-controllers --generate-services --service-type="NodePort" \
--env JAVA_OPTS="-Dplay.http.secret.key=$secret_user -Dplay.filters.hosts.allowed.0=$allowed_host" \
--pod-controller-replicas 2 \
--external-service "cas_native=$service_cassandra" \
--external-service "kafka_native=$service_kafka" | kubectl apply -f -
# Deploy search-impl
rp generate-kubernetes-resources registry.mydomain.com/trg/searchimpl:1.0.0-SNAPSHOT \
--generate-pod-controllers --generate-services --service-type="NodePort" \
--env JAVA_OPTS="-Dplay.http.secret.key=$secret_search -Dplay.filters.hosts.allowed.0=$allowed_host" \
--pod-controller-replicas 2 \
--external-service "cas_native=$service_cassandra" \
--external-service "kafka_native=$service_kafka" \
--external-service "elastic-search=$service_elasticsearch" | kubectl apply -f -
# Deploy webgateway
rp generate-kubernetes-resources registry.mydomain.com/trg/webgateway:1.0.0-SNAPSHOT \
--service-type="NodePort" \
--generate-pod-controllers --generate-services \
--env JAVA_OPTS="-Dplay.http.secret.key=$secret_web -Dplay.filters.hosts.allowed.0=$allowed_host" | kubectl apply -f -
# Deploy ingress for everything
# Note that some environments, such as IBM Cloud and Google Kubernetes Engine have slightly different nginx
# implementations. For these, you may need to specify `--ingress-path-suffix '*'` or `--ingress-path-suffix '.*'` as
# part of the command below.
rp generate-kubernetes-resources \
--generate-ingress --ingress-name online-auction \
registry.mydomain.com/trg/webgateway:1.0.0-SNAPSHOT \
registry.mydomain.com/trg/searchimpl:1.0.0-SNAPSHOT \
registry.mydomain.com/trg/userimpl:1.0.0-SNAPSHOT \
registry.mydomain.com/trg/itemimpl:1.0.0-SNAPSHOT \
registry.mydomain.com/trg/biddingimpl:1.0.0-SNAPSHOT | kubectl apply -f -
Любая помощь будет высоко ценится.