Skip to content

Commit

Permalink
adding ks8
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmordasiewicz committed Aug 7, 2024
1 parent 1ef9202 commit ab7432d
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifests/apps/ollama/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

---
"openapi": "3.0.3"
"info":
"title": "Ollama API"
Expand Down
13 changes: 13 additions & 0 deletions terraform/doit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#

FQDN="enhancedtick-management.canadacentral.cloudapp.azure.com:8443"
USERNAME="enhancedtick"
PASSWORD="k4bmR6S0bDMXrMtn"
TOKEN=$(echo "{'username':"${USERNAME}",'password':"${PASSWORD}",'vdom':'root'}" | base64 | tr -d '\n')

#curl -v -k -X POST -H "Content-Type: multipart/form-data" -H "Authorization:${TOKEN}" -F 'openapifile=@../manifests/apps/ollama/openapi.yaml' --insecure "https://${FQDN}/api/v2.0/waf/openapi.openapischemafile"

curl -v -k -X POST -H "Content-Type: multipart/form-data" -H "Authorization:${TOKEN}" -F '[email protected]' --insecure "https://${FQDN}/api/v2.0/waf/openapi.openapischemafile"

#curl -v -k -X POST -H "Content-Type: multipart/form-data" -H "Authorization:${TOKEN}" -F 'openapifile=@../manifests/apps/ollama/openapi.yaml' --insecure "https://${FQDN}/api/v2.0/waf/openapi.openapischemafile"
119 changes: 119 additions & 0 deletions terraform/petstore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
get:
summary: List all pets
operationId: listPets
tags:
- pets
parameters:
- name: limit
in: query
description: How many items to return at one time (max 100)
required: false
schema:
type: integer
maximum: 100
format: int32
responses:
'200':
description: A paged array of pets
headers:
x-next:
description: A link to the next page of responses
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/Pets"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
summary: Create a pet
operationId: createPets
tags:
- pets
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
required: true
responses:
'201':
description: Null response
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/pets/{petId}:
get:
summary: Info for a specific pet
operationId: showPetById
tags:
- pets
parameters:
- name: petId
in: path
required: true
description: The id of the pet to retrieve
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: array
maxItems: 100
items:
$ref: "#/components/schemas/Pet"
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
5 changes: 4 additions & 1 deletion terraform/spoke-k8s_cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,13 @@ resource "azurerm_kubernetes_flux_configuration" "flux_configuration" {

resource "null_resource" "openapi_file" {
depends_on = [azurerm_kubernetes_cluster.kubernetes_cluster, azurerm_linux_virtual_machine.hub-nva_virtual_machine]
triggers = {
always_run = timestamp()
}
provisioner "local-exec" {
interpreter = ["bash", "-c"]
command = <<-EOF
curl -k -X POST -H "Content-Type: multipart/form-data" -H "Authorization:eyJ1c2VybmFtZSI6InJlbGV2YW50aG9yc2UiLCJwYXNzd29yZCI6ImZzTlJCQ1NTdjhUYUtzeW4iLCJ2ZG9tIjoicm9vdCJ9Cg==" -F 'openapifile=@../manifests/apps/ollama/openapi.yaml' --insecure "https://relevanthorse-management.canadacentral.cloudapp.azure.com:8443/api/v2.0/waf/openapi.openapischemafile"
curl -k -X POST -H "Content-Type: multipart/form-data" -H "Authorization:eyJ1c2VybmFtZSI6ImVuaGFuY2VkdGljayIsInBhc3N3b3JkIjoiazRibVI2UzBiRE1Yck10biIsInZkb20iOiJyb290In0K" -F 'openapifile=@../manifests/apps/ollama/openapi.yaml' --insecure "https://${data.azurerm_public_ip.hub-nva-management_public_ip.fqdn}:${local.vm-image[var.hub-nva-image].management-port}/api/v2.0/waf/openapi.openapischemafile"
EOF
}
}
Expand Down

0 comments on commit ab7432d

Please sign in to comment.