Coder Social home page Coder Social logo

rinormaloku / k8s-mastery Goto Github PK

View Code? Open in Web Editor NEW
884.0 37.0 834.0 542 KB

Repository for the article "Learn Kubernetes in Under 3 Hours"

Home Page: https://medium.com/p/114ff420e882/

CSS 4.91% JavaScript 55.78% Python 3.49% Java 18.68% HTML 12.46% Dockerfile 4.67%
kubernetes introduction react spring-boot flask-application microservices

k8s-mastery's Introduction

This repository contains the source files needed to follow the series Kubernetes and everything else or summarized as an article in Learn Kubernetes in Under 3 Hours: A Detailed Guide to Orchestrating Containers

To learn more about Kubernetes and other related topics check the following examples with the Sentiment Analysis application:

k8s-mastery's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-mastery's Issues

Getting error while trying to run mvn install command

While running mvn install command in sa-webapp folder I am getting this issue -

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.sa.web:sentiment-analysis-web:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty and 'parent.relativePath' points at wrong local POM @ line 14, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.sa.web:sentiment-analysis-web:0.0.1-SNAPSHOT (/home/ankk98/Documents/k8s-mastery/sa-webapp/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.sa.web:sentiment-analysis-web:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty and 'parent.relativePath' points at wrong local POM @ line 14, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

I think this is because of some issue with relative path property of parent.
I am completely new to maven so please guide me in fixing this issue.

Create a custom nginx.conf file

First, thank you for this amazing tutorial. When I reached the Nginx installation section, I thought that it wasn't optimal to move the contents of my frontend into the nginx HTML directory and instead I decided to create a custom nginx.conf file in my sa-frontend repo, so that way I can launch the server with nginx -c nginx.conf. Here is what the server definition of my conf file looks like:

  server {
    listen       80;
    server_name  localhost;

    location / {
      root   /path/to/sa-frontend/build;
      index  index.html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
      root   html;
    }
  }

I think this is a cleaner solution for running the app locally, however, if we run the app on Docker, then we should probably stick with the original approach.

mvn install for xsa-webapp is not working

I am following this tutorial (https://www.freecodecamp.org/news/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-orchestrating-containers-114ff420e882/)

I am currently stuck in step (Setting up the Spring Web Application)

I am trying to run mvn install . However, it does not produce the jar file. It gives me the following error massage. Knowing that I have JDK 8 installed and maven 3.8.2. I could not find maven 4.0.0 form Mac OS.

[WARNING] Error injecting: org.codehaus.plexus.archiver.jar.JarArchiver
java.lang.ExceptionInInitializerError
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.704 s
[INFO] Finished at: 2021-10-02T17:12:24-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project sentiment-analysis-web: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-jar-plugin:2.6:jar: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-jar-plugin:2.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/arenalyahya/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.6/maven-jar-plugin-2.6.jar
[ERROR] urls[1] = file:/Users/arenalyahya/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[2] = file:/Users/arenalyahya/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[3] = file:/Users/arenalyahya/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[4] = file:/Users/arenalyahya/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[5] = file:/Users/arenalyahya/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
.
.
.

[ERROR] -----------------------------------------------------
[ERROR] : Index 1 out of bounds for length 1
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException 

I am not sure what could be the problem. I found out that I should delete .m2/repo using the following command or something similar:
rm -rf rm -rf ~/.m2/repository/org/apache/
https://stackoverflow.com/questions/17223536/failed-to-execute-goal-org-apache-maven-pluginsmaven-compiler-plugin2-3-2comp

npm start throwing the below error

const {
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

SA_LOGIC_API_URL

Hi! I'm following the tutorial on FreeCodeCamp, and I've been having trouble with setting up the connection between the sa-logic container and the sa-webapp container (likely a problem with the SA_LOGIC_API_URL environment variable). What happens right now is, after building and running the three containers without a problem, when I go to "localhost:80", I can only see the "Sentiment Analysis" textbox, and when I type a sentence and send, nothing happens. As it is described in the tutorial, I ran "docker container list", and then "docker inspect " with the id of the sa-logic container, and then used the id when running the sa-webapp container as follows: "docker run -d -p 8080:8080 -e SA_LOGIC_API_URL='http://172.17.0.2:5000' gokcedilek/sentiment-analysis-web-app". However, even though these three containers seem to be up and running, I cannot get a response back when I submit a sentence. Do you know what could be the reason for my problem? I would appreciate any suggestions very much! Thanks!

Having trouble connecting frontend with the Spring app on Kubernetes

In the frontend app we used http://localhost:8080/sentiment as the endpoint for our sentiment scoring service, but after deploying the app on Kubernetes we need to change this IP to match the web app load balancer service. I have done exactly that and my IP now looks like http://192.168.64.2:31582/sentiment. I rebuilt the frontend, built a new docker image and pushed it to Docker Hub. Just to make sure, I also scaled frontend deployment to zero replicas and then back to 2. After doing this, I tried to tet the whole thing, but unfortunately, I got an error:

Failed to load resource: net::ERR_CONNECTION_REFUSED localhost:8080/sentiment:1
Uncaught (in promise) TypeError: Failed to fetch 192.168.64.2/:1

I'm not entirely sure why the localhost still appears there (my guess is that sa-web-app-deployment.yaml defines SA_LOGIC_API_URL as http://sa-logic which NAT might be translating as localhost), but it looks like it also noticed the new IP I gave it, namely 192.168.64.2

If I look at the logs of my web app pod, here is what I see (connection refused):

2020-07-04 20:30:36.221 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://localhost/analyse/sentiment": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)] with root cause

Any ideas what I could be doing wrong here?

Error while starting sa-frontend

After downloading dependencies, I've executed npm start .. the following errors appear `const {
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3

npm ERR! Linux 4.15.0-29-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'react-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the salogic-front package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs salogic-front
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls salogic-front
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/slounes/Bureau/minikube_test/k8s-mastery/sa-frontend/npm-debug.log
`

sa-logic container uses python 2 instead of 3

This morning I found your tutorial and noticed an issue with my app at the containerised level. The problem is that ubuntu seems to install python 2 by default and we need python 3.

No main manifest attribute in jar file

After building the WebApp I am unable to run it, and I've got the following error :

sa-webapp_1 | no main manifest attribute, in sentiment-analysis-web-0.0.1-SNAPSHOT.jar

I think something is wrong in the pom.xml file. Any ideas ?
PS: I am using the docker-compose branch

sa-web-app [500: Internal Server Error]

I ran all the containers as per given instructions, however when I click on the Send button to get the polarity of input sentence it gives 500: Internal Server error

image

Getting error in SA-webapp on running - comand => java -jar sentiment-analysis-web-0.0.1-SNAPSHOT.jar

2022-04-14 08:09:59.843 INFO 20614 --- [ main] com.sa.web.SentimentAnalysisWebApp : Starting SentimentAnalysisWebApp v0.0.1-SNAPSHOT on ip-172-31-46-215.ap-south-1.compute.internal with PID 20614 (/home/ec2-user/kubernetes/k8s-mastery/sa-webapp/target/sentiment-analysis-web-0.0.1-SNAPSHOT.jar started by root in /home/ec2-user/kubernetes/k8s-mastery/sa-webapp/target)
2022-04-14 08:09:59.854 INFO 20614 --- [ main] com.sa.web.SentimentAnalysisWebApp : No active profile set, falling back to default profiles: default
2022-04-14 08:10:00.019 INFO 20614 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@76f2b07d: startup date [Thu Apr 14 08:10:00 UTC 2022]; root of context hierarchy
2022-04-14 08:10:01.884 ERROR 20614 --- [ main] o.s.boot.SpringApplication : Application startup failed

java.lang.IllegalStateException: Cannot load configuration class: com.sa.web.SentimentAnalysisWebApp
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:249) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:283) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:127) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.9.RELEASE.jar!/:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) ~[spring-boot-1.5.9.RELEASE.jar!/:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) ~[spring-boot-1.5.9.RELEASE.jar!/:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-1.5.9.RELEASE.jar!/:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) ~[spring-boot-1.5.9.RELEASE.jar!/:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) ~[spring-boot-1.5.9.RELEASE.jar!/:1.5.9.RELEASE]
at com.sa.web.SentimentAnalysisWebApp.main(SentimentAnalysisWebApp.java:10) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[sentiment-analysis-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[sentiment-analysis-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[sentiment-analysis-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ~[sentiment-analysis-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: java.lang.ExceptionInInitializerError: null
at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:393) ~[spring-context-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
... 20 common frames omitted
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @2d209079
at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.proxy.Enhancer.(Enhancer.java:73) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
... 23 common frames omitted
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @2d209079
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[na:na]
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[na:na]
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) ~[na:na]
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) ~[na:na]
at org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) ~[na:na]
at org.springframework.cglib.core.ReflectUtils.(ReflectUtils.java:52) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329) ~[spring-core-4.3.13.RELEASE.jar!/:4.3.13.RELEASE]
... 35 common frames omitted

docker build doesn't work

Windows and Mac both give the same error, how to fix this??
Step 2/2 : COPY build /usr/share/nginx/html
COPY failed: stat /var/lib/docker/tmp/docker-builder802860079/build: no such file or directory

Port forwarding the pod with the frontend should use a different host port

In the article, the author used the following command: kubectl port-forward sa-frontend 88:80 which does not work for me. After a little bit of digging, I found this post which suggests that all ports < 1024 are privileged. I'm not sure how it worked for the author, but I had to switch to a different port (I used kubectl port-forward sa-frontend 8888:80) and it solved the problem

sa-logic Dockerfile throwing error

Tried to build sa-logic but throwing error

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fp2nq9sb/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fp2nq9sb/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-c43278nn/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/regex
         cwd: /tmp/pip-install-fp2nq9sb/regex/
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/regex
    copying regex_3/__init__.py -> build/lib.linux-x86_64-3.8/regex
    copying regex_3/regex.py -> build/lib.linux-x86_64-3.8/regex
    copying regex_3/_regex_core.py -> build/lib.linux-x86_64-3.8/regex
    copying regex_3/test_regex.py -> build/lib.linux-x86_64-3.8/regex
    running build_ext
    building 'regex._regex' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/regex_3
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c regex_3/_regex.c -o build/temp.linux-x86_64-3.8/regex_3/_regex.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fp2nq9sb/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fp2nq9sb/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-c43278nn/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/regex Check the logs for full command output.
The command '/bin/sh -c pip3 install -r requirements.txt &&     python3 -m textblob.download_corpora' returned a non-zero code: 1

after adding gcc, it is throwing limits.h not found

Failed to load resource: net::ERR_CONNECTION_REFUSED

i follw the doc runing the java app and python app,but i can't get any thing then i input some words and click "SEND" on the frontend page,i use dev tools get the message "Failed to load resource: net::ERR_CONNECTION_REFUSED".i checked the host,8080and 5000 ports status is LISTEN.

Spring backend load balancer service is not accessible from the frontend

The sa-web-app-lb Loadbalancer service is running on URL 192.168.49.2:31752
image

I placed this URL in App.js file
image

When I try to make a POST request to backend the connection times out,
image

However when I expose the sa-web-app-lb service using minikube service sa-web-app-lb, I am able to access it via Postman

image

What am I possibly doing wrong?

sa-logic not working

Hi
sa-logic python app is not working in my case.
Started it on local computer and posted a request:
curl -X POST localhost:5000/analyse/sentiment --data '{"sentence": "test"}'
got this answer:

<title>500 Internal Server Error</title>

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

And here is what have in terminal tab where python is running:
agorkiy@home:~/k8s-mastery/sa-logic/sa$ sudo python3 sentiment_analysis.py

  • Serving Flask app "sentiment_analysis" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    [2020-03-27 17:07:22,604] ERROR in app: Exception on /analyse/sentiment [POST]
    Traceback (most recent call last):
    File "/home/agorkiy/.local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
    File "/home/agorkiy/.local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/home/agorkiy/.local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/home/agorkiy/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/home/agorkiy/.local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
    File "/home/agorkiy/.local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functionsrule.endpoint
    File "sentiment_analysis.py", line 9, in analyse_sentiment
    sentence = request.get_json()['sentence']
    TypeError: 'NoneType' object is not subscriptable
    127.0.0.1 - - [27/Mar/2020 17:07:22] "POST /analyse/sentiment HTTP/1.1" 500 -

Any thoughts - am I doing something wrong or there is a bug somewhere here?

frontend throwing error in post

Hello,

I am at step 1 that is running the application locally. I set up everything but when I write something in the textbox and press enter getting this error:

POST http://localhost:8080/sentiment net::ERR_NAME_NOT_RESOLVED
Uncaught (in promise) TypeError: Failed to fetch

Please help.

/usr/share/nginx/html/sentiment not found

when I run docker-compose up, it occurs following error:

[error] 6#6: *1 open() "/usr/share/nginx/html/sentiment" failed (2: No such file or directory), client: 157.119.234.158, server: localhost

Cound anyone tell me how to fix this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.