Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Secret

Updated on 2023-06-25 GMT+08:00

Secrets are user-defined resources that store authentication and sensitive information such as application keys. They can be used as files or environment variables in applications.

Prerequisites

  • You have created a CCE cluster that requires a secret.

    For details about how to create a CCE cluster, see Creating a CCE Cluster.

  • You have created a namespace for the secret. For details, see Creating a Namespace.

Creating a Secret

  1. Log in to ServiceStage and choose Application Management > Application Configuration > Secret
  2. Click Create.
  3. Create a secret by Visualization or YAML.

    • Method 1: Visualization. On the displayed page, set the parameters listed in the following table. Parameters marked with an asterisk (*) are mandatory.
      Table 1 Parameters for creating a secret

      Parameter

      Description

      *Name

      Name of a secret, which must be unique in the same namespace.

      *Cluster

      Cluster where the secret will be used.

      Click Create Cluster to create a cluster.

      *Namespace

      Namespace to which the secret belongs. The default value is default.

      Description

      Description of the secret.

      Click Create Namespace to create a namespace.

      *Secret Type

      Select the type of the secret to be created based on service requirements.

      • Opaque: general secret type. If the secret type is not explicitly set in the secret configuration file, the default secret type is Opaque.
      • kubernetes.io/dockerconfigjson: a secret that stores the authentication information required for pulling images from a private repository.
      • IngressTLS: a secret that stores the certificate required by ingresses (layer-7 load balancing services).
      • Other: Enter a secret type that is none of the above.

      *Repository Address

      This parameter is valid only when Secret Type is set to kubernetes.io/dockerconfigjson. Enter the address of the image repository.

      *Secret Data

      Value of the data field in the application secret file.

      • If the secret type is Opaque, enter the key and value. The value must be encoded using Base64. For more information, see Base64 Encoding.

        Click Add Data to add secret data.

      • If the secret type is kubernetes.io/dockerconfigjson, enter the image repository address, username, and password.
      • If the secret type is IngressTLS, upload the certificate file and private key file.
      • If the secret type is Other, enter the secret type, key, and value.

      Secret Label

      Labels are attached to objects, such as applications, nodes, and services, in the form of key-value pairs.

      Labels define the identifiable attributes of these objects and are used to manage and select the objects.

      1. Click Add Label.
      2. Set keys and values.
    • Method 2: YAML.
      NOTE:

      To create a secret by uploading a file, ensure that the resource description file has been created. ServiceStage supports resource description files in YAML format. For more information, see Secret Resource File Configuration.

      1. Select a cluster from the Cluster drop-down list.
      2. (Optional) Click Upload File, select the created secret file, and click Open.
      3. Write or modify the secret file in Orchestration content.

  4. Click Create.

    The new secret is displayed in the secret list.

Secret Resource File Configuration

This section provides examples of configuring secret resource description files.

For example, you can retrieve the username and password for an application through a secret.

username: my-username

password: my-password

The content in the secret file secret.yaml is as follows. The value must be encoded using Base64. For more information, see Base64 Encoding.

apiVersion: v1
kind: Secret
metadata:
  name: mysecret           #Secret name.
  namespace: default       #Namespace. The default value is default.
data:
  username: ******    #The value must be encoded using Base64.
  password: ******  #The value must be encoded using Base64.
type: Opaque     #You are advised not to change this parameter value.

Base64 Encoding

To encrypt a string using Base64, run the echo -n'Content to be encoded' | base64 command in the local Linux environment. Example:

root@ubuntu:~# echo -n '3306' | base64
MzMwNg==

Where,

  • 3306 is the content to be encoded.
  • MzMwNg== is the encoded content.

Managing Secrets

Operation

Description

Modifying a secret

  1. Click Modify in the Operation column of the target secret.
  2. Modify the secret information according to Table 1.
  3. Click Modify Secret.

Deleting a secret

Click Delete in the Operation column of the secret to be deleted, and follow the system prompts to delete the secret.

Deleting secrets in batches

  1. Select the secrets to be deleted.
  2. Click Delete in the upper left of the page, and follow the system prompts to delete the secrets.

Viewing a secret

Click Show YAML in the Operation column of the target secret to view the content of the YAML file of the secret.

NOTE:

The secret list contains system secrets, which can only be viewed and cannot be modified or deleted.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback