123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- kind: Template
- apiVersion: v1
- metadata:
- annotations:
- description: The Gogs git server (https://gogs.io/)
- tags: instant-app,gogs,go,golang
- name: gogs
- objects:
- - kind: ServiceAccount
- apiVersion: v1
- metadata:
- creationTimestamp: null
- labels:
- app: ${APPLICATION_NAME}
- name: ${APPLICATION_NAME}
- - kind: Service
- apiVersion: v1
- metadata:
- annotations:
- description: Exposes the database server
- name: ${APPLICATION_NAME}-postgresql
- labels:
- app: ${APPLICATION_NAME}
- spec:
- ports:
- - name: postgresql
- port: 5432
- targetPort: 5432
- selector:
- name: ${APPLICATION_NAME}-postgresql
- - kind: DeploymentConfig
- apiVersion: v1
- metadata:
- annotations:
- description: Defines how to deploy the database
- name: ${APPLICATION_NAME}-postgresql
- labels:
- app: ${APPLICATION_NAME}
- spec:
- replicas: 1
- selector:
- name: ${APPLICATION_NAME}-postgresql
- strategy:
- type: Recreate
- template:
- metadata:
- labels:
- name: ${APPLICATION_NAME}-postgresql
- name: ${APPLICATION_NAME}-postgresql
- spec:
- serviceAccountName: ${APPLICATION_NAME}
- containers:
- - env:
- - name: POSTGRESQL_USER
- value: ${DATABASE_USER}
- - name: POSTGRESQL_PASSWORD
- value: ${DATABASE_PASSWORD}
- - name: POSTGRESQL_DATABASE
- value: ${DATABASE_NAME}
- - name: POSTGRESQL_MAX_CONNECTIONS
- value: ${DATABASE_MAX_CONNECTIONS}
- - name: POSTGRESQL_SHARED_BUFFERS
- value: ${DATABASE_SHARED_BUFFERS}
- - name: POSTGRESQL_ADMIN_PASSWORD
- value: ${DATABASE_ADMIN_PASSWORD}
- image: ' '
- livenessProbe:
- initialDelaySeconds: 30
- tcpSocket:
- port: 5432
- timeoutSeconds: 1
- failureThreshold: 10
- periodSeconds: 20
- name: postgresql
- ports:
- - containerPort: 5432
- readinessProbe:
- exec:
- command:
- - /bin/sh
- - -i
- - -c
- - psql -h 127.0.0.1 -U ${POSTGRESQL_USER} -q -d ${POSTGRESQL_DATABASE} -c 'SELECT 1'
- initialDelaySeconds: 5
- timeoutSeconds: 1
- failureThreshold: 10
- resources:
- limits:
- memory: 512Mi
- volumeMounts:
- - mountPath: /var/lib/pgsql/data
- name: gogs-postgres-data
- volumes:
- - name: gogs-postgres-data
- persistentVolumeClaim:
- claimName: gogs-postgres-data
- triggers:
- - imageChangeParams:
- automatic: true
- containerNames:
- - postgresql
- from:
- kind: ImageStreamTag
- name: postgresql:9.5
- namespace: openshift
- type: ImageChange
- - type: ConfigChange
- - kind: Service
- apiVersion: v1
- metadata:
- annotations:
- description: The Gogs server's http port
- service.alpha.openshift.io/dependencies: '[{"name":"${APPLICATION_NAME}-postgresql","namespace":"","kind":"Service"}]'
- labels:
- app: ${APPLICATION_NAME}
- name: ${APPLICATION_NAME}
- spec:
- ports:
- - name: 3000-tcp
- port: 3000
- protocol: TCP
- targetPort: 3000
- selector:
- app: ${APPLICATION_NAME}
- deploymentconfig: ${APPLICATION_NAME}
- sessionAffinity: None
- type: ClusterIP
- status:
- loadBalancer: {}
- - kind: Route
- apiVersion: v1
- id: ${APPLICATION_NAME}-http
- metadata:
- annotations:
- description: Route for application's http service.
- labels:
- app: ${APPLICATION_NAME}
- name: ${APPLICATION_NAME}
- spec:
- host: ${HOSTNAME}
- to:
- name: ${APPLICATION_NAME}
- - kind: DeploymentConfig
- apiVersion: v1
- metadata:
- labels:
- app: ${APPLICATION_NAME}
- name: ${APPLICATION_NAME}
- spec:
- replicas: 1
- selector:
- app: ${APPLICATION_NAME}
- deploymentconfig: ${APPLICATION_NAME}
- strategy:
- resources: {}
- rollingParams:
- intervalSeconds: 1
- maxSurge: 25%
- maxUnavailable: 25%
- timeoutSeconds: 600
- updatePeriodSeconds: 1
- type: Rolling
- template:
- metadata:
- creationTimestamp: null
- labels:
- app: ${APPLICATION_NAME}
- deploymentconfig: ${APPLICATION_NAME}
- spec:
- serviceAccountName: ${APPLICATION_NAME}
- containers:
- - image: " "
- imagePullPolicy: Always
- name: ${APPLICATION_NAME}
- ports:
- - containerPort: 3000
- protocol: TCP
- resources: {}
- terminationMessagePath: /dev/termination-log
- volumeMounts:
- - name: gogs-data
- mountPath: /opt/gogs/data
- - name: gogs-config
- mountPath: /etc/gogs/conf
- readinessProbe:
- httpGet:
- path: /
- port: 3000
- scheme: HTTP
- initialDelaySeconds: 3
- timeoutSeconds: 1
- periodSeconds: 20
- successThreshold: 1
- failureThreshold: 10
- livenessProbe:
- httpGet:
- path: /
- port: 3000
- scheme: HTTP
- initialDelaySeconds: 20
- timeoutSeconds: 1
- periodSeconds: 10
- successThreshold: 1
- failureThreshold: 10
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- securityContext: {}
- terminationGracePeriodSeconds: 30
- volumes:
- - name: gogs-data
- persistentVolumeClaim:
- claimName: gogs-data
- - name: gogs-config
- configMap:
- name: gogs-config
- items:
- - key: app.ini
- path: app.ini
- test: false
- triggers:
- - type: ConfigChange
- - imageChangeParams:
- automatic: true
- containerNames:
- - ${APPLICATION_NAME}
- from:
- kind: ImageStreamTag
- name: ${APPLICATION_NAME}:${GOGS_VERSION}
- type: ImageChange
- - kind: ImageStream
- apiVersion: v1
- metadata:
- labels:
- app: ${APPLICATION_NAME}
- name: ${APPLICATION_NAME}
- spec:
- tags:
- - name: "${GOGS_VERSION}"
- from:
- kind: DockerImage
- name: docker.io/openshiftdemos/gogs:${GOGS_VERSION}
- importPolicy: {}
- annotations:
- description: The Gogs git server docker image
- tags: gogs,go,golang
- version: "${GOGS_VERSION}"
- - kind: PersistentVolumeClaim
- apiVersion: v1
- metadata:
- name: gogs-data
- labels:
- app: ${APPLICATION_NAME}
- spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: ${GOGS_VOLUME_CAPACITY}
- - kind: PersistentVolumeClaim
- apiVersion: v1
- metadata:
- name: gogs-postgres-data
- labels:
- app: ${APPLICATION_NAME}
- spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: ${DB_VOLUME_CAPACITY}
- - kind: ConfigMap
- apiVersion: v1
- metadata:
- name: gogs-config
- labels:
- app: ${APPLICATION_NAME}
- data:
- app.ini: |
- RUN_MODE = prod
- RUN_USER = gogs
- [database]
- DB_TYPE = postgres
- HOST = ${APPLICATION_NAME}-postgresql:5432
- NAME = ${DATABASE_NAME}
- USER = ${DATABASE_USER}
- PASSWD = ${DATABASE_PASSWORD}
- [repository]
- ROOT = /opt/gogs/data/repositories
- [server]
- ROOT_URL=http://${HOSTNAME}
- SSH_DOMAIN=${HOSTNAME}
- [security]
- INSTALL_LOCK = ${INSTALL_LOCK}
- [service]
- ENABLE_CAPTCHA = false
- [webhook]
- SKIP_TLS_VERIFY = ${SKIP_TLS_VERIFY}
- parameters:
- - description: The name for the application.
- name: APPLICATION_NAME
- required: true
- value: gogs
- - description: 'Custom hostname for http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>'
- name: HOSTNAME
- required: true
- - description: Volume space available for data, e.g. 512Mi, 2Gi
- name: GOGS_VOLUME_CAPACITY
- required: true
- value: 1Gi
- - description: Volume space available for postregs data, e.g. 512Mi, 2Gi
- name: DB_VOLUME_CAPACITY
- required: true
- value: 1Gi
- - displayName: Database Username
- from: gogs
- value: gogs
- name: DATABASE_USER
- - displayName: Database Password
- from: '[a-zA-Z0-9]{8}'
- value: gogs
- name: DATABASE_PASSWORD
- - displayName: Database Name
- name: DATABASE_NAME
- value: gogs
- - displayName: Database Admin Password
- from: '[a-zA-Z0-9]{8}'
- generate: expression
- name: DATABASE_ADMIN_PASSWORD
- - displayName: Maximum Database Connections
- name: DATABASE_MAX_CONNECTIONS
- value: "100"
- - displayName: Shared Buffer Amount
- name: DATABASE_SHARED_BUFFERS
- value: 12MB
- - name: GOGS_VERSION
- displayName: Gogs Version
- description: 'Version of the Gogs container image to be used (check the available version https://hub.docker.com/r/openshiftdemos/gogs/tags)'
- value: "0.11.34"
- required: true
- - name: INSTALL_LOCK
- displayName: Installation lock
- description: 'If set to true, installation (/install) page will be disabled. Set to false if you want to run the installation wizard via web'
- value: "true"
- - name: SKIP_TLS_VERIFY
- displayName: Skip TLS verification on webhooks
- description: Skip TLS verification on webhooks. Enable with caution!
- value: "false"
|