diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1976d8b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +version: 2 +jobs: + build: + machine: true + steps: + - checkout + - run: docker build -t whshk/nifi-frontend . + - run: docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: docker push whshk/nifi-frontend + diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9bf3d95 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +nifi.yaml +nifi-service.yaml + +frontend.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..61503c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM gcr.io/google-samples/hello-frontend:1.0 + +COPY frontend.conf /etc/nginx/conf.d/frontend.conf diff --git a/frontend.conf b/frontend.conf new file mode 100644 index 0000000..b96ce68 --- /dev/null +++ b/frontend.conf @@ -0,0 +1,11 @@ +upstream nifi { + server nifi; +} + +server { + listen 8080; + + location / { + proxy_pass http://nifi:8080; + } +} diff --git a/frontend.yaml b/frontend.yaml new file mode 100644 index 0000000..ed20364 --- /dev/null +++ b/frontend.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: Service +metadata: + name: nifi-frontend +spec: + selector: + app: nifi + tier: frontend + ports: + - protocol: "TCP" + port: 8080 + targetPort: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nifi-frontend +spec: + selector: + matchLabels: + app: nifi + tier: frontend + track: stable + replicas: 1 + template: + metadata: + labels: + app: nifi + tier: frontend + track: stable + spec: + containers: + - name: nginx + image: "whshk/nifi-frontend:latest" + lifecycle: + preStop: + exec: + command: ["/usr/sbin/nginx","-s","quit"] diff --git a/nifi-service.yaml b/nifi-service.yaml new file mode 100644 index 0000000..0c3f4b7 --- /dev/null +++ b/nifi-service.yaml @@ -0,0 +1,12 @@ +kind: Service +apiVersion: v1 +metadata: + name: nifi +spec: + selector: + app: nifi + tier: backend + ports: + - protocol: TCP + port: 8080 +targetPort: http diff --git a/nifi.yaml b/nifi.yaml new file mode 100644 index 0000000..149bccc --- /dev/null +++ b/nifi.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nifi +spec: + selector: + matchLabels: + app: nifi + tier: backend + track: stable + replicas: 1 + template: + metadata: + labels: + app: nifi + tier: backend + track: stable + spec: + containers: + - name: nifi + image: apache/nifi:latest + ports: + - name: http + containerPort: 8080 +