Giter Site home page Giter Site logo

borisyip / web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openshift-examples/web

0.0 1.0 0.0 23.95 MB

๐Ÿš€ Content of examples.openshift.pub

Home Page: http://examples.openshift.pub

HTML 6.68% Shell 80.99% Dockerfile 10.93% CSS 1.40%

web's Introduction

Build & Deploy site

Source-to-Image

via Docker

s2i build https://github.com/openshift-examples/web.git \
    quay.io/openshift-examples/ubi8-s2i-mkdocs:latest \
    my-openshift-example

via Podman

s2i build https://github.com/openshift-examples/web.git \
    quay.io/openshift-examples/ubi8-s2i-mkdocs:latest \
    --as-dockerfile my-openshift-example

podman build -t my-openshift-example:latest -f my-openshift-example .
podman run -p 8080:8080 my-openshift-example:latest

OpenShift

oc new-build --name=stage-1-build-static-content \
  quay.io/openshift-examples/ubi8-s2i-mkdocs:latest~https://github.com/openshift-examples/web.git

oc create imagestream stage-2-nginx

# Create pull secret
#  https://access.redhat.com/terms-based-registry/

oc create -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: 12102058-openshift-examples-pull-secret
data:
  .dockerconfigjson: xxxxx
type: kubernetes.io/dockerconfigjson
EOF

oc apply -f - <<EOF
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  name: stage-2-nginx
spec:
  failedBuildsHistoryLimit: 5
  output:
    to:
      kind: ImageStreamTag
      name: stage-2-nginx:latest
  runPolicy: Serial
  source:
    images:
    - as: null
      from:
        kind: ImageStreamTag
        name: stage-1-build-static-content:latest
      paths:
      - destinationDir: .
        sourcePath: /opt/app-root/src/site/.
    type: Image
  strategy:
    sourceStrategy:
      from:
        kind: DockerImage
        name: registry.redhat.io/rhel8/nginx-116
      incremental: false
      pullSecret:
        name: 12102058-openshift-examples-pull-secret
    type: Source
  successfulBuildsHistoryLimit: 5
  triggers:
  - type: ConfigChange
  - type: "imageChange"
    imageChange:
      from:
        kind: "ImageStreamTag"
        name: "stage-1-build-static-content:latest"
EOF


oc new-app --name web stage-2-nginx

# ToDo Route with realdomain:
oc expose svc/web

oc expose svc/web \
  --hostname="examples.openshift.pub" \
  --name="examples-openshift-pub"

# create cname elb.6923.rh-us-east-1.openshiftapps.com.

oc apply -f https://raw.githubusercontent.com/rbo/openshift-acme/respect-range-limits/deploy/single-namespace/serviceaccount.yaml
oc apply -f https://raw.githubusercontent.com/rbo/openshift-acme/respect-range-limits/deploy/single-namespace/role.yaml
oc apply -f https://raw.githubusercontent.com/rbo/openshift-acme/respect-range-limits/deploy/single-namespace/issuer-letsencrypt-staging.yaml
oc create rolebinding openshift-acme --role=openshift-acme --serviceaccount="$( oc project -q ):openshift-acme" --dry-run -o yaml | oc apply -f -
oc apply -f - <<EOF
kind: Deployment
apiVersion: apps/v1
metadata:
  name: openshift-acme
  labels:
    app: openshift-acme
spec:
  selector:
    matchLabels:
      app: openshift-acme
  replicas: 2
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: openshift-acme
    spec:
      serviceAccountName: openshift-acme
      containers:
      - name: openshift-acme
        image: quay.io/rbo/openshift-acme-controller:respect-range-limits
        imagePullPolicy: Always
        args:
        - --exposer-image=quay.io/rbo/openshift-acme-exposer:respect-range-limits
        - --loglevel=4
        - --namespace=openshiftanwender
        - --namespace=\$(CURRENT_NAMESPACE)
        env:
        - name: CURRENT_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
EOF

oc annotate route/examples-openshift-pub kubernetes.io/tls-acme=true

# Disable cookies
oc annotate route/examples-openshift-pub haproxy.router.openshift.io/disable_cookies=true


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.