瀏覽代碼

initial import

Grega Bremec 3 年之前
當前提交
dce0ba41b9
共有 5 個文件被更改,包括 250 次插入0 次删除
  1. 124 0
      app-resources.yml
  2. 8 0
      auth-resource.yml
  3. 10 0
      cfg-resource.yml
  4. 101 0
      db-resources.yml
  5. 7 0
      kustomization.yml

+ 124 - 0
app-resources.yml

@@ -0,0 +1,124 @@
+apiVersion: v1
+kind: List
+metadata: {}
+items:
+- apiVersion: image.openshift.io/v1
+  kind: ImageStream
+  metadata:
+    labels:
+      app: quotes
+      app.kubernetes.io/component: quotes
+      app.kubernetes.io/instance: quotes
+      composition: quotes
+    name: quotes
+  spec:
+    lookupPolicy:
+      local: false
+- apiVersion: build.openshift.io/v1
+  kind: BuildConfig
+  metadata:
+    labels:
+      app: quotes
+      app.kubernetes.io/component: quotes
+      app.kubernetes.io/instance: quotes
+      composition: quotes
+    name: quotes
+  spec:
+    output:
+      to:
+        kind: ImageStreamTag
+        name: quotes:latest
+    postCommit: {}
+    resources: {}
+    source:
+      contextDir: quotes
+      git:
+        uri: https://git.p0f.net/gregab/sample-apps/
+      type: Git
+    strategy:
+      sourceStrategy:
+        from:
+          kind: ImageStreamTag
+          name: php:7.4-ubi8
+          namespace: openshift
+      type: Source
+    triggers:
+    - github:
+        secret: AjswNd0DGJn4t1txGl4I
+      type: GitHub
+    - generic:
+        secret: nka8bx8wM1ReHAO_VJm5
+      type: Generic
+    - type: ConfigChange
+    - imageChange: {}
+      type: ImageChange
+- apiVersion: apps/v1
+  kind: Deployment
+  metadata:
+    annotations:
+      image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"quotes:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"quotes\")].image"}]'
+    labels:
+      app: quotes
+      app.kubernetes.io/component: quotes
+      app.kubernetes.io/instance: quotes
+      composition: quotes
+    name: quotes
+  spec:
+    replicas: 1
+    selector:
+      matchLabels:
+        composition: quotes
+        deployment: quotes
+    strategy: {}
+    template:
+      metadata:
+        labels:
+          composition: quotes
+          deployment: quotes
+      spec:
+        containers:
+        - image: ' '
+          name: quotes
+          env:
+            - name: DATABASE_NAME
+              configMapKeyRef:
+                name: dbconfig
+                key: database
+            - name: DATABASE_USER
+              configMapKeyRef:
+                name: dbconfig
+                key: username
+            - name: DATABASE_PASSWORD
+              secretKeyRef:
+                name: dbauth
+                key: password
+            - name: DATABASE_SERVICE_NAME
+              value: quotesdb
+          ports:
+          - containerPort: 8080
+            protocol: TCP
+          - containerPort: 8443
+            protocol: TCP
+          resources: {}
+- apiVersion: v1
+  kind: Service
+  metadata:
+    labels:
+      app: quotes
+      app.kubernetes.io/component: quotes
+      app.kubernetes.io/instance: quotes
+      composition: quotes
+    name: quotes
+  spec:
+    ports:
+    - name: 8080-tcp
+      port: 8080
+      protocol: TCP
+      targetPort: 8080
+    - name: 8443-tcp
+      port: 8443
+      protocol: TCP
+      targetPort: 8443
+    selector:
+      composition: quotes
+      deployment: quotes

+ 8 - 0
auth-resource.yml

@@ -0,0 +1,8 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: dbauth
+  labels:
+    composition: quotes
+data:
+  password: ZWFsZmtnbnM0NTRkZ2Y=

+ 10 - 0
cfg-resource.yml

@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: dbconfig
+  labels:
+    composition: quotes
+data:
+  aio: "0"
+  database: quotes
+  username: quotes

+ 101 - 0
db-resources.yml

@@ -0,0 +1,101 @@
+apiVersion: v1
+kind: List
+metadata: {}
+items:
+- apiVersion: image.openshift.io/v1
+  kind: ImageStreamTag
+  metadata:
+    labels:
+      app: quotesdb
+      app.kubernetes.io/component: quotesdb
+      app.kubernetes.io/instance: quotesdb
+      app.kubernetes.io/name: mariadb
+      composition: quotes
+    name: quotesdb:10.3-el8
+  generation: 0
+  image:
+    dockerImageLayers: null
+    dockerImageMetadata: null
+    metadata:
+      creationTimestamp: null
+  lookupPolicy:
+    local: false
+  tag:
+    annotations: null
+    from:
+      kind: DockerImage
+      name: registry.redhat.io/rhel8/mariadb-103@sha256:89b8a68cb817f381aff9f0595e8b56e8541ee860cf7e23c0d97286164ffea9e7
+    generation: null
+    importPolicy:
+      scheduled: true
+    name: 10.3-el8
+    referencePolicy:
+      type: ""
+- apiVersion: apps/v1
+  kind: Deployment
+  metadata:
+    annotations:
+      image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"mariadb:10.3-el8","namespace":"openshift"},"fieldPath":"spec.template.spec.containers[?(@.name==\"quotesdb\")].image"}]'
+    labels:
+      app: quotesdb
+      app.kubernetes.io/component: quotesdb
+      app.kubernetes.io/instance: quotesdb
+      app.kubernetes.io/name: mariadb
+      composition: quotes
+    name: quotesdb
+  spec:
+    replicas: 1
+    selector:
+      matchLabels:
+        composition: quotes
+        deployment: quotesdb
+    strategy: {}
+    template:
+      metadata:
+        labels:
+          composition: quotes
+          deployment: quotesdb
+      spec:
+        containers:
+        - image: ' '
+          name: quotesdb
+          env:
+            - name: MYSQL_DATABASE
+              configMapKeyRef:
+                name: dbconfig
+                key: database
+            - name: MYSQL_USER
+              configMapKeyRef:
+                name: dbconfig
+                key: username
+            - name: MYSQL_PASSWORD
+              secretKeyRef:
+                name: dbauth
+                key: password
+            - name: MYSQL_AIO
+              configMapKeyRef:
+                name: dbconfig
+                key: aio
+          ports:
+          - containerPort: 3306
+            protocol: TCP
+          resources: {}
+- apiVersion: v1
+  kind: Service
+  metadata:
+    labels:
+      app: quotesdb
+      app.kubernetes.io/component: quotesdb
+      app.kubernetes.io/instance: quotesdb
+      app.kubernetes.io/name: mariadb
+      composition: quotes
+    name: quotesdb
+  spec:
+    ports:
+    - name: 3306-tcp
+      port: 3306
+      protocol: TCP
+      targetPort: 3306
+    selector:
+      composition: quotes
+      deployment: quotesdb

+ 7 - 0
kustomization.yml

@@ -0,0 +1,7 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+  - cfg-resource.yml
+  - auth-resource.yml
+  - db-resources.yml
+  - app-resources.yml