Skip to content
Permalink
Browse files

updated fetch request in front-end

  • Loading branch information...
Elliot Kim Elliot Kim
Elliot Kim authored and Elliot Kim committed Nov 16, 2018
1 parent 5f3f077 commit c8feb409a1ef8073e148d3af461bc653d5190182
Showing with 43 additions and 11 deletions.
  1. +2 −1 Dockerfile
  2. +12 −0 aws-auth-cm.yaml
  3. +1 −1 dist/main.js
  4. +24 −0 fabric8-rbac.yaml
  5. +1 −5 package.json
  6. +0 −1 src/client/app.js
  7. +3 −3 src/client/supplement/fetch.js
@@ -7,11 +7,12 @@ WORKDIR /usr/src/app

# install app dependencies
COPY package*.json ./
RUN npm run build
RUN npm install

# bundle app source
COPY . .

# bind to port 8080
# bind to port 3000
EXPOSE 3000
CMD ["npm", "run", "server"]
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: <ARN of instance role (not instance profile)>
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes

Large diffs are not rendered by default.

@@ -0,0 +1,24 @@
# NOTE: The service account `default:default` already exists in k8s cluster.
# You can create a new account following like this:
#---
#apiVersion: v1
#kind: ServiceAccount
#metadata:
# name: <new-account-name>
# namespace: <namespace>

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: fabric8-rbac
subjects:
- kind: ServiceAccount
# Reference to upper's `metadata.name`
name: default
# Reference to upper's `metadata.namespace`
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
@@ -8,11 +8,6 @@
"build": "webpack --mode production",
"server": "node src/server/server.js"
},
"proxy": {
"/api": {
"target": "http://localhost:3000"
}
},
"author": "",
"license": "ISC",
"dependencies": {
@@ -45,6 +40,7 @@
"babel-preset-react": "^6.24.1",
"css-loader": "^1.0.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^23.6.0",
"node-sass": "^4.9.4",
"nodemon": "^1.18.5",
"sass-loader": "^7.1.0",
@@ -24,7 +24,6 @@ import { createMuiTheme } from '@material-ui/core/styles';
import GithubCorner from 'react-github-corner'
import blue from '@material-ui/core/colors/blue';


// const theme = createMuiTheme({
// typography: {
// useNextVariants: true,
@@ -1,20 +1,20 @@

export default (nodes, edges, graph, that) => {
// this fetch receives the pod list
fetch('http://localhost:3000/api/pod')
fetch('http://localhost:3000/pod')
.then((podData) => {
// console.log(data);
return podData.json();
})
.then((podObject) => {
// this fetch receives the service list
fetch('http://localhost:3000/api/service')
fetch('http://localhost:3000/service')
.then((serviceData) => {
return serviceData.json();
})
.then((serviceObject) => {
console.log('serviceobject',serviceObject);
fetch('http://localhost:3000/api/ingress')
fetch('http://localhost:3000/ingress')
.then((ingressData) => {
return ingressData.json();
})

0 comments on commit c8feb40

Please sign in to comment.
You can’t perform that action at this time.